10.1. An Example of a Simple Type Derived from the Built-in token Datatype
The simpleType element restricts the value of another simple type. Listing 10.1 demonstrates the XML representation of partNameType. A part name represents a short description of a part. The name is limited to 40 characters, perhaps due to database or screen real estate limitations.
Listing 10.1. A Simple Type Derived from a Token (catalog.xsd)
<xsd:simpleType name="partNameType" final="list,union" id="catalog.partName.sType"> <xsd:annotation> <xsd:documentation xml:lang="en"> A part name can be almost anything. The name is a short description. </xsd:documentation> </xsd:annotation> <xsd:restriction base="xsd:token" id="pnt-rst"> <xsd:minLength value="1"/> <xsd:maxLength ... |
Get XML Schema Complete Reference, The now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.