In this tutorial you will learn about the XML Tree and its application with practical example.
XML Document gives way to represent information in a structured and self describing manner. When we closely analyze an XML Document it forms a tree structure.
Table Of Contents−
Lets take a look on an example XML Document
1 2 3 4 5 6 7 8 9 10 |
<?xml version="1.0" encoding="iso-8859-1"?> <inbox> <message id="1"> <from>John</from> <subject>Test Message 1</subject> <body>Hello John!</body> </message> </inbox> |
The first line is the XML declaration. It defines the XML version and the character encoding used.
Next to it is a root element “inbox” of XML body, there is one child element and three sub child element inside it, and after all there is closing tag of root element.
The terms parent, child, and sibling are used to describe the relationships between elements.