XML Schema Reference

Folder Left Edge Island Home Folder Right Edge
Folder Left Edge Components Online Reference Folder Right Edge
Folder Left Edge Text Page Complete Reference Folder Right Edge
Folder Left Edge Text Page W3C Recs Folder Right Edge
Folder Left Edge Examples Examples Folder Right Edge
Folder Left Edge ? Consulting & Training Folder Right Edge

The attribute Element

An attribute type, whose XML representation is the attribute element, constrains a corresponding element in an XML instance. Specifically, an element type associates a name with a simple type. In the trivial case, the simple type is just a built-in datatype. The subsequent example describes a customer element type that has a customerID attribute type:
    <xsd:element name="customer">
        <xsd:complexType>
            <xsd:attribute name="customerID"
                           type="xsd:string"
                           use="required"/>
        </xsd:complexType>
    </xsd:element>