Learn XML

           About XML . . .

  • XML stands for Extensible Markup Language
  • XML is a markup language much like HTML
  • XML was designed to carry data, not to display data
  • XML tags are not predefined. You must define your own tags
  • XML is designed to be self-descriptive
  • XML is a W3C Recommendation

  •  
    Below is the example of XML document :





    XML does not do anything. It was created to structure, store, and transport information.


    The Difference between XML and HTML


         XML    HTML
    displaying information carrying information

    XML is not a replacement for HTML.
    XML and HTML were designed with different goals:
    • XML was designed to transport and store data, with focus on what data is
    • HTML was designed to display data, with focus on how data looks
     
     
    • XML documents form a tree structure that starts at "the root" and branches to "the leaves".
    • Below is the example of XML document and simple syntax :
    XML documents use a self-describing and simple syntax:


    • The first line on the above example is the  XML declaration.
    • The highlighted word describes the root element of the document (like saying: "this document is a   note"), while the code in the middle describe 4 child elements of the root (to, from, heading, and body).

    XML Document Form a Tree Structure

     

    • XML documents must contain a root element. This element is "the parent" of all other elements.
    • The elements in an XML document form a document tree. The tree starts at the root and branches to the lowest level of the tree.
    • All elements can have sub elements (child elements):


    This an example of tree structure :



    • In HTML, some elements do not have to have a closing tag :

                     <p>This is a paragraph.
                    < br>
     
    • But in XML, it is illegal to omit the closing tag. All elements must have a closing tag:
     
                    <p>This is a paragraph.</p>
                    < br />
     
    •  XML tags are case sensitive. The tag <Letter> is different from the tag <letter>.
    • Opening and closing tags must be written with the same case :



     
     
     


    No comments:

    Post a Comment