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 simpleType Element

A simple type constrains the value of an attribute or an element in an XML instance. A simpleType element is the XML representation of a simple type. All simple types are direct or indirect derivations of built-in datatypes. The following simple type specifies a value for a part number. Each part number must conform to a pattern defined by a regular expression.
    <xsd:simpleType name="partNumberType"
                    final="union"
                    id="catalog.partNumber.sType">
        <xsd:annotation>
            <xsd:documentation xml:lang="en">
                Declaration of a part number.
                Each part number consists of one to
                three alphabetic characters followed by
                one to eight digits. The following part
                numbers, for example, are valid:
                    J1
                    ABC32897
                    ZZ22233344
            </xsd:documentation>
        </xsd:annotation>
            <xsd:restriction base="xsd:token">
                <xsd:pattern value="[A-Z]{1,3}\d{1,8}"/>
            </xsd:restriction>
    </xsd:simpleType>