- From: Patrick McCartney <pat.mccartney@ektron.com>
- Date: Tue, 30 Jul 2002 17:16:59 -0600
- To: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>
- Message-Id: <5.1.0.14.1.20020730171652.02589ce0@localhost>
If would be helpful to allow for an attribute type in the same way that an 
element type is supported.
Currently, if an attribute is defined, as if it were a type, then the 
actual attribute element cannot use within the type attribute the defined 
attribute type.
As an example, suppose I have a type of attribute that supports a certain 
set of values that extend the Boolean type to include any humanly accepted 
value:
             <xs:attribute name="yesnoType" default="true">
                         <xs:simpleType>
                                     <xs:restriction base="xs:NMTOKEN">
                                                 <xs:enumeration value="true"/>
                                                 <xs:enumeration 
value="false"/>
                                                 <xs:enumeration value="yes"/>
                                                 <xs:enumeration value="no"/>
                                                 <xs:enumeration value="ok"/>
                                                 <xs:enumeration 
value="never"/>
                                                 <xs:enumeration value="1"/>
                                                 <xs:enumeration value="0"/>
                                     </xs:restriction>
                         </xs:simpleType>
             </xs:attribute>
This type of attribute may be used for any number of attributes within the 
set of defined elements.  An example, that is not supported, is this:
             <xs:complexType name="statusType">
                         <xs:attribute name="id" type="xs:IDREF" 
use="required"/>
                         <xs:attribute name="popup" type="xs:IDREF"/>
                         <xs:attribute name= visible type="b:yesnoType"/>
                         <xs:attribute name= enabled type="b:yesnoType"/>
             </xs:complexType>
This would greatly reduce the size of a schema that uses these attributes.
Received on Wednesday, 31 July 2002 11:27:22 UTC