Xml-DS

From WikiEducator
Jump to: navigation, search
Uou-logo-100px.png
Home  |  About UOU  |  About CEMCA  |  Contact Us    

Unit 3.3 Web application development tools & Technologies


3.3.4 XML
3.3.4.1 XML document structure
3.3.4.2 XML element naming rules
3.3.4.3 Important rules to keep in mind while creating XML document
3.3.4.4 Viewing a XML document
3.3.4.5 Displaying XML with XSLT

3.3.4 XML Document Structure

XML document form a tree structure, and self describing and simple syntax.

<?xml version="1.0" encoding="UTF-8"?>
     <contact-detail>
        <name> Aakash Rathore </name>
        <company> ABC Ltd. </company>
        <phone> 234567 </phone>
     </contact-detail>

The first line is the XML declaration defines the XML version (1.0) and the encoding used UTF-8 (Unicode).

The document contains two types of information:
            1. Markup, like <contact-detail> and <name> etc.
            2. Character data, like “Aakash Rathore” and “234567”

XML document must contain root element. The root element is parent to all other elements. In the above example <contact-detail> tag is root tag.
XML tags must have the start and end of elements; tags are the logical units of information in an XML document.

XML Comments

Syntax of XML comments is
<!- - Comment - ->
                                                                                            Next

Suggested Reading
  • Web Applications


 Suggested Videos
  • Video 01 Title
  • Video 02 Title
  • Video 03 Title