About XML . . .
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 :
- To view more detail about XML tree structure you can visit this web XML Tree structure .
- In HTML, some elements do not have to have a closing tag :