S
Steven Burr
I would like to restrict the values of an attribute to boolean
expressions combining enumerated values. Is this possible?
An example instance document might look something like:
<myElement expression="apples OR oranges"/>
I thought I'd start with something like:
<xs:element name="myElement" type="myElementType"/>
<xs:complexType name="myElementType">
<xs:attribute name="expression" type="myAttributeType"/>
</xs:complexType>
<xs:simpleType name="myAttributeValues">
<xs:restriction base="xs:string">
<xs:enumeration value="apples"/>
<xs:enumeration value="oranges"/>
<xs:enumeration value="bananas"/>
<xs:enumeration value="pears"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="myAttributeType">
<xs:restriction base="myAttributeValues">
<!-- WHAT GOES HERE TO ALLOW BOOLEAN EXPRESSIONS
OF THE ENUMERATED TYPE VALUES? -->
</xs:restriction>
</xs:simpleType>
expressions combining enumerated values. Is this possible?
An example instance document might look something like:
<myElement expression="apples OR oranges"/>
I thought I'd start with something like:
<xs:element name="myElement" type="myElementType"/>
<xs:complexType name="myElementType">
<xs:attribute name="expression" type="myAttributeType"/>
</xs:complexType>
<xs:simpleType name="myAttributeValues">
<xs:restriction base="xs:string">
<xs:enumeration value="apples"/>
<xs:enumeration value="oranges"/>
<xs:enumeration value="bananas"/>
<xs:enumeration value="pears"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="myAttributeType">
<xs:restriction base="myAttributeValues">
<!-- WHAT GOES HERE TO ALLOW BOOLEAN EXPRESSIONS
OF THE ENUMERATED TYPE VALUES? -->
</xs:restriction>
</xs:simpleType>