What is the XML DOM?

The Document Object Model (DOM) represents an XML document as a logical tree structure. Each branch of the tree ends in a node, and each node contains objects.  DOM methods allow programmatic access to the tree, so programing languages can change the structure or the content of a document.
The Document Object Model (DOM) is a cross-platform and language-independent programming interface for accessing and manipulating XML documents.

Understanding the DOM is very important for everybody working with XML.

The above DOM representation is the logical tree of the following XML document:

<?xml version="1.0" encoding="UTF-8"?>
<interfaces>

  <interface name="Gig0/0">
    <address>10.1.1.1</address> 
    <mask>255.255.255.0</mask>     
  </interface>

  <interface name="Gig0/1">
    <address>192.168.1.1</address> 
    <mask>255.255.0.0</mask>     
  </interface>

</interfaces>

 Programming Interface

According to the XML DOM, everything in an XML document is a node:

  • The entire document is a document node
  • Every XML element is an element node
  • The text in the XML elements are text nodes
  • Every attribute is an attribute node
  • Comments are comment nodes

Full Content Access is for Registered Users Only (it's FREE)...

  • Learn any CCNA, DevNet or Network Automation topic with animated explanation.
  • We focus on simplicity. Networking tutorials and examples written in simple, understandable language for beginners.