distincting xs:choices in xsd by using fixed values for element with enumeration type
问题 Is it possible to distinct xs:choices in xsd by using fixed values? I have a simple type: <xs:simpleType name="datatypeCategory"> <xs:restriction base="xs:string"> <xs:enumeration value="SIMPLE"/> <xs:enumeration value="COMPLEX"/> <xs:enumeration value="COLLECTION"/> </xs:restriction> </xs:simpleType> And what I want to achieve is <xs:element name="datatype"> <xs:complexType> <xs:choice> <xs:sequence> <xs:element id="category" type="datatypeCategory" fixed="SIMPLE"/> <!-- some fields specific