Definitive XML Schema
Priscilla Walmsley (pwalmsley@datypic.com)
ISBN: 0132886723
2nd edition, , Prentice Hall PTR.
Chapter 11: Built-in simple types
Book examples
<xs:complexType name="TextType" mixed="true"> <xs:sequence> <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute ref="xml:lang"/> </xs:complexType>
<order orderID="A123"> <customer custID="A123">...</customer> </order>
<xs:complexType name="CustType"> <xs:attribute name="id" type="xs:ID"/> <xs:attribute name="custID" type="xs:ID"/> </xs:complexType>
<xs:attribute name="id" type="xs:ID" fixed="A123"/> <xs:attribute name="custID" type="xs:ID" default="C00000"/>
<xs:element name="quote"> <xs:complexType> <!--content model--> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> <xs:element name="footnote"> <xs:complexType> <!--content model--> <xs:attribute name="id" type="xs:ID" use="required"/> </xs:complexType> </xs:element>
<quote ref="fn1">...</quote> <footnote id="fn1">...</footnote>
<xs:element name="quote"> <xs:complexType> <!--content model--> <xs:attribute name="refs" type="xs:IDREFS"/> </xs:complexType> </xs:element> <xs:element name="footnote"> <xs:complexType> <!--content model--> <xs:attribute name="id" type="xs:ID" use="required"/> </xs:complexType> </xs:element>
<quote refs="fn1 fn2">...</quote> <footnote id="fn1">...</footnote> <footnote id="fn2">...</footnote>
<xs:element name="picture"> <xs:complexType> <xs:attribute name="location" type="xs:ENTITY"/> </xs:complexType> </xs: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>
<xs:element name="pictures"> <xs:complexType> <xs:attribute name="location" type="xs:ENTITIES"/> </xs:complexType> </xs: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>
equals <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>