This article has been excerpted from book "A Programmer's Guide to ADO.NET in C#".
Document Object Model
Document object model (DOM) is a platform and language neutral interface that allows programs and scripts to dynamically access and update XML and HTML documents. The DOM API is a set of language independent, implementation neutral interfaces and objects based on the Object Management Group (OMG) Interface Definition Language (IDL) specification (not the COM) version of IDL). Set http://www.w3.org/TR/DOM-Level-2/ for more detail.
DOM defines the logical structure of a document's data. You can access the document in a structured format (generally through a tree format). Tree nodes and entities represent the document's data. DOM also helps developers build XML and HTML documents, as well as to add, modify, delete, and navigate the document's data. Figure 6.2 shows you various contents of DOM in a tree structure.
Figure 6.2: DOM tree structure
This is the tree structure implementation of an XML file.
- <table>
- <tr>
- <td>Mahesh </td>
- <td>Testing</td>
- </tr>
- <tr>
- <td> Second Line</td>
- <td> Tested</td>
- </tr>
- </table>
Figure 6.3 shows the DOM tree representation of this XML.
Figure 6.3. XML DOM tree representation
In DOM, a document takes a hierarchical structure, which is similar to a tree structure. The document has a root node, and the rest of the document has branches and leaves.


Bhairab DuttPosted Aug 30, 2018, 1:35 AM
Nice Article about DOM ...
Arjun DhilodPosted Aug 30, 2018, 1:24 AM
Very nice sir
Praveen KumarPosted Aug 30, 2018, 1:09 AM
Updated on 8/30/2018