XML
  Home arrow XML arrow Page 4 - An Introduction to XML
Dev Shed Forums 
Administration  
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 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM Developerworks
 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

An Introduction to XML
By: Suresh Kumar
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 2 stars2 stars2 stars2 stars2 stars / 5
    1999-10-21

    Table of Contents:
  • An Introduction to XML
  • SGML, HTML and XML
  • Valid and Well-formed XML
  • Example XML Documents and analysis
  • Software for XML
  • Conclusion

  • 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

    PCmover - $15 Off with Coupon Code CJPH7Q

    An Introduction to XML - Example XML Documents and analysis
    (Page 4 of 6 )

    Example 1 - A well-formed XML document:


    <?xml version="1.0" standalone="no"?>
    <Mail>
    <From>Author</From>   
    <To>Receiver</To>
    <Date> Thu, 7 Oct 1999 11:15:16 -0600</Date>
    <Subject>XML Introduction</Subject>
    <body><p>Thanks for reading<Br/>
    this article</p>
    <br/>
    <p>Hope you enjoyed this article</p>
    </body>
    </Mail>

     


    The first line is the XML declaration and it identifies what follows as XML code. It is called the prolog. The attribute version indicates the version of the XML standard. The statement standalone="no" indicates that markup declarations are external to the document. The XML declaration can be considered as a "processing instruction". Though this declaration is not compulsory, it is better to include such declaration. This will increase the portability of the document.

    Example 2 - A valid XML document conforming to mail.dtd. Date element is missing because it is optional in the mail DTD The element P has the attribute justify. After the Body and before P Comments text is allowed, because DTD allows the use of plain text in the Body element.

    <?xml version="1.0" standalone="no"?> <!DOCTYPE Mail system "http://infowest.com/DTDS/mail.dtd"> <Mail> <From>Author</From> <To>Receiver</To> <Cc>Receiver2</Cc> <Subject>XML Introduction</Subject> <body>Comments:<p align="justify">Thanks for reading<Br/> this article</p> <br/> <p>Hope you enjoyed this article</p> </body> </Mail>

    Example 3 - A valid XML document conforming to "mail.dtd". Date element and Cc elements are present The element P has the attribute right.

    <?xml version="1.0" standalone="no"?> <!DOCTYPE Mail system "http://infowest.com/DTDS/mail.dtd"> <Mail> <From>Author</From> <To>Receiver</To> <Cc>Receiver2</Cc> <Date> Thu, 7 Oct 1999 11:15:16 -0600</Date> <Subject>XML Introduction</Subject> <body>Comments:<p align = "right" >Thanks for reading<Br/> this article</p> <br/> <p>Hope you enjoyed this article</p> </body> </Mail>

    An XML document can have comments. XML's comment syntax is similar to that of HTML. Any text, except double hyphen, "--", can be placed between <-- and --> tags. Processing instruction(PI) can be embedded in the documents. The data components of the PI should be recognized by the processing applications.

    Publishers may want to include some codes that should not be parsed by the parsers. Those codes can be put in to the ignored sections. An ignored section will have the syntax like this:

    <[CDATA[Any text to be ignored]]>

    In simple words, any ignored sections start with <[CDATA[ and end with ]]>

    More XML Articles
    More By Suresh Kumar


     

       

    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

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




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