Mega Code Archive

 
Categories / XML Tutorial / XML Schema
 

The union method joins the value spaces and lexical spaces of one or more datatypes to derive a new type

<!-- schema --> <xsd:element name="recipe">   <xsd:simpleType>    <xsd:union>     <xsd:simpleType>     <xsd:restriction base="decimal"/>     </xsd:simpleType>     <xsd:simpleType>      <xsd:restriction base="string"/>     </xsd:simpleType>    </xsd:union>   </xsd:simpleType> </xsd:element> <!-- instance document --> <recipe>1.5</recipe> <recipe>cups</recipe>