XML Tree & Nodes
In a XML Document, each Element is called as Nodes.,
More than one Nodes, when they are linked together forms an XML., An XML contains one single parent element, and any number of child elements, and each child element again contains child elements on its own., and totally we can refer it as XML Tree.,
Since XML elements are all organized and arranged in Nodes, we can find/get an element by parsing the elements.
Each Element is called as Node.,
Each Node/Element can have multiple attributes.,
XML contains only one element at the top., which is called Root Element.
A Node contains further nodes which are called child Node.
From the below Example, we can easily identify the Node, Child Nodes, Parent Node, Root Node & Attributes.,
<?xml version="1.0" standalone="yes"?>
<Name> John </Name>
<RollNumber> Sam </Name>
Of the above example,
|Root Node or Root Element||Students|
|Parent Nodes||Students, Departments|
|Child Nodes|| Name, RollNumber(child of Deparment)|
Department(child of Students)
|Attribute Element||branch is an attribute of Department Node|
The navigation usually comes from Root Node and branches to the child Node.,