Witten
Bainbridge
Nichols
HOME HELP PREFERENCES SEARCHFIGURESTABLES

Sample XML document

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
  Document Type Definition (DTD) for Non-Government Organizations (NGOs)
  -->
<!DOCTYPE NGODoc [
<!ELEMENT NGODoc (Head,Body)>
<!ELEMENT Head   (Title)>
<!ELEMENT Body   (#PCDATA|Agency)*>
<!ELEMENT Agency (Name,(Abbrev?|Photo*)+)>
<!ELEMENT Title  (#PCDATA)>
<!ELEMENT Name   (#PCDATA)>
<!ATTLIST Name
          hq CDATA #IMPLIED>
<!ELEMENT Abbrev (#PCDATA)>
<!ELEMENT Photo  EMPTY>
<!ATTLIST Photo
          src  CDATA #REQUIRED
          desc CDATA "A photo">
]>
<!-- Sample content conforming to DTD -->
<NGODoc>
<Head>
  <Title>Agencies of the United Nations</Title>
</Head>
<Body>
  <Agency>
    <Name hq="Paris, France">United Nations Educational, Scientific
              and Cultural Organization</Name>
    <Abbrev>UNESCO</Abbrev>
    <Photo src="photos/unesco_hq.jpg"
           desc="Aerial photo of main UNESCO building"/>
  </Agency>
  <Agency>
    <Name hq="Rome, Italy">Food and Agricultural Organization</Name>
    <Abbrev>FAO</Abbrev>
    <Photo src="photos/fao_hq.jpg"/>
  </Agency>
  <Agency>
    <Name hq="Washington, USA">World Bank</Name>
    <Photo src="photos/worldbank_hq.jpg"/>
  </Agency>
  <!-- and so on ... -->
</Body>
</NGODoc>

Figure 4.7: Sample XML document;