Work in progress

A document object model is an object model for documents. This provides a platform- and language-independent model for the programmatic control of information (data) presented as a document. As an object model, this manipulation is performed by invoking methods on objects, rather than by directly accessing the data contained within those objects.

The World Wide Web Consortium has defined two levels of model: DOM1 and DOM2. DOM2 supercedes DOM1. These object models apply to any data contained in valid HTML or well-formed XML documents. As XML is used to mark up just about any kind of data, the W3C Document Object Model has a very broad application.

A list of DOM1-compliant applications is here.

A list of DOM2-compliant applications is here.

The W3C's Document Object Model Level 2 (DOM2) splits the object model up into a number of discrete components. A DOMImplementation's "hasFeature" method can be queried to determine which features (components) are available from the following list (at version 2.0):

DOM2 is "namespace-aware". XML namespaces are defined in http://www.w3.org/TR/1999/REC-xml-names-19990114.

An XML namespace definition allows an application to define entity names that will not clash with entity names defined elsewhere through the use of namespaces. The application defines a namespace that is globally unique and then defines entity names within that namespace. A namespace is defined by a namespace URI. e.g.

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
where "http://www.w3.org/1999/XSL/Transform" is the namespace URI and "xsl" is the namespace prefix defined.

A qualified name consists of a namespace prefix, a colon and a local part. For example, "xsl:import" - "xsl" is the namespace prefix and "import" is the local part.

DOM2 does not require application be "namespace-aware". However, mixing use of namespace-extended methods with namespace-naive methods is not recommended (and could cause chaos and grief).

Nodes can be identified by their qualified name or their node name.

Log in or registerto write something here or to contact authors.