- From: Randy Eastwood <sunmesa@cox.net>
- Date: Mon, 15 Apr 2002 04:02:50 -0400
- To: "W3C XSchema List" <xmlschema-dev@w3.org>
Can someone tell me if this is the best/only way to restrict the values of an attribute?
I only have one attribute named "allow" and I want it to be either YES or NO.
Am I taking a bad approach here? It seems I have one layer to many. How/Can I reduce?
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="TEIMSettings">
<xs:complexType>
<xs:sequence>
<xs:element name="LACAllowTIRUpload" type="allowAttribute"/>
<xs:element name="LACAllowTIRDelete" type="allowAttribute"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="allowAttribute" >
<xs:attribute name="allow" type="allowValues" use="required"/>
</xs:complexType>
<xs:simpleType name="allowValues">
<xs:restriction base="xs:string">
<xs:enumeration value="YES"/>
<xs:enumeration value="NO"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
Received on Monday, 15 April 2002 04:03:14 UTC