• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 14. Working with XML > XML Document Structure

XML Document Structure

Listing 14.1 is an XML document that describes multiple companies and their employees.

Listing 14.1. CompaniesAndEmployees.xml—An XML Document

<?xml version="1.0" ?>
<companies>
  <company name="ABC MegaCorp, Inc." location="NY">
    <comments>A very big company that does many different things.</comments>
    <employee ssn="123-45-6789">
      <first-name>Ed</first-name>
      <last-name>Johnson</last-name>
      <department>Human Resources</department>
      <children>
        <child name="Sean" />
        <child name="Polly" />
      </children>
    </employee>
    <employee ssn="541-29-8376">
      <first-name>Maria</first-name>
      <last-name>Smith</last-name>
      <department>Accounting</department>
    </employee>
  </company>
  <company name="Baker &amp; Associates" location="CA">
    <comments>A midsized investment firm.</comments>
    <employee ssn="568-73-1924">
      <first-name>Eric</first-name>
      <last-name>Masters</last-name>
      <department>Accounting</department>
    </employee>
    <employee ssn="714-52-6938">
      <first-name>Tanya</first-name>
      <last-name>Peeples</last-name>
      <department>Public Relations</department>
      <children>
        <child name="Sandra" />
      </children>
    </employee>
  </company>
</companies>


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint