O'Reilly logo

Real World XML by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required