Definitive XML Schema
Priscilla Walmsley (pwalmsley@datypic.com)
ISBN: 0130655678
1st edition, , Prentice Hall PTR.
Chapter 12: Built-in simple types
Book examples
<order orderID="A123"> <customer custID="A123">...</customer> </order>
<xsd:complexType name="CustType"> <xsd:attribute name="id" type="xsd:ID" use="required"/> <xsd:attribute name="custSSN" type="xsd:ID" use="required"/> </xsd:complexType>
<xsd:attribute name="id" type="xsd:ID" fixed="A123"/> <xsd:attribute name="id" type="xsd:ID" default="A123"/>
<xsd:element name="quote"> <xsd:complexType> <!--content model--> <xsd:attribute name="ref" type="xsd:IDREF"/> </xsd:complexType> </xsd:element> <xsd:element name="footnote"> <xsd:complexType> <!--content model--> <xsd:attribute name="id" type="xsd:ID" use="required"/> </xsd:complexType> </xsd:element>
<quote ref="fn1">...</quote> <footnote id="fn1">...</footnote>
<xsd:element name="picture"> <xsd:complexType> <xsd:attribute name="location" type="xsd:ENTITY"/> </xsd:complexType> </xsd:element> <!--...-->
<!NOTATION jpeg SYSTEM "JPG"> <!ENTITY prod557 SYSTEM "prod557.jpg" NDATA jpeg> <!ENTITY prod563 SYSTEM "prod563.jpg" NDATA jpeg> ]> <catalog> <product> <number>557</number> <picture location="prod557"/> </product> <product> <number>563</number> <picture location="prod563"/> </product> </catalog>
<xsd:element name="pictures"> <xsd:complexType> <xsd:attribute name="location" type="xsd:ENTITIES"/> </xsd:complexType> </xsd:element>
<!NOTATION jpeg SYSTEM "JPG"> <!ENTITY prod557a SYSTEM "prod557a.jpg" NDATA jpeg> <!ENTITY prod557b SYSTEM "prod557b.jpg" NDATA jpeg> ]> <catalog> <product> <number>557</number> <pictures location="prod557a prod557b"/> </product> </catalog>
<integer>2</integer>
does not equal <string>2</string>
<integer>2</integer>
equals <positiveInteger>2</positiveInteger>
<string>abc</string>
equals <NCName>abc</NCName>
<string>abc</string>
does not equal <QName>abc</QName>
<IDREFS>abc</IDREFS>
does not equal <IDREF>abc</IDREF>
<integer>2</integer>
equals <integer>02</integer>
<integer>2</integer>
equals <positiveInteger>02</positiveInteger>
<string>2</string>
does not equal <string>02</string>
<boolean>true</boolean>
equals <boolean>1</boolean>
<hexBinary>0fb8</hexBinary>
equals <hexBinary>0FB8</hexBinary>
<time>13:20:00-05:00</time>
equals <time>12:20:00-06:00</time>
<string> a </string>
does not equal <token> a </token>
<string>a</string>
equals <token> a </token>
<token>a</token>
equals <token> a </token>