Defines an attribute type for use within the Schema element.
<AttributeType default="default-value" dt:type="primitive-type" dt:values="enumerated-values" name="idref" required="{yes | no}">
Number of occurrences | Unlimited |
Parent elements | ElementType, Schema |
Child elements | datatype, description |
Requires closing tag | Yes. XML Schema is an XML grammar and like all XML grammars, all tags must have closing tags to satisfy the definition of well-formed. |
An AttributeType declaration contained within an ElementType element defines that attribute type within the scope of the ElementType that contains it.
In XML Schema, as in XML 1.0, the order of appearance of attributes in an element is not constrained and a given attribute can appear no more than once in an element.
The following example shows an enumeration and its DTD equivalent:
<AttributeType name="colors" dt:type="enumeration" dt:values="red green blue"> <!ATTLIST x colors (red | green | blue)>
The following example declares an attribute type called "myattr." This declaration constrains "myattr" attributes to contain only a name token.
<AttributeType name="myattr" dt:type="nmtoken"/>