A Sample XML Document

The examples in this section are based on the following XML data. This data is in the bookstore.xml file, which is in the examples directory of your installation directory.

<?xml version="1.0"?>
<!-- This file represents a fragment of a bookstore inventory
database. -->
<bookstore specialty="novel"
xmlns:my="http://www.placeholder-name-here.com/schema/">
<book style="autobiography">
<title>Seven Years in Trenton</title>
<author>
<first-name>Joe</first-name>
<last-name>Bob</last-name>
<award>Trenton Literary Review Honorable Mention</award>
</author>
<pub_date>1997-11-30</pub_date>
<price>12</price>
</book>
<book style="textbook">
<title>History of Trenton</title>
<author>
<first-name>Mary</first-name>
<last-name>Bob</last-name>
<publication>
Selected Short Stories of
<first-name>Mary</first-name>
<last-name>Bob</last-name>
<price>14</price>
</publication>
</author>
<pub_date>1994-07-21</pub_date>
<price>55</price>
</book>
<magazine style="glossy" frequency="monthly">
<title>Tracking Trenton</title>
<price>2.50</price>
<subscription price="24" per="year"/>
</magazine>
<book style="novel" id="myfave">
<title>Trenton Today, Trenton Tomorrow</title>
<author>
<first-name>Toni</first-name>
<last-name>Bob</last-name>
<degree from="Trenton U">B.A.</degree>
<degree from="Harvard">Ph.D.</degree>
<award>Pulitzer</award>
<publication>Still in Trenton</publication>
<publication>Trenton Forever</publication>
</author>
<price intl="canada" exchange="0.7">6.50</price>
<excerpt>
<p>It was a dark and stormy night.</p>
<p>But then all nights in Trenton seem dark and
stormy to someone who has gone through what
<emph>I</emph> have.</p>
<definition-list>
<term>Trenton</term>
<definition>misery</definition>
</definition-list>
</excerpt>
</book>
<my:book style="leather" price="29.50">
<my:title>Who's Who in Trenton</my:title>
<my:author>Robert Bob</my:author>
</my:book>
<book style="tour">
<title>Tar Pits in Trenton</title>
<price>1.99</price>
</book>
</bookstore>

 
Free Stylus Studio XML Training: