Creating Simple Types
Most of the types that I've used in book.xsd are simple types that come built into the XML schema specification, such as xsd:string, xsd:integer, xsd:date, and so on. However, take a look at the attribute named bookID—this attribute is declared to be of the type catalogID:
<xsd:complexType name="books"> <xsd:element name="book" minOccurs="0" maxOccurs="10"> <xsd:complexType> <xsd:element name="bookTitle" type="xsd:string"/> <xsd:element name="pubDate" type="xsd:date" minOccurs='0'/> <xsd:element name="replacementValue" type="xsd:decimal"/> <xsd:element name="maxDaysOut"> <xsd:simpleType base="xsd:integer"> <xsd:maxExclusive value="14"/> </xsd:simpleType> </xsd:element> <xsd:attribute name="bookID" type="catalogID"/> </xsd:complexType> ...
Get Inside XML 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.