XML
  Home arrow XML arrow Page 3 - XML Basics (part 2)
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
Moblin 
VPS Hosting 
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

XML Basics (part 2)
By: icarus, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 5
    2001-07-28

    Table of Contents:
  • XML Basics (part 2)
  • Splitting Up
  • Eating Humble PI
  • XML And Alcohol
  • The Name Game
  • An Entity In The Attic
  • Digging For Treasure
  • The Man From IDIOT
  • Endgame

  • 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

    Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!

    XML Basics (part 2) - Eating Humble PI


    (Page 3 of 9 )

    In addition to character data, XML also allows document authors to include specific instructions or commands to the processing application within the document. These instructions are referred to as "processing instructions", or PIs. PIs are not part of character data; instead, when an XML parser encounters a PI, it simply hands it over to the calling application, which has the option of using it (if it recognizes it) or ignoring it (if it doesn't.)

    Every PI includes a target - this is the string used to identify the application to which the instruction is directed - followed by some data. This target-and-data combination is enclosed with <?...?> tags, as demonstrated by the following example:

    <?xml version="1.0"?> <directory> <category>Online Shopping<?rating popular?></category> <url>http://www.amazon.com</url> <desc>Amazon.com, the planet's foremost e-tailer<?link_with_ad ?></desc> <url>http://www.cdnow.com</url> <desc>CDNow.com, for all your music</desc> <url>http://www.bn.com</url> <desc>Barnes & Noble's online bookstore</desc> </directory>
    This data will be used by the XML application - for example, the first PI could indicate that the category be marked as "popular", while the second could link the item description with an advertisement.

    If you take a look at the document prolog (discussed in the last article), you'll see that the first line in any XML document,

    <?xml version="1.0"?>
    is actually a processing instruction.

    This article copyright Melonfire 2001. All rights reserved.

    More XML Articles
    More By icarus, (c) Melonfire


     

       

    XML ARTICLES

    - How to Set Up Podcasting and Vodcasting
    - Creating an RSS Reader Application
    - Building an RSS File
    - An Introduction to XUL Part 6
    - An Introduction to XUL Part 5
    - An Introduction to XUL Part 4
    - An Introduction to XUL Part 3
    - An Introduction to XUL Part 2
    - An Introduction to XUL Part 1
    - XML Matters: Practical XML Data Design and M...
    - Practical XML Data Design and Manipulation f...
    - SimpleXML
    - XForms Basics, Part 3
    - XForms Basics, Part 2
    - XForms Basics





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway