(1) See disk on module.|
(2) (Document Object Model) A specification for a programming interface (API) from the W3C that allows programs and scripts to update the content, structure and style of HTML and XML documents. A DOM implementation in a Web browser provides a core set of functions that let scripts access browser elements such as windows and history. Additional functions allow updating of HTML style sheets and XML content.
It Makes the Document Look Like a Database
DOM is especially useful for XML documents because it converts the document in memory into a hierarchical node tree that looks like a database record. The node tree allows updating in a similar manner to database updating, making data exchange between XML documents and databases more straightforward. Without DOM turning the document into an object model and handling the updating, the text and tags in an XML document would have to be scanned sequentially and rearranged by the program. DOM was first introduced in late 1998.
An Event Model Was Added
DOM Level 2 was introduced in late 2000 and added numerous features including an event model that passes events (mouse clicks, text changes, etc.) down the node hierarchy to the target element. This allows any node on the path to react to the event before the target handler gets it. Depending on the event, the event may also travel back up the hierarchy (called "bubbling"). See DOM implementation, DOM application, SAX and object model.
DOM converts (parses) an XML document into a hierarchical node tree as in this example. Writing an XML update program is then similar to writing a database update program, using the same kinds of functions available in a database management system.