Hi,
You can define that as a union between double and a type that allows
only the null value:
<xs:simpleType name="myage">
<xs:union memberTypes="xs:double">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="null"/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
However, XML Schema has support for nillable elements, so if you want
to use this simple type for an element you might consider the
alternative of defining the element nillable. Then in the instance you
just need to add xsi:nil="true" to the element to mark it as having no
value.
Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
hello wrote:
How can I define the schema so that myage element has to be double or
null?
<xs:simpleType name="myage">
<xs:restriction base="xs:double">
<xs:enumeration value="null"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>