Document Object Model: Difference between revisions

Content deleted Content added
corrected clumsy wording.
mNo edit summary
Line 3:
DOM was initially supported by [[web browser]]s to manipulate elements in a [[HTML]] document. DOM was a way of dynamically accessing and updating the content, structure and style of documents. Owing to incompatibilites in the DOM implementation between different browsers, the W3C came up with standard specifications for DOM. The foundation of the specifications was based on [[XML]] which at the time was emerging as a competitor to HTML in the area of structured languages.
 
DOM doesn't put restrictions on the document's underlying [[data structure]]. A well-structured document can take the [[tree structure|tree form]] using DOM. Most XML parsers (e.g., [[Xerces]]) and [[Extensible stylesheetStylesheet languageLanguage|XSL]] processors (e.g., [[Xalan]]) have been developed to make use of the tree structure. 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 randomly-accessed and manipulated. For XML-based applications which involve a one-time selective read/write per parse, DOM presents a considerable overhead on memory. The [[SAX]] model is advantageous in such a case in terms of speed and memory consumption.
 
The custodian of the DOM is the [[World Wide Web Consortium]] (W3C). The current DOM specification is Level 2. Level 1 specification allowed for [[navigation]] of an HTML or XML document and to manipulate content. Level 2 came up with XML [[Namespace]] support, filtered views and events. Level 3 specification is (as of 2003) a working draft and still under development at the W3C.