XML Tutorials
  Home arrow XML Tutorials arrow Page 4 - Creating XML Taxonomies
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML TUTORIALS

Creating XML Taxonomies
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-02-11

    Table of Contents:
  • Creating XML Taxonomies
  • What Are Our Needs?
  • Our Parents
  • What's Next?

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Creating XML Taxonomies - What's Next?


    (Page 4 of 4 )

     

    Now we have the basic parent fields for our taxonomy. The next step is to further develop these fields and figure out the child fields. Technically, we’ve already done most of this work. Let’s go ahead and show how our XML document might look. Child tags will be denoted by indentation. 

    <?xml version=”1.0” standalone=”Yes”?> //declaration, explained in a later article

    <albums> //Root

    <album> //Parent

    <albuminfo> //Child of album

    <artist> Rolling Stones </artist> //Child of albuminfo

    <genre> Rock and Roll <genre> //Child of albuminfo

    <format> CD </format> //Child of albuminfo

    <price> $19.95 </price> //Child of albuminfo

    <uniqueID> 00100 </uniqueID> //Child of albuminfo

    <label> Empire Records </label> //Child of albuminfo

    <length> //Child with no content

    <release> Oct 10, 2007 </release> //Child of albuminfo

    </albuminfo>

    <customerinfo>

    <first> Mick </first>

    <last> Mars </last>

    <address>

    <email>mickmars@email.com</email>

    <phone> 555-5555 </phone>

    </customerinfo>

    <salesinfo>

    <uniqueID> 00100 </uniqueID>

    <price> 19.95 </price>

    <coupon>

    <shipping> $2.00 </shipping>

    <totalPrice> $21.95 </shipping>

    <date> 10/11/2008 </date>

    <type> Retail </type>

    </salesinfo>

    </album>

    </albums>

     

    As you can see from above, albums is the root and we leave the root tag open until the end of the document, where we close it. Next we have album as a parent. Albuminfo is a child of album, and the fields: artist, genre, format, price, uniqueID, label, length, and release are all children of albuminfo. We leave albuminfo open until we list all of the child nodes, and then we close albuminfo. This continues with customerinfo and salesinfo. Finally, we close the album tag, and then the albums root. 

    This is a pretty simplistic view of an XML document. In reality they are much more complex. For instance, this setup shows no attributes. We will delve into that in a later article. 

    Final Words 

    In our next article we are going to begin using HTML and XHTML and learn how to validate our XML documents. We will look at the advantages of HTML and XHTML and truly begin to work with XML in real life scenarios. 

    Thank you for reading. If you have any questions or comments, please feel free to leave them.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Thanks for the great 3 parts so far James. I rated it a 4 star for now as I feel a...
     

    XML TUTORIALS ARTICLES

    - Validation with Document Type Definitions (D...
    - Creating a Well-Formed XML Document
    - Creating XML Taxonomies
    - Getting to Know XML
    - A Friendly Approach to XML
    - Creating RSS 2.0 Feeds
    - Using Modules in Your RSS Feed
    - RSS 2.0
    - Querying XML: Use Cases
    - Joins and Query Use with XML
    - Solving Problems by Querying XML
    - Performing Set Operations When Querying XML
    - Querying XML
    - Handling Data for Ajax with JSON
    - Handling XML Data for Ajax





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek