0% found this document useful (0 votes)
21 views

XML DOM - Node Tree

The document discusses XML DOM node trees. An XML document maintains a hierarchical structure called a node tree that allows developers to navigate and access information. The node tree starts with a root element that branches out to child elements at lower levels. An example XML document is provided along with a diagram showing its node tree structure, with the root node <Company> containing two child nodes <Employee> and their own child nodes.

Uploaded by

craf
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

XML DOM - Node Tree

The document discusses XML DOM node trees. An XML document maintains a hierarchical structure called a node tree that allows developers to navigate and access information. The node tree starts with a root element that branches out to child elements at lower levels. An example XML document is provided along with a diagram showing its node tree structure, with the root node <Company> containing two child nodes <Employee> and their own child nodes.

Uploaded by

craf
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

23/10/2021 16:30 XML DOM - Node Tree

XML DOM - Node Tree

In this chapter, we will study about the XML DOM Node Tree. In an XML document, the
information is maintained in hierarchical structure; this hierarchical structure is referred to as the
Node Tree. This hierarchy allows a developer to navigate around the tree looking for specific
information, thus nodes are allowed to access. The content of these nodes can then be
updated.
The structure of the node tree begins with the root element and spreads out to the child
elements till the lowest level.

Example

Following example demonstrates a simple XML document, whose node tree is structure is
shown in the diagram below −

<?xml version = "1.0"?>

<Company>

<Employee category = "Technical">

<FirstName>Tanmay</FirstName>

<LastName>Patil</LastName>

<ContactNo>1234567890</ContactNo>

</Employee>

<Employee category = "Non-Technical">

<FirstName>Taniya</FirstName>

<LastName>Mishra</LastName>

<ContactNo>1234667898</ContactNo>

</Employee>

</Company>

As can be seen in the above example whose pictorial representation (of its DOM) is as shown
below −

https://www.tutorialspoint.com/dom/xml_dom_node_tree.htm 1/2
23/10/2021 16:30 XML DOM - Node Tree

The topmost node of a tree is called the root. The root node is <Company> which in
turn contains the two nodes of <Employee>. These nodes are referred to as child
nodes.
The child node <Employee> of root node <Company>, in turn consists of its own child
node (<FirstName>, <LastName>, <ContactNo>).
The two child nodes, <Employee> have attribute values Technical and Non-Technical,
are referred as attribute nodes.
The text within every node is called the text node.

https://www.tutorialspoint.com/dom/xml_dom_node_tree.htm 2/2

You might also like