XML Tutorials
  Home arrow XML Tutorials arrow Page 3 - A Friendly Approach to XML
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

A Friendly Approach to XML
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2009-01-28

    Table of Contents:
  • A Friendly Approach to XML
  • The Disadvantages of XML
  • What You Can Do with XML
  • Keeping Your Data and Context Separated

  • 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


    A Friendly Approach to XML - What You Can Do with XML


    (Page 3 of 4 )

     

    Creating Your Own Markup 

    XML's brother, HTML (hypertextual markup language), as you probably know, is a language for creating web pages on the Internet. It has a set of predefined tags that coders use to display data and media on the Internet. These predefined tags, such as the <p> or paragraph tag, which allows you to create paragraphs, and the <b> tag, which creates bold text, can sometimes be restrictive, in that you cannot customize any tags to allow for any new type of data. I am reaching here a little bit, but as I get further into this section, it will begin to make more sense. 

    XML steps in to solve this issue. Say that I have a table in HTML that contains some song titles. The rows and data inside the table would look something like this:

     

    <tr>

    <td> Alive</td>

    <td> Sexyback</td>

    <td> She Thinks My Tractor Is Sexy </td>

    <tr>

     

    In HTML this table is just a list of song titles. That is, I can't easily define the data in each record without a bunch of hassle. XML comes in and saves the day by allowing us to give data to our data, or in simpler terms, to give context to the data in the table. 

    There exists no <genre> tag in HTML (there are of course ID3 tags for audio files, but that is another tutorial). With XML, however, we can create one. We could create any tag we wanted. We could have an <artist> tag, a <price> tag, and a <rating> tag, allowing us to give additional information about the data. So now in addition to song title, we have artist, price, genre, and rating, all of which make the field sortable and give a clearer vision of what our data is all about. After all, what good is data without a frame of reference? 

    If this seems a little fuzzy to you, don't worry too much about it. We will cover it in greater detail in our next article. 

    More XML Tutorials Articles
    More By James Payne


     

    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 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek