XML-Data Samples
Sung Nguyen
Sung_Nguyen at datacard.com
Thu Jul 30 18:04:13 BST 1998
Hello all:
I am a newbie to XML - I used IBM Alpha XML Parser to
work on these following samples (from XML-Data spec).
I don't understand what is the context of "schema" in this
sample.
Is the schema is a XML DTD or just XML file?
How do I include it into my XML file?
Please enlighten me - I greatly appreciate.
SeanN
---------------------------------------------------------------
<?xml:namespace name="http://company.com/schemas/books/" as="bk"/>
<?xml:namespace name="http://www.ecom.org/schemas/dc/" as="ecom" ?>
<bk:booksAndAuthors>
<Person>
<name>Henry Ford</name>
<birthday>1863</birthday>
</Person>
<Person>
<name>Harvey S. Firestone</name>
</Person>
<Person>
<name>Samuel Crowther</name>
</Person>
<Book>
<author>Henry Ford</author>
<author>Samuel Crowther</author>
<title>My Life and Work</title>
</Book>
<Book>
<author>Harvey S. Firestone</author>
<author>Samuel Crowther</author>
<title>Men and Rubber</title>
<ecom:price>23.95</ecom:price>
</Book>
</bk:booksAndAuthors>
--------------------------------------------------------------------
The schema for http://company.com/schemas/books:
<?xml:namespace name="urn:uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882/"
as="s"/?>
<?xml:namespace href="http://www.ecom.org/schemas/ecom/" as="ecom" ?>
<s:schema>
<elementType id="name">
<string/>
</elementType>
<elementType id="birthday">
<string/>
<dataType dt="date.ISO8601"/>
</elementType>
<elementType id="Person">
<element type="#name" id="p1"/>
<element type="#birthday" occurs="OPTIONAL">
<min>1700-01-01</min><max>2100-01-01</max>
</element>
<key id="k1"><keyPart href="#p1" /></key>
</elementType>
<elementType id="author">
<string/>
<domain type="#Book"/>
<foreignKey range="#Person" key="#k1"/>
</elementType>
<elementType id="writtenWork">
<element type="#author" occurs="ONEORMORE"/>
</elementType>
<elementType id="Book" >
<genus type="#writtenWork"/>
<superType href="
http://www.ecom.org/schemas/ecom/commercialItem"/>
<superType href="
http://www.ecom.org/schemas/ecom/inventoryItem"/>
<group groupOrder="SEQ" occurs="OPTIONAL">
<element type="#preface"/>
<element type="#introduction"/>
</group>
<element href="http://www.ecom.org/schemas/ecom/price"/>
<element href="ecom:quantityOnHand"/>
</elementType>
<elementTypeEquivalent id="livre" type="#Book"/>
<elementTypeEquivalent id="auteur" type="#author"/>
</s:schema>
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev
mailing list