The Document Object Model is a platform- and language-neutral interface that will allow programs and scripts to dynamically access and update the content, structure and style of documents. The document can be further processed and the results of that processing can be incorporated back into the presented page. The Document Object Model also contains a set of interfaces for an application that reads an XML (Extensible Markup Language) file into memory and stores it as a tree structure. The abstract API (Application Programming Interface) allows for constructing, accessing and manipulating the structure and content of XML and HTML documents.
The DOM is extremely useful for random-access applications. SAX (another API used in XML) only allows you a view of one bit of the document at a time. If you are looking at one SAX element, you have no access to another. If you are looking at a text node, you have no access to a containing element. When you write a SAX application, you need to keep track of your program's position in the document somewhere in your own code.…