Creating Simple Types

Most of the types I've used in ch05_07.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:sequence> <xsd:element name="book" minOccurs="0" maxOccurs="10"> <xsd:complexType> <xsd:sequence> <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> <xsd:restriction base="xsd:integer"> <xsd:maxExclusive value="14"/> </xsd:restriction> </xsd:simpleType> ...

Get Real World 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.