XML DOM Overview - XML DOM

Explain the detail the concept of XML DOM

In order to access the documents such as HTML and XML, a W3C standard is defined known as Document Object Model (DOM). The definition of DOM as per W3C is as

“The Document Object Model (DOM) is an application programming interface (API) for HTML and XML documents. It defines the logical structure of documents and the way a document is accessed and manipulated.”

The objects, properties, and the interface methods are defined by DOM for accessing all the XML elements. DOM is categorized into three parts:

  • Core DOM − standard model for any structured document
  • XML DOM − standard model for XML documents
  • HTML DOM − standard model for HTML documents

The standard object model of XML is XML DOM. Nodes are the XML documents having hierarchical information and these nodes and the relationship between them are described by the standard programming interface called DOM.

An API is provided by the XML DOM, enables the developers in adding, editing, moving or removing the nodes such that an application is created.

The DOM structure is explained with the following diagram. An XML document is evaluated by the parser as a DOM structure by passing through the node.

XML DOM Diagram

What are the advantages of XML DOM?

The following are the advantages of XML DOM.

  • XML DOM is an independent platform and a language.
  • XML DOM is traversable – XML DOM information is hierarcally organized enabling the developers to look for specific desired information by navigating around the hierarchy.
  • XML DOM is modifiable – The developer is facilitated to add, edit, move or remove the nodes on the tree at any point by the dynamic feature of XML DOM.

What are the disadvantages of XML DOM?

  • As the structure of XML is large, the memory consumer is more and the program once written stay back in the memory till it is explicitly removed.
  • The operational speed when compared to SAX is slower as the memory is used extensively by XML DOM.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

XML DOM Topics