So what is DOM?
Document Object Model (DOM) is a description of how an HTML or XML document is represented in an object-oriented fashion. DOM provides an application programming interface to access and modify the content, structure and style of the document.
Various interfaces were initially implemented by web browsers to manipulate elements in an HTML document through JavaScript. This prompted the World Wide Web Consortium (W3C) to come up with a series of standard specifications that defined the W3C Document Object Model (W3C DOM). The W3C specifications are platform and language independent. The previous vendor-specific interfaces were dubbed intermediate DOMs.
Using DOM, the document is accessed in a tree form and this is also the data structure that most XML parsers (e.g., Xerces) and XSL processors (e.g., Xalan) have been developed to make use of. Such an implementation requires that the entire content of a document be parsed and stored in memory.
Hence, DOM is best used for applications where the document elements have to be accessed and manipulated in an unpredictable sequence and repeatedly. If the application involves a sequential or one-time selective read or write per processed document, DOM presents a considerable overhead. The sequential SAX model is advantageous in such a case in terms of speed and memory consumption.
Comments (0)
You don't have permission to comment on this page.