XML Tree Structure

XML tree structure start to a Parent root from top of the side. Every XML documents have only one root element.

XML was describe a tree structures of data. And tree structure have one root, child elements, branches, attributes, values. Following are simple XML structures.


So upto now you know XML have ability to specify new tags and also create a nested tags to make a strict valid tree structure for exchanging data.

XML Tree Structure

XML Tree Structure

Above visual tree structure assume our example base on this structure make one XML document including all that describe information.

  <emp_info id="1">
        <comp_name>Odoo (formally OpenERP)</comp_name>
          <street>Tower-1, Infocity</street>
        <designation>Junior Engineer</designation>
    <email>[email protected]</email>

Run it...   »

Tree Structure Rules

Tag Name label for a section of data. Label must be relative to section data.

Section Element Section of data beginning with <tagname> and ending with </tagname>.
Example. <name> ... </name>

Nested Every element must be properly nested. Example: <name> <fist_name> ... </first_name> </name>

Attribute you can specify attribute name=value inside the starting tag of the element. You can specify several attributes.

Note Attributes specify for identify the elements.