The Cover PagesThe OASIS Cover Pages: The Online Resource for Markup Language Technologies
SEARCH | ABOUT | INDEX | NEWS | CORE STANDARDS | TECHNOLOGY REPORTS | EVENTS | LIBRARY
SEARCH
Advanced Search
ABOUT
Site Map
CP RSS Channel
Contact Us
Sponsoring CP
About Our Sponsors

NEWS
Cover Stories
Articles & Papers
Press Releases

CORE STANDARDS
XML
SGML
Schemas
XSL/XSLT/XPath
XLink
XML Query
CSS
SVG

TECHNOLOGY REPORTS
XML Applications
General Apps
Government Apps
Academic Apps

EVENTS
LIBRARY
Introductions
FAQs
Bibliography
Technology and Society
Semantics
Tech Topics
Software
Related Standards
Historic
Last modified: August 19, 2003
W3C Document Object Model (DOM)

Introduction

The W3C 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 goal of the DOM group is to define a programmatic interface for XML and HTML. The DOM is separated into three parts: Core, HTML, and XML. The Core DOM provides a low-level set of objects that can represent any structured document. While by itself this interface is capable of representing any HTML or XML document, the core interface is a compact and minimal design for manipulating the document's contents. Depending upon the DOM's usage, the core DOM interface may not be convenient or appropriate for all users. The HTML and XML specifications provide additional, higher-level interfaces that are used with the core specification to provide a more convenient view into the document. These specifications consist of objects and methods that provide easier and more direct access into the specific types of documents. Key industry players are participating in the DOM Working Group, including editors and contributors from ArborText, IBM, Inso EPS, JavaSoft, Microsoft, Netscape, Novell, the Object Management Group, SoftQuad, Sun Microsystems, Texcel, and W3C." The Chair of the W3C DOM WG is Lauren Wood of SoftQuad.

The DOM specification "defines the Document Object Model, 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 Object Model provides a standard set of objects for representing HTML and XML documents, a standard model of how these objects can be combined, and a standard interface for accessing and manipulating them. Vendors can support the DOM as an interface to their proprietary data structures and APIs, and content authors can write to the standard DOM interfaces rather than product-specific APIs, thus increasing interoperability on the Web." [from WD-DOM-19980318]

DOM is being designed at several levels:

  • "Level 1. This concentrates on the actual core, HTML, and XML document models. It contains functionality for document navigation and manipulation.
  • Level 2. Includes a style sheet object model, and defines functionality for manipulating the style information attached to a document. It also enables traversals on the document, defines an event model and provides support for XML namespaces.
  • Level 3. Will address document loading and saving, as well as content models (such as DTDs and schemas) with document validation support. In addition, it will also address document views and formatting, key events and event groups. First public working drafts are available.
  • Further Levels. These may specify some interface with the possibly underlying window system, including some ways to prompt the user. They may also contain a query language interface, and address multithreading and synchronization, security, and repository."

DOM Requirements Specifications

  • DOM Requirements

  • [April 19, 2001] Document Object Model (DOM) Requirements. W3C Working Draft 19-April-2001. Edited by Ben Chang, Oracle; Mike Champion, Software AG; James Davidson, Sun; Angel Diaz, IBM; Andy Heninger, IBM; Joe Kesselman, IBM; Philippe Le Hégaret, W3C, chair; Arnaud Le Hors, IBM; Tom Pixley, Netscape Communications Corporation; Jared Sorensen, Novell, Inc.; Ray Whitmer, Netscape Communications Corporation Lauren Wood, SoftQuad Software Inc. Latest version URL: http://www.w3.org/TR/DOM-Requirements. "This document contains the requirements for the Document Object Model, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model provides a standard set of objects for representing HTML and XML documents, a standard model of how these objects can be combined, and a standard interface for accessing and manipulating them. Vendors can support the DOM as an interface to their proprietary data structures and APIs, and content authors can write to the standard DOM interfaces rather than product-specific APIs, thus increasing interoperability on the Web."

  • Document Object Model (DOM) Requirements. W3C Working Draft 12 April, 2000. "This document contains the requirements for the Document Object Model, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model provides a standard set of objects for representing HTML and XML documents, a standard model of how these objects can be combined, and a standard interface for accessing and manipulating them. Vendors can support the DOM as an interface to their proprietary data structures and APIs, and content authors can write to the standard DOM interfaces rather than product-specific APIs, thus increasing interoperability on the Web."

  • [February 09, 2000] As part of the W3C DOM Activity, the W3C DOM Working Group has released an updated working draft document for the Document Object Model (DOM) Requirements. References: W3C Working Draft 08-February-2000; edited by Jared Sorensen (Novell, Inc.), Lauren Wood (SoftQuad Software Inc.) [WG Chair], and Philippe Le Hégaret( W3C). DOM Level 1 Requirements and DOM Level 2 Requirements are included. Abstract: "This specification contains the requirements for the Document Object Model, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model provides a standard set of objects for representing HTML and XML documents, a standard model of how these objects can be combined, and a standard interface for accessing and manipulating them. Vendors can support the DOM as an interface to their proprietary data structures and APIs, and content authors can write to the standard DOM interfaces rather than product-specific APIs, thus increasing interoperability on the Web." Comments on the new WD document are invited and should be sent to the W3C mailing list, where they will be publicly archived.

  • Document Object Model Requirements. W3C Working Draft 2-September-97; WD-dom-970902. Edited by Lauren Wood and Jared Sorensen. [cache]

DOM Level 3 Specifications

  • [April 04, 2003] "Document Object Model (DOM) Level 3 XPath Specification Version 1.0." Edited by Ray Whitmer (Netscape/AOL). W3C Candidate Recommendation 31-March-2003. Produced as part of the W3C DOM Activity. Latest version URL: http://www.w3.org/TR/DOM-Level-3-XPath. ['W3C has announced the advancement of the Document Object Model (DOM) Level 3 XPath Specification to Candidate Recommendation. The document provides access to a DOM tree using XPath 1.0. Reviews are welcome through May 26, 2003. Implementers are invited to send a message to the DOM public mailing list.'] "XPath 1.0 is becoming an important part of a variety of many specifications including XForms, XPointer, XSL, XML Query, and so on. It is also a clear advantage for user applications which use DOM to be able to use XPath expressions to locate nodes automatically and declaratively. This specification was created to map between the Document Object Model's representation of the W3C Information Set and XPath's model to permit XPath functions to be supplied and results returned within the framework of DOM APIs in a standard, interoperable way, allowing also for liveness of data, which is not addressed by the XPath specification but is present in results coming from the DOM hierarchy." See also the Document Object Model (DOM) Conformance Test Suites. Document available in in PDF format.

  • [October 08, 2002] "Document Object Model (DOM) Level 3 Validation Specification Version 1.0." W3C Working Draft 08-October-2002. Edited by Ben Chang (Oracle), Joe Kesselman (IBM), and Rezaur Rahman (Intel Corporation). Latest version URL: http://www.w3.org/TR/DOM-Level-3-Val. Last Call Working Draft for review by W3C members and other interested parties. "This specification defines the Document Object Model Validation Level 3, a platform- and language-neutral interface. This module provides the guidance to programs and scripts to dynamically update the content and the structure of documents while ensuring that the document remains valid, or to ensure that the document becomes valid. ... [Validation] describes the optional DOM Level 3 Validation feature. This module provides APIs to query information about the XML document. A DOM application can use the hasFeature method of the DOMImplementation interface to determine whether a given DOM supports these capabilities or not. This module defines 1 feature string: 'VAL-DOC' for document-editing interfaces. This chapter focuses on the editing aspects used in the XML document-editing world and usage of such information..." Also in PDF format.

  • [August 30, 2001] "Document Object Model (DOM) Level 3 XPath Specification Version 1.0." W3C Working Draft 30-August-2001. Edited by Ray Whitmer (Netscape/AOL). Philippe Le Hégaret wrote: "Following feedbacks on the lists, we changed the design of the API and dropped the dependency on XPath 2.0. All issues should be addressed..." Abstract: "This specification defines the Document Object Model Level 3 XPath. It provides simple functionalities to access a DOM tree using XPath 1.0. This module builds on top of the Document Object Model Level 3 Core. From the Introduction: "XPath is becoming an important part of a variety of many specifications including XForms, XPointer, XSL, CSS, and so on. It is also a clear advantage for user applications which use DOM to be able to use XPath expressions to locate nodes automatically and declaratively. But liveness issues have plagued each attempt to get a list of DOM nodes matching specific criteria, as would be expected for an XPath API. There have also traditionally been model mismatches between DOM and XPath. This proposal specifies new interfaces and approaches to resolving these issues... The XPath model relies on the XML Information Set [XML Information set] ands represents Character Information Items in a single logical text node where DOM may have multiple fragmented Text nodes due to cdata sections, entity references, etc. Instead of returning multiple nodes where XPath sees a single logical text node, only the first non-empty DOM Text node of any logical XPath text will be returned in the node set. Applications using XPath in an environment with fragmented text nodes must manually gather the text of a single logical text node from multiple nodes beginning with the first Text node identified by the implementation..." Version URL: http://www.w3.org/TR/2001/WD-DOM-Level-3-XPath-20010830. Latest version URL: http://www.w3.org/TR/DOM-Level-3-XPath. Previous version URL: http://www.w3.org/TR/2001/WD-DOM-Level-3-XPath-20010618. Also in PDF, Postscript, and single HTML file.

  • [August 24, 2001] "Document Object Model (DOM) Level 3 Events Specification Version 1.0." W3C Working Draft 23-August-2001. Edited by Tom Pixley (Netscape Communications Corporation). Part of the W3C DOM Activity. See also "Changes between DOM Level 2 Events and DOM Level 3 Events." "This specification defines the Document Object Model Events Level 3, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model Events Level 3 builds on the Document Object Model Events Level 2..."

  • [June 19, 2001] "Document Object Model (DOM) Level 3 XPath Specification Version 1.0." W3C Working Draft 18-June-2001. Edited by Ray Whitmer (Netscape/AOL). Latest version URL: http://www.w3.org/TR/DOM-Level-3-XPath. "The W3C DOM Working Group has published a first public Working Draft of the Document Object Model (DOM) Level 3 XPath Specification. This is the result of discussions from the 'www-dom-xpath' mailing list, feedback from the 'xml-dev' mailing list, and work within in the W3C DOM Working Group." The draft specification "defines the Document Object Model Level 3 XPath; it provides simple functionalities to access a DOM tree using XPath 1.0. This module builds on top of the Document Object Model Level 3 Core." Background: "XPath is becoming an important part of a variety of many specifications including XForms, XPointer, XSL, CSS, and so on. It is also a clear advantage for user applications which use DOM to be able to use XPath expressions to locate nodes automatically and declaratively. But liveness issues have plagued each attempt to get a list of DOM nodes matching specific criteria, as would be expected for an XPath API. There have also traditionally been object model mismatches between DOM and XPath. This proposal specifies new interfaces and approaches to resolving these issues..." Available as a single HTML file; also in PDF and Postscript formats. [cache]

  • Document Object Model (DOM) Level 3 Events Specification Version 1.0. W3C Working Draft 10-April-2001. Edited by Tom Pixley (Netscape Communications Corporation). Latest version URL: http://www.w3.org/TR/DOM-Level-3-Events. "This specification defines the Document Object Model Events Level 3, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model Events Level 3 builds on the Document Object Model Events Level 2... The goal of the DOM Level 3 Events specification is to expand upon the functionality specified in the DOM Level 2 Event Specification. The specification does this by adding new interfaces which are complimentary to the interfaces defined in the DOM Level 2 Event Specification as well as adding new event modules to those already defined. This specification requires the previously designed interfaces in order to be functional. It is not designed to be standalone. These interfaces are not designed to supercede the interfaces already provided but instead to add to the functionality contained within them."

  • [June 12, 2001] DOM Level 3 Abstract Schemas and Load and Save Specification Version 1.0. W3C Working Draft 07-June-2001. Edited by Ben Chang, Oracle; Andy Heninger, IBM; Joe Kesselman, IBM; Rezaur Rahman, Intel Corporation. Formerly known as 'DOM Level 3 Content Model and Load and Save'. "This specification defines the Document Object Model Abstract Schemas and Load and Save Level 3, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model Abstract Schemas and Load and Save Level 3 builds on the Document Object Model Core Level 3... This chapter describes the optional DOM Level 3 Abstract Schema (AS) feature. This module provides a representation for XML abstract schemas, e.g., DTDs and XML Schemas, together with operations on the abstract schemas, and how such information within the abstract schemas could be applied to XML documents used in both the document-editing and AS-editing worlds. It also provides additional tests for well-formedness of XML documents, including Namespace well-formedness. A DOM application can use the hasFeature method of theDOMImplementation interface to determine whether a given DOM supports these capabilities or not. One feature string for the AS-editing interfaces listed in this section is "AS-EDIT" and another feature string for document-editing interfaces is "AS-DOC". This chapter interacts strongly with the Load and Save chapter, which is also under development in DOM Level 3. Not only will that code serialize/deserialize abstract schemas, but it may also wind up defining its well-formedness and validity checks in terms of what is defined in this chapter. In addition, the AS and Load/Save functional areas will share a common error-reporting mechanism allowing user-registered error callbacks." [cache]

  • Document Object Model (DOM) Level 3 Content Models and Load and Save Specification. W3C Working Draft 19-April-2001. Edited by: Ben Chang, Oracle; Andy Heninger, IBM; Joe Kesselman, IBM; Rezaur Rahman, Intel Corporation. Latest version URL: http://www.w3.org/TR/DOM-Level-3-CMLS. "This specification defines the Document Object Model Content Models and Load and Save Level 3, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model Content Models and Load and Save Level 3 builds on the Document Object Model Core Level 3. [1] This 'Content Models' chapter describes the optional DOM Level 3 Content Model (CM) feature. This module provides a representation for XML content models, e.g., DTDs and XML Schemas, together with operations on the content models, and how such information within the content models could be applied to XML documents used in both the document-editing and CM-editing worlds. It also provides additional tests for well-formedness of XML documents, including Namespace well-formedness. A DOM application can use the hasFeature method of theDOMImplementation interface to determine whether a given DOM supports these capabilities or not. One feature string for the CM-editing interfaces listed in this section is '"CM-EDIT' and another feature string for document-editing interfaces is 'CM-DOC'. This chapter interacts strongly with the Load and Save chapter, which is also under development in DOM Level 3. Not only will that code serialize/deserialize content models, but it may also wind up defining its well-formedness and validity checks in terms of what is defined in this chapter. In addition, the CM and Load/Save functional areas will share a common error-reporting mechanism allowing user-registered error callbacks. Note that this may not imply that the parser actually calls the DOM's validation code -- it may be able to achieve better performance via its own -- but the appearance to the user should probably be 'as if' the DOM has been asked to validate the document, and parsers should probably be able to validate newly loaded documents in terms of a previously loaded DOM CM... [2] Load and Save Requirements DOM Level 3 will provide an API for loading XML source documents into a DOM representation and for saving a DOM representation as a XML document. Some environments, such as the Java platform or COM, have their own ways to persist objects to streams and to restore them. There is no direct relationship between these mechanisms and the DOM load/save mechanism. This specification defines how to serialize documents only to and from XML format."

  • [November 16, 2000] Document Object Model (DOM) Level 3 Views and Formatting Specification Version 1.0. Reference: W3C Working Draft 15-November-2000, edited by Ray Whitmer (Netscape Communications Corporation). "This specification defines the Document Object Model Views and Formatting Level 3, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model Views and Formatting Level 3 builds on the Document Object Model Views Level 2." Available as Postscript, PDF, and ZIP format. [cache]

  • [February 09, 2001] Document Object Model (DOM) Level 3 Content Models and Load and Save Specification. Version 1.0. Reference: W3C Working Draft 09-February-2001. Edited by Ben Chang, Oracle; Andy Heninger, IBM; Joe Kesselman, IBM; Rezaur Rahman, Intel Corporation. "This specification defines the Document Object Model Content Models and Load and Save Level 3, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model Content Models and Load and Save Level 3 builds on the Document Object Model Core Level 3." Also as single HTML document and as PDF.

  • [November 02, 2000] DOM Level 3 Content Models and Level 3 Load/Save API. Philippe Le Hégaret (W3C, DOM Activity Lead) announced the release of a W3C working draft from the DOM Working Group which "includes an update of the Content Models and the first bits of the Load and Save module." This WD is part of the W3C Document Object Model (DOM) Activity, released as a preliminary version of the Level 3 API. Document Object Model (DOM) Level 3 Content Models and Load and Save Specification, Version 1.0. Reference: W3C Working Draft 01-November-2000, edited by Ben Chang (Oracle), Andy Heninger (IBM), and Joe Kesselman (IBM). Document abstract: "This specification defines the Document Object Model Content Models and Load and Save Level 3, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model Content Models and Load and Save Level 3 builds on the Document Object Model Core Level 3... Section 1 provides a representation and operations for XML content models like DTDs and W3C XML schemas. Section 2 provides an API for loading XML source documents into a DOM representation and for saving a DOM representation as an XML document." Description: "This 'Content Models and Validation' module provides a representation for XML content models, e.g., DTDs and XML Schemas, together with operations on the content models, and how such information within the content models could be applied to XML documents used in both the document-editing and CM-editing worlds. It also provides additional tests for well-formedness of XML documents, including Namespace well-formedness. A DOM application can use the hasFeature method of the DOMImplementation interface to determine whether a given DOM supports these capabilities or not. The feature string for all the interfaces listed in this section is 'CM'. This chapter interacts strongly with the 'Load and Save' chapter, which is also under development in DOM Level 3. Not only will that code serialize/deserialize content models, but it may also wind up defining its well-formedness and validity checks in terms of what is defined in this chapter. In addition, the CM and Load/Save functional areas will share a common error-reporting mechanism allowing user-registered error callbacks. Note that this may not imply that the parser actually calls the DOM's validation code -- it may be able to achieve better performance via its own -- but the appearance to the user should probably be 'as if' the DOM has been asked to validate the document, and parsers should probably be able to validate newly loaded documents in terms of a previously loaded DOM CM." Comments on the new working document are invited, and may be sent to the public-archived mailing list www-dom@w3.org. [cache]

  • [June 12, 2001] Document Object Model (DOM) Level 3 Core Specification Version 1.0. W3C Working Draft 05-June-2001. Edited by Arnaud Le Hors, IBM; Gavin Nicol, Inso EPS (for DOM Level 1); Lauren Wood, SoftQuad, Inc. (for DOM Level 1); Mike Champion, ArborText (for DOM Level 1 from November 20, 1997); Steve Byrne, JavaSoft (for DOM Level 1 until November 19, 1997). Latest version URL: http://www.w3.org/TR/DOM-Level-3-Core. This specification defines the Document Object Model Core Level 3, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model Core Level 3 builds on the Document Object Model Core Level 2." [cache]

  • [September 01, 2000] W3C Publishes First Public Working Draft of DOM Level 3. Philippe Le Hégaret (W3C, DOM Activity Lead) announced the publication of a first public Working Draft specification for W3C DOM Level 3. The DOM specification has been separated in several documents -- one module per document. The specification has been produced by members of the DOM working group as part of the W3C DOM Activity. Comments may be sent to the public mailing list, which is archived. (1) Document Object Model (DOM) Level 3 Core Specification Version 1.0 [W3C Working Draft 01-September-2000], edited by Arnaud Le Hors (IBM). "This specification defines the Document Object Model Core Level 3, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model Core Level 3 builds on the Document Object Model Core Level 2." Also: PDF, PostScript, and HTML/XML in .ZIP. (2) Document Object Model (DOM) Level 3 Events Specification Version 1.0 [W3C Working Draft 01-September-2000], edited by Philippe Le Hégaret (W3C) and Tom Pixley (Netscape Communications Corporation). "It defines the Document Object Model Events Level 3, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model Events Level 3 builds on the Document Object Model Events Level 2. . . The goal of the DOM Level 3 Events specification is to expand upon the functionality specified in the DOM Level 2 Event Specification. The specification does this by adding new interfaces which are complimentary to the interfaces defined in the DOM Level 2 Event Specification as well as adding new event sets to those already defined. This specification requires the previously designed interfaces in order to be functional. It is not designed to be standalone. These interfaces are not designed to supercede the interfaces already provided but instead to add to the functionality contained within them." Also: PDF, PostScript, and HTML/XML in .ZIP. (3) Document Object Model (DOM) Level 3 Content Models and Load and Save Specification Version 1.0 [W3C Working Draft 01-September-2000], edited by Ben Chang (Oracle), Andy Heninger (IBM), and Joe Kesselman (IBM). "This specification defines the Document Object Model Content Models and Load and Save Level 3, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model Content Models and Load and Save Level 3 builds on the Document Object Model Core Level 3." Also: PostScript, PDF, and HTML/XML in .ZIP.

DOM Level 2 Specifications

  • [October 07, 2002] "Document Object Model (DOM) Level 2 HTML Specification Version 1.0." W3C Candidate Recommendation 07-October-2002. Edited by Johnny Stenback (Netscape), Philippe Le Hégaret (W3C), and Arnaud Le Hors (W3C and IBM). Latest version URL: http://www.w3.org/TR/DOM-Level-2-HTML. The specification "defines the Document Object Model Level 2 HTML, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content and structure of HTML 4.01 and XHTML 1.0 documents. The Document Object Model Level 2 HTML builds on the Document Object Model Level 2 Core and is not backward compatible with DOM Level 1 HTML. The goals of the HTML-specific DOM API are: (1) to specialize and add functionality that relates specifically to HTML documents and elements. (2) to address issues of backwards compatibility with the DOM Level 0. (3) to provide convenience mechanisms, where appropriate, for common and frequent operations on HTML documents. The key differences between the core DOM and the HTML application of DOM is that the HTML Document Object Model exposes a number of convenience methods and properties that are consistent with the existing models and are more appropriate to script writers. In many cases, these enhancements are not applicable to a general DOM because they rely on the presence of a predefined DTD. The transitional or frameset DTD for HTML 4.01, or the XHTML 1.0 DTDs are assumed. Interoperability between implementations is only guaranteed for elements and attributes that are specified in the HTML 4.01 and XHTML 1.0 DTDs..." Also in PDF format.

  • [November 14, 2000] DOM Level 2 Published As a W3C Recommendation. W3C has released the Document Object Model (DOM) Level 2 Core Specification Version 1.0 and its associated modules as a W3C Recommendation. Core Reference: W3C Recommendation 13-November-2000, edited by Arnaud Le Hors, Philippe Le Hégaret, Lauren Wood (WG Chair), Gavin Nicol, Jonathan Robie, Mike Champion, and Steve Byrne. Four other modules released with the Core include: (1) Document Object Model (DOM) Level 2 Views Specification; (2) Document Object Model (DOM) Level 2 Events Specification; (3) Document Object Model (DOM) Level 2 Style Specification; (4) Document Object Model (DOM) Level 2 Traversal and Range Specification. At the same time, a working draft has been issued for Document Object Model (DOM) Level 2 HTML Specification (to ensure backwards compatibility). Excerpts from the W3C press release: "Leading the Web to its full potential, the World Wide Web Consortium (W3C) today released the Document Object Model Level 2 specification as a W3C Recommendation. The specification reflects cross-industry agreement on a standard API (Applications Programming Interface) for manipulating documents and data through a programming language (such as Java or ECMAScript). A W3C Recommendation indicates that a specification is stable, contributes to Web interoperability, and has been reviewed by the W3C Membership, who favor its adoption by the industry. Created and developed by the W3C Document Object Model (DOM) Working Group, this specification extends the platform- and language-neutral interface to access and update dynamically a document's content, structure, and style first described by the DOM Level 1 Recommendation. The DOM Level 2 provides a standard set of objects for representing Extensible Markup Language (XML) documents and data, including namespace support, a style sheet platform which adds support for CSS 1 and 2, a standard model of how these objects may be combined, and a standard interface for accessing and manipulating them. DOM Level 1 was designed for HTML 4.0 and XML 1.0. With DOM Level 2, authors can take further advantage of the extensibility of XML. Simply put, anywhere you use XML, you can now use the DOM to manipulate it. The standard DOM interface makes it possible to write software (similar to plug-ins) for processing customized tag-sets in a language- and platform-independent way. A standard API makes it easier to develop modules that can be re-used in different applications. DOM Level 2 provides support for XML namespaces, extending and improving the XML platform. As more sites move to XML for content delivery, DOM Level 2 emerges as a critical tool for developing dynamic Web content. The DOM defines a standard API that allows authors to write programs that work without changes across tools and browsers from different vendors. But beyond this, it provides a uniform way to produce programs that work across a variety of different devices, so all may benefit from dynamically generated content.. The DOM Level 2 Cascading Style Sheet (CSS) API makes it possible for a script author to access and manipulate style information associated with contents, while preserving accessibility. DOM Level 2 also includes an Events API to provide interactivity anywhere someone uses XML - in documents, in data, or in B2B applications..."

  • [September 28, 2000] Members of the W3C have released an announcement for the promotion of DOM Level 2 specifications to PR (Proposed Recommendation) status. The announcement for DOM Level2 PR has three parts: (1) The DOM Level 2 Proposed Recommendation URIs; (2) A content summary of DOM Level 2; (3) Results of the DOM Level 2 Candidate Recommendation Phase. The DOM Level 2 specification has been published as six (6) separate modules: (1) Document Object Model Level 2 Core; (2) Document Object Model Level 2 Views; (3) Document Object Model Level 2 HTML; (4) Document Object Model Level 2 Style; (5) Document Object Model Level 2 Events; (6) Document Object Model Level 2 Traversal and Range. During the Candidate Recommendation phase, "implementations have been made of every part of the specification, but the interoperability between different implementations has not been as exhaustively tested. However, what interoperability testing has been done has yielded only positive results. A significant number of different implementations from different sources were involved. As other specifications depend on DOM Level 2 (SMIL, SVG, MathML), and as the experience to date has been successful, the Director has approved DOM Level 2 to be presented to the AC for consideration as a Recommendation." The Document Object Model (DOM) "is an application programming interface (API) for valid HTML and well-formed XML documents. It defines the logical structure of documents and the way a document is accessed and manipulated. In the DOM specification, the term 'document' is used in the broad sense -- increasingly, XML is being used as a way of representing many different kinds of information that may be stored in diverse systems, and much of this would traditionally be seen as data rather than as documents. Nevertheless, XML presents this data as documents, and the DOM may be used to manage this data. With the Document Object Model, programmers can build documents, navigate their structure, and add, modify, or delete elements and content. Anything found in an HTML or XML document can be accessed, changed, deleted, or added using the Document Object Model, with a few exceptions - in particular, the DOM interfaces for the XML internal and external subsets have not yet been specified. As a W3C specification, one important objective for the Document Object Model is to provide a standard programming interface that can be used in a wide variety of environments and applications. The DOM is designed to be used with any programming language. In order to provide a precise, language-independent specification of the DOM interfaces, we have chosen to define the specifications in Object Management Group (OMG) IDL, as defined in the CORBA 2.3.1 specification. In addition to the OMG IDL specification, we provide language bindings for Java and ECMAScript (an industry-standard scripting language based on JavaScript and JScript)." See further (1) W3C Document Object Model (DOM) page, (2) the DOM Activity, and (3) "W3C Document Object Model (DOM)." [W3C announcement]

  • [March 08, 2000] The Document Object Model (DOM) Level 2 Specification Version 1.0 has been released as a Candidate Recommendation, the review period for which ends on 20-March-2000. This specification is part of the W3C DOM Activity. Reference: W3C Candidate Recommendation 07-March-2000; edited by Lauren Wood, Arnaud Le Hors, Vidur Apparao, Laurence Cable, Mike Champion, Mark Davis, et al. The specification is also available as a PostScript file, a PDF file, as plain text, and in a ZIP archive file. The DOM Level 2 specification "defines the Document Object Model Level 2, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model Level 2 builds on the Document Object Model Level 1. The DOM Level 2 is made of a set of core interfaces to create and manipulate the structure and contents of a document and a set of optional modules. These modules contain specialized interfaces dedicated to XML, HTML, an abstract view, generic stylesheets, Cascading Style Sheets, Events, traversing the document structure, and a Range object."

  • [December 10, 1999] Document Object Model (DOM) Level 2 Specification Published as W3C Candidate Recommendation. As part of the W3C DOM Activity, the Document Object Model Working Group has published a new Candidate Recommendation for DOM Level 2: Document Object Model (DOM) Level 2 Specification, Version 1.0. Reference: W3C Candidate Recommendation 10-December-1999. A W3C 'Candidate Recommendation' is a new category in the W3C specification track; a CR represents a "work that has received significant review from its immediate technical community. It is an explicit call to those outside of the related Working Groups or the W3C itself for implementation and technical feedback." After this CR phase ends (January 19, 2000), "the specification will move into the Proposed Recommendation phase and it will be sent to the W3C membership for review." Abstract: "This specification defines the Document Object Model Level 2, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model Level 2 builds on the Document Object Model Level 1. The DOM Level 2 is made of a set of core interfaces to create and manipulate the structure and contents of a document and a set of optional modules. These modules contain specialized interfaces dedicated to XML, HTML, an abstract view, generic stylesheets, Cascading Style Sheets, Events, traversing the document structure, and a Range object." [Introduction:] The Document Object Model (DOM) is an application programming interface (API) for HTML and XML documents. It defines the logical structure of documents and the way a document is accessed and manipulated. In the DOM specification, the term 'document' is used in the broad sense - increasingly, XML is being used as a way of representing many different kinds of information that may be stored in diverse systems, and much of this would traditionally be seen as data rather than as documents. Nevertheless, XML presents this data as documents, and the DOM may be used to manage this data. With the Document Object Model, programmers can build documents, navigate their structure, and add, modify, or delete elements and content. Anything found in an HTML or XML document can be accessed, changed, deleted, or added using the Document Object Model, with a few exceptions - in particular, the DOM interfaces for the XML internal and external subsets have not yet been specified. As a W3C specification, one important objective for the Document Object Model is to provide a standard programming interface that can be used in a wide variety of environments and applications. The DOM is designed to be used with any programming language. In order to provide a precise, language-independent specification of the DOM interfaces, we have chosen to define the specifications in OMG IDL, as defined in the CORBA 2.2 specification. In addition to the OMG IDL specification, we provide language bindings for Java and ECMAScript (an industry-standard scripting language based on JavaScript and JScript)." The new CR is available in Postscript, PDF, plain text, and ZIP archive formats. Lauren Wood (DOM WG Chair) wrote in a note to XML-DEV: "The only changes that will be made [to the specification] from now on are if something is seriously broken and it's very difficult or impossible to implement. (Apart from clarifications, of course!). So if the specification isn't clear enough to implement from, or implementations are nearly impossible, please send email. Also, if you do implement some part of Level 2, I'd like to hear about it, so we can be sure that the spec has been implemented often enough that we probably have the bugs out of it. If you want your email to be confidential, just send it to me (lauren@softquad.com), marking it as confidential, otherwise please send email to the public DOM mailing list."

  • [December 10, 1999] A new Candidate Recommendation for DOM Level 2: Document Object Model (DOM) Level 2 Specification, Version 1.0. Reference: W3C Candidate Recommendation 10-December-1999. Edited by Lauren Wood.

  • [July 20, 1999] W3C Releases Document Object Model (DOM) Level 2 Specification. As part of the W3C DOM Activity, a new DOM Level 2 working draft has been published by the DOM Working Group: Document Object Model (DOM) Level 2 Specification Version 1.0. References: W3C Working Draft 19-July-1999, WD-DOM-Level-2-19990719. The specification as a whole is edited by Lauren Wood (Softquad Software Inc.); different modules of the Document Object Model specification have different editors. The document is available in HTML, PostScript, PDF, and plain text formats. Abstract: "This specification defines the Document Object Model Level 2, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model Level 2 builds on the Document Object Model Level 1. This release of the Document Object Model Level 2 has all of the interfaces that the final version is expected to have. It contains interfaces for creating a document, importing a node from one document to another, supporting XML namespaces, associating stylesheets with a document, the Cascading Style Sheets object model, the Range object model, filters and iterators, and the Events object model. The DOM WG wants to get feedback on these, and especially on the two options presented for XML namespaces, so that final decisions can be made for the DOM Level 2 specification." Public comments on the new WD specification may be sent to the editors via the public mailing list at www-dom@w3.org.

  • [March 09, 1999] An early release of the W3C Document Object Model Level 2 is now available in a Working Draft document, Document Object Model (DOM) Level 2 Specification Version 1.0. References: WD-DOM-Level-2-19990304, W3C Working Draft 04 March, 1999. This Working Draft has been been published by the DOM Working Group chaired by Lauren Wood (SoftQuad Software Inc.) as part of the W3C DOM Activity. The document is available in Postscript, PDF, XML, HTML, and plain text formats. The new specification "defines the Document Object Model Level 2, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model Level 2 builds on the Document Object Model Level 1. Level 2 is expected to add interfaces for a Cascading Style Sheets object model, an event model, and a query interface, amongst others. This release of the Document Object Model Level 2 does not have all of the interfaces that the final version will have. It contains interfaces for associating stylesheets with a document, the Cascading Style Sheets object model, the Range object model, filters and iterators, and the Events object model. The DOM WG wants to get feedback on the interfaces that are in this version of the DOM Level 2 specification. The other interfaces will be added in future versions of this specification."

  • [January 05, 1999] In early January 1999, the W3C Document Object Model (DOM) Working Group released a new Working Draft specification for The Document Object Model Level 2, Version 1.0 (WD-DOM-Level-2-19981228). The document is available in Postscript, PDF, plain text, HTML, and XML formats. The DOM level 1 (viz., Document Object Model (DOM) Level 1 Specification Version 1.0, REC-DOM-Level-1-19981001) was published on October 1, 1998. The new Level 2 W3C DOM Working Draft, issued as part of the W3C DOM Activity, defines "a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model Level 2 builds on the Document Object Model Level 1. Level 2 adds interfaces for a Cascading Style Sheets object model, an event model, and a query interface, amongst others. This first release of the Document Object Model Level 2 does not have all these interfaces. It contains interfaces for the Cascading Style Sheets object model, the Range object model, filters and iterators, and the Events object model. The other interfaces will be added in future versions of this specification. . . The DOM Level 2 Cascading Style Sheets (CSS) interfaces are designed with the goal of exposing CSS constructs to object model consumers. Cascading Style Sheets is a declarative syntax for defining presentation rules, properties and ancillary constructs used to format and render Web documents. This document specifies a mechanism to programmatically access and modify the rich style and presentation control provided by CSS (specifically CSS level two ). This augments CSS by providing a mechanism to dynamically control the inclusion and exclusion of individual style sheets, as well as manipulate CSS rules and properties. " The chair of the DOM Working Group is Lauren Wood, of SoftQuad Software Inc. Parts of the current draft have also been edited by Vidur Apparao, Mike Champion, Arnaud Le Hors, Tom Pixley, Jonathan Robie, Peter Sharpe, and Chris Wilson.

  • The Document Object Model Level 2, Version 1. WD-DOM-Level-2-19981228, W3C Working Draft 28 December, 1998. The chair of the DOM Working Group is Lauren Wood, of SoftQuad Software Inc. [local archive copy]

DOM Level 1 Specifications

  • [October 02, 2000] A communiqué from Philippe Le Hégaret (World Wide Web Consortium, DOM Activity Lead) announces the release of DOM Level 1 Second Edition from the W3C DOM Activity: Document Object Model (DOM) Level 1 Specification (Second Edition) Version 1.0. Reference: W3C Working Draft 29-September-2000, edited by Lauren Wood, Arnaud Le Hors, Vidur Apparao, Steve Byrne, Mike Champion, Scott Isaacs, Ian Jacobs, Gavin Nicol, Jonathan Robie, Robert Sutor, and Chris Wilson. Note that Document status: "This second edition is not a new version of the DOM Level 1; it merely incorporates the changes dictated by the first-edition errata list. [It] is a version of the DOM Level 1 Recommendation incorporating the errata changes as of September 29, 2000. It is released by the DOM Working Group as a W3C Working Draft to gather public feedback before its final release as the DOM Level 1 second edition W3C Recommendation (as these changes are editorials, there will be no Candidate Recommendation or Proposed Recommendation stages). The review period for this Working Draft is 4 weeks ending October 27 2000." Abstract: "This specification defines the Document Object Model Level 1, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model provides a standard set of objects for representing HTML and XML documents, a standard model of how these objects can be combined, and a standard interface for accessing and manipulating them. Vendors can support the DOM as an interface to their proprietary data structures and APIs, and content authors can write to the standard DOM interfaces rather than product-specific APIs, thus increasing interoperability on the Web."

  • [October 01, 1998.] In October 1998, the World Wide Web Consortium published the Document Object Model (DOM) Level 1 Specification, Version 1.0 as a W3C Recommendation. Reference: REC-DOM-Level-1-19981001. Lauren Wood (SoftQuad, Inc.) is the W3C DOM WG Chair. Editors include: Vidur Apparao, Steve Byrne, Mike Champion, Scott Isaacs, Ian Jacobs, Arnaud Le Hors, Gavin Nicol, Jonathan Robie, Robert Sutor, Chris Wilson, and Lauren Wood. The document is available online in HTML, Postscript, PDF, and plain text formats. See also the list of changes.

  • W3C DOM Recommendation Abstract: "This specification defines the Document Object Model Level 1, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model provides a standard set of objects for representing HTML and XML documents, a standard model of how these objects can be combined, and a standard interface for accessing and manipulating them. Vendors can support the DOM as an interface to their proprietary data structures and APIs, and content authors can write to the standard DOM interfaces rather than product-specific APIs, thus increasing interoperability on the Web. The goal of the DOM specification is to define a programmatic interface for XML and HTML. The DOM Level 1 specification is separated into two parts: Core and HTML. The Core DOM Level 1 section provides a low-level set of fundamental interfaces that can represent any structured document, as well as defining extended interfaces for representing an XML document. These extended XML interfaces need not be implemented by a DOM implementation that only provides access to HTML documents; all of the fundamental interfaces in the Core section must be implemented. A compliant DOM implementation that implements the extended XML interfaces is required to also implement the fundamental Core interfaces, but not the HTML interfaces. The HTML Level 1 section provides additional, higher-level interfaces that are used with the fundamental interfaces defined in the Core Level 1 section to provide a more convenient view of an HTML document. A compliant implementation of the HTML DOM implements all of the fundamental Core interfaces as well as the HTML interfaces."

  • [August 19, 1998] On August 18, 1998, the World Wide Web Consortium published the Document Object Model (DOM) Level 1 Specification, Version 1.0 as a W3C Proposed Recommendation. References: PR-DOM-Level-1-19980818, W3C Proposed Recommendation 18 August, 1998. The chair of the DOM Working Group is Lauren Wood (SoftQuad, Inc.). Other editors for this PR include Vidur Apparao, Steve Byrne, Mike Champion, Scott Isaacs, Gavin Nicol, Jonathan Robie, Robert Sutor, and Chris Wilson. The DOM specification "defines the Document Object Model Level 1, a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents. The Document Object Model provides a standard set of objects for representing HTML and XML documents, a standard model of how these objects can be combined, and a standard interface for accessing and manipulating them. Vendors can support the DOM as an interface to their proprietary data structures and APIs, and content authors can write to the standard DOM interfaces rather than product-specific APIs, thus increasing interoperability on the Web."

  • [July 20, 1998] Lauren Wood (SoftQuad, Inc., W3C DOM Working Group Chair) has announced the new release of a Level 1 DOM specification: Level 1 Document Object Model Specification Version 1.0, WD-DOM-19980720, W3C Working Draft 20 July, 1998. Lauren's comments: "There have been significant changes since the last public draft. Amongst others: 1) There is no separate XML document; all the XML interfaces are in the Core document; 2) We took the DTD stuff out, pending work on schemas in a future version of XML (what we had will shortly be released as a separate WD); 3) We took out NodeIterator; 4) The Java and OMG IDL bindings now validate. [So:] The DOM WG thinks the DOM specification is nearly finished and almost ready to go to PR. The remaining issues are mostly listed in the spec, so feedback on these (to this mailing list) would be welcome."

  • Document Object Model (DOM) Level 1 Specification, Version 1.0 as a W3C Recommendation. See also the press release and testimonials from ArborText, IBM, iMall, Inso, Microsoft, NCI, Netscape, The Object Management Group, and Paradigm. Also the list of changes,

  • Document Object Model (DOM) Level 1 Specification Version 1.0 - W3C Proposed Recommendation 18 August, 1998, PR-DOM-Level-1-19980818. Available in HTML, Postscript and 'text' formats. Local archive copies: text, Postscript, XML sources, complete package.

  • Level 1 Document Object Model Specification Version 1.0, WD-DOM-19980720, W3C Working Draft 20 July, 1998.

  • Document Object Model Specification Version 1.0 WD-DOM-19980416, W3C Working Draft 16 April, 1998.

  • Document Object Model Specification W3C Working Draft, 18 March, 1998, WD-DOM-19980318.

  • Document Object Model (XML) Level 1 W3C Working Draft 9-October-1997.

  • Press Release [October 09, 1997]. "Industry Leaders Collaborate to Develop Core Functionality for Document Navigation and Content Manipulation."

DOM Conformance

  • DOM Conformance Test Suites Process Document [W3C]

  • W3C DOM test suite mailing list and W3C DOM test suite mailing list archives

  • [March 28, 2001]   W3C and NIST Coordinate to Develop the DOM Conformance Test Suites.    A posting from Philippe Le Hégaret (W3C DOM Activity Lead) announces the intention of the W3C DOM Working Group and NIST to jointly develop the DOM Conformance Test Suites. He writes: "This development will be entirely public. It will produce a DOM Level 1 Test Suite (based on the NIST DOM Test Suite) and a DOM Level 2 Test Suite. The DOM Level 3 Test Suite will be addressed after the publication of the DOM Level 3 Candidate Recommendation. Dimitris Dimitriadis will be the contact for the W3C DOM Working Group, and Mary Brady will be the contact for NIST. Both will participate in the Workshop on Quality Assurance at W3C. We welcome the participation of interested parties in developing the DOM Conformance Test Suites." A public DOM TS mailing list for the development of the test suite was created on February 23, 2001, and is open for subscription; its archives are also public. Note that a document DOM Conformance Test Suites Process Document edited by Dimitris Dimitriadis is available from W3C. [Full context]

  • [May 17, 2001] DOM Test Suite Markup Language 0.9 By Dimitris Dimitriadis, DOM WG TS representative. "The DTD used by NIST in their test suite has been published on the 'www-dom-ts@w3.org' mailing list as the DOM TSML 0.9 after slight alteration and editing. Please note that it is still under developement and we look forward to receiving your comments on it." [cache DTD]

  • [April 02, 2001]   Two New Test Suites for XML Document Object Model (DOM) Level 1.    OASIS and NIST have announced the addition of "two new test suites for the XML Document Object Model (DOM) Level 1 to the growing collection of OASIS Conformance Tests for XML Technologies. DOM Level 1 provides a standard set of objects for representing HTML and XML documents, a standard model of how these objects can be combined and a standard interface for accessing and manipulating them. The two DOM Level 1 Conformance Test Suites were developed by NIST and submitted to OASIS for the benefit of the entire XML community. They include both ECMAScript and Java tests. The ECMAScript DOM Test Suite is interactive, providing instant pass/fail results. Developers may view the source code of the test, link to the test purposes (semantic requirements) and link to the appropriate section in the W3C DOM Recommendation. The suite includes more than 800 ECMAScript tests, covering all fundamental, extended and HTML interfaces. The Java DOM Test Suite also contains more than 200 tests, covering all fundamental and extended interfaces. The tests are organized into a set of classes, one for each interface. The suite includes a test driver that accepts implementations, interfaces and output files." NIST (National Institute of Standards and Technology) is also collaborating with W3C in the development of DOM Conformance Test Suites. [Full context]

  • NIST DOM Test Suites. "NIST has developed tests for both the ECMAScript and Java bindings of the DOM Level 1 Recommendation. We are currently working on updating these tests to Level 2 status. The updated version will be submitted to the DOM WG for inclusion in their test suite effort. There is a set of 800 ECMAScript DOM Level 1 tests covering fundamental, extended and HTML interfaces; also an example test harness (IE5)." [cache]

  • The SourceForge XMLConf Project has a DOM area: "XMLConf hosts XML related testing efforts, focusing initially on conformance testing. Notice that all of this software is under the GPL. The first testing effort hosted here addresses XML conformance. It includes test harnesses for Java (with SAX/SAX2) and for JavaScript (with DOM/COM). The second such effort is currently in its early stages, and addresses XML Schema conformance. Other projects discussed include DOM testing, performance measurement, XSLT conformance... W3C DOM consists of a core, providing a basic tree data structure with traversal and mutation operations, and requires at least one of the basic XML or HTML feature sets. 'DOM Level 2' has recently been promoted to Recommendation, adding quite a few optional features. Many of these support '"Dynamic HTML' style browser interactions, and some are useful for working with XML data structures. DOM is specified in OMG-IDL, and is then mapped to either Java or JavaScript (not C or C++). DOM uses nonstandard language mappings which, unlike OMG language mappings, do not provide a language-standard bootstrapping facility. Instead, platform-specific solutions have been provided, and must be used when testing. All this means that DOM testing is no simple thing..." See [2001-03] the "Hacked Document Object Model Conformance Tests": "supports testing of MSXML3, Adobe's SVG viewer and Xerces-COM. The tests have been modified so that unexpected exceptions invoke the debugger and to adapt for different treatment of the XML declaration [MSXML treats the XML declaration as a processing instruction, Apache does not]. This hacked test should give identical results to the official test for MSXML..."

  • "XML Conformance" - Main reference page.

Articles on DOM

  • [August 19, 2003] "Discover Key Features of DOM Level 3 Core, Part 1. Manipulating and Comparing Nodes, Handling Text and User Data." By Arnaud Le Hors and Elena Litani (IBM). From IBM developerWorks, XML zone. August 19, 2003. ['In this two-part article, the authors present some of the key features brought by the W3C Document Object Model (DOM) Level 3 Core Working Draft and show you how to use them with examples in Java code. This first part covers manipulating nodes and text, and attaching user data onto nodes.'] "The Document Object Model (DOM) is one of the most widely available APIs. It provides a structural representation of an XML document, enabling users to access and modify its contents. The DOM Level 3 Core specification, which is now in Last Call status, is the latest in a series of DOM specifications produced by the W3C. It provides a set of enhancements that make several common operations much simpler to perform, and make possible certain things you simply could not do before. It also supports the latest version of different standards, such as Namespaces in XML, XML Information Set, and XML Schema, and thus provides a more complete view of the XML data in memory. The first part of this article covers operations on nodes; the second part focuses on operations on documents and type information, and explains how to use DOM in Xerces. We show you how DOM Level 3 Core can make your life easier when working with nodes, whether it is renaming a node, moving nodes from one document to another, or comparing them. We also show you how DOM Level 3 Core lets you access and modify the text content of your document in a more natural way than having to deal with Text nodes that tend to get in the way. Finally, we explain to you how you can use the DOM Level 3 Core to more easily maintain your own structure that is associated with the DOM... DOM Level 3 can do a lot of work for you. First, it allows you to store a reference to your application object on a Node. The object is associated with a key that you can use to retrieve that object later. You can have as many objects on a Node as you want; all you need to do is use different keys. Second, you can register a handler that is called when anything that could affect your own structure occurs. These are events such as a node being cloned, imported to another document, deleted, or renamed. With this, you can now much more easily manage the data you associate with your DOM. You no longer have to worry about maintaining the two in parallel. You simply need to implement the appropriate handler and let it be called whenever you modify your DOM tree. And you can do this with the flexibility of using a global handler or a different one on each node as you see fit. In any case, when something happens to a node on which you have attached some data, the handler you registered is called and provides you with all the information you need to update your own structure accordingly... In Part 2 [of the series], we will show you other interesting features of DOM Level 3 Core, such as how to bootstrap and get your hands on a DOMImplementation object without having any implementation-dependent code in your application, how the DOM maps to the XML Infoset, how to revalidate your document in memory, and how to use DOM Level 3 Core in Xerces..." Article also in PDF format.

  • [July 15, 2003] "Serialize XML Data. Saving XML Data Using DOMWriter in XML for the C++ Parser." By Tinny Ng (System House Business Scenarios Designer, IBM Toronto Laboratory). From IBM developerWorks, XML zone. July 15, 2003. ['IBM developer Tinny Ng shows you how to serialize XML data to a DOMString with different encodings. You'll also find examples that demonstrate how to use the MemBufFormatTarget, StdOutFormatTarget, and LocalFileFormatTarget output streams in XML4C/Xerces-C++.'] "Xerces-C++ is an XML parser written in C++ and distributed by the open source Apache XML project. Since early last year, Xerces-C++ has added an experimental implementation of a subset of the W3C Document Object Model (DOM) Level 3 as specified in the DOM Level 3 Core Specification and the DOM Level 3 Load and Save Specification. The DOM Level 3 Load and Save Specification defines a set of interfaces that allow users to load and save XML content from different input sources to different output streams. This article uses examples to show you how to save XML data in this way -- how to serialize XML data into different types of output streams with different encodings. Users can stream the output data into a string, an internal buffer, the standard output, or a file... For more details please refer to the W3C DOM Level 3 Load and Save Specification and the complete API documentation in Xerces-C++..." See: "Document Object Model (DOM) Level 3 Core Specification Version 1.0" (W3C Working Draft 09-June-2003) and "Document Object Model (DOM) Level 3 Load and Save Specification Version 1.0" (W3C Working Draft 19-June-2003). The LS specification "defines the Document Object Model Load and Save Level 3, a platform- and language-neutral interface that allows programs and scripts to dynamically load the content of an XML document into a DOM document and serialize a DOM document into an XML document..."

  • [January 10, 2003] "W3C Releases Scripting Standard, Caveat." By Paul Festa. In CNET News.com (January 10, 2003). "The Web's leading standards body released a long-delayed recommendation for using scripts in Web pages but urged coders not to rely too heavily on scripting. The World Wide Web Consortium (W3C) recommended on Thursday its Document Object Model (DOM) Level 2 HTML, a module of the group's set of application programming interfaces (APIs) for letting computer languages like JavaScript, Java or ECMAScript manipulate elements in an HTML or XHTML document. In practical terms, the DOM makes it easier to create Web pages with features that are more animated and functional. With scripts, authors can make Web pages process forms, launch pop-up menus and windows, and execute style changes on the fly. Without the DOM, authors would have to code separately for each scripting language to interact with each different browser. The DOM is meant to create a 'write once, run everywhere' standard for Web page scripting. However, W3C staff urged developers to use scripts sparingly, criticizing the development technique as less efficient and accessible than alternative W3C-recommended methods of creating dynamic Web pages. 'The W3C is working on other specifications, including SVG, SMIL, and XForms, to move some commonly desired behaviors out of scripts,' said Ian Jacobs, a W3C editor. 'Scripting has its limitations'... The W3C 'strongly suggests that developers and authors conform to DOM Level 2 HTML,' the consortium wrote in its release. The group, in concert with the United States National Institute of Standards and Technology (NIST), also updated its free test suite that developers can use to check their adherence to the standard." See "Document Object Model (DOM) Level 2 HTML Specification Version 1.0 [W3C Recommendation 09-January-2003]

  • [December 13, 2001] "Effective XML processing with DOM and XPath in Java. Analysis of many projects yields advice and suggested code." By Parand Tony Darugar (Chief Software Architect, VelociGen Inc.). From IBM developerWorks XML Zone. December 2001. ['Based on an analysis of several large XML projects, this article examines how to make effective and efficient use of DOM in Java. The DOM offers a flexible and powerful means for creating, processing, and manipulating XML documents, but it can be awkward to use and can lead to brittle and buggy code. Author Parand Tony Daruger provides a set of Java usage patterns and a library of functions to make DOM robust and easy to use.'] "The Document Object Model (DOM), is a recognized W3C standard for platform- and language-neutral dynamic access and update of the content, structure, and style of XML documents. It defines a standard set of interfaces for representing documents, as well as a standard set of methods for accessing and manipulating them. The DOM enjoys significant support and popularity, and it is implemented in a wide variety of languages, including Java, Perl, C, C++, VB, Tcl, and Python. As I'll demonstrate in this article, DOM is an excellent choice for XML handling when stream-based models (such as SAX) are not sufficient. Unfortunately, several aspects of the specification, such as its language-neutral interface and its use of the "everything-is-a-node" abstraction, make it difficult to use and prone to generating brittle code. This was particularly evident in a recent review of several large DOM projects that were created by a variety of developers over the past year. The common problems, and their remedies, are discussed below... The language-neutral design of the DOM has given it very wide applicability and brought about implementations on a large number of systems and platforms. This has come at the expense of making DOM more difficult and less intuitive than APIs designed specifically for each language. DOM forms a very effective base on which easy-to-use systems can be built by following a few simple principles. Future versions of DOM are being designed with the combined wisdom and experience of a large group of users, and will likely present solutions to some of the problems discussed here. Projects such as JDOM are adapting the API for a more natural Java feel, and techniques such as those described in this article can help make XML manipulation easier, less verbose, and less prone to bugs. Leveraging these projects and following these usage patterns allows DOM to be an excellent platform for XML-based projects." Article also in PDF format.

  • [September 10, 2001] "Let Your DOM Do The Walking. A Look at the DOM Traversal Module." By Brett McLaughlin (Enhydra strategist, Lutris Technologies). From IBM developerWorks. August 2001. "The Document Object Model (DOM) offers useful modules to extend its core functionality in advanced ways. This article examines the DOM Traversal module in depth, showing how to find out if this module is supported in your parser and how to use it to walk either sets of selected nodes or the entire DOM tree. You'll come away from this article with a thorough understanding of DOM Traversal, and a powerful new tool in your Java and XML programming kit. Eight sample code listings demonstrate the techniques. If you have done much XML processing during the last three years, you've almost certainly come across the Document Object Model, or DOM for short. This object model represents an XML document in your application, and it provides a simple way to read XML data and to write and change data within an existing document (see Resources for more background if you're new to the DOM). If you're on your way to being an XML guru, you've probably learned the DOM backward and forward, and you know how to use almost every method that it offers. However, there is a lot more to the DOM than most developers realize. Most developers actually have experience with the core of the DOM. That means the specification that outlines what represents the DOM, how it should operate, what methods it makes available, and so forth. Even experienced developers do not have much knowledge or understanding of the variety of extra DOM modules that are available. These modules allow developers to work more efficiently with trees, deal with ranges of nodes at the same time, operate upon HTML or CSS pages, and more all with an ease not possible using just the core DOM specification. Over the next few months, I plan articles to detail several of the modules, including the HTML module -- the Range module -- and in this article, the Traversal module. Moving through DOM trees in a filtered way makes it easy to look for elements, attributes, text, and other DOM structures. You should also be able to write more efficient, better organized code using the DOM Traversal module. Learning to use DOM Traversal, you'll see how quickly it can move throughout a DOM tree, build custom object filters to easily find the data you want, and walk a DOM tree more easily than ever. I'll also introduce you to a utility that lets you check your parser of choice for specific DOM module support, and along the way I'll manage to throw a lot of other sample code in as well..."

  • [August 24, 2001] "Just Over the Horizon ... a new DOM. A preview of DOM Level 3." By Brett McLaughlin (Enhydra strategist, Lutris Technologies). From IBM developerWorks. August 2001. ['This article previews the W3C's XML Document Object Model Level 3, due to be released toward the end of 2001 or early in 2002. Java developer and author Brett McLaughlin gives an overview of key features in the forthcoming version of the DOM, which will offer better access to pieces of information in an XML document, better comparisons, and a much-needed bootstrapping process. Six short code samples demonstrate some new methods.'] "The Document Object Model (DOM) is arguably the most popular API for manipulating XML in use today. It presents an XML document in an object-based form, making it simple to manipulate for Java programmers and other developers who are already familiar with objects. Additionally, it works across languages, providing access to XML in JavaScript/ECMAScript, C, and other languages. While this article's code samples are all in Java, the changes detailed will be available in all language bindings (the mapping of the specification to a specific programming language) of the DOM Level 3 specification. The current version of the DOM specification, DOM Level 2, is in widespread use in production applications all over the world. However, there are some recognized problems with this version of the specification: most notably, the inability to bootstrap a DOM implementation. Bootstrapping provides a way to load a DOM implementation without vendor-specific code, which is critical in allowing an application to run with various parsers. In addition, node comparisons are fairly limited in the current DOM specification, and some items in an XML document are not available, most notably the XML declaration (<xml version="1.0" standalone="yes">, for example). Happily, DOM Level 3, as currently described in draft form, rectifies all of these problems. In this article, I'll show you how, and I'll give you a sneak preview of what to look for in this new and improved version of the specification..." See the W3C DOM web site.

  • [January 23, 2001] "Level 1 DOM Compatibility Table. Methods and Properties." By Peter-Paul Koch. Includes notes on IE5 Win and Mac, Netscape 6, Opera 5 and Konqueror. "These methods and properties only work in browsers that support the W3C Level 1 DOM. This page is based on Explorer 5 and Netscape 6, but many other browsers support bits of the Level 1 DOM. See the browsers page for details... This page notes the new methods and properties that Version 5 browsers should support and the (in)compatibilities of Netscape 6 and Explorer 5, who (surprise!) don't support everything as well as theory says they should. I wrote an introduction to the Level 1 DOM so that you understand what a node is and why you need them. On this page, first a large table of methods and properties and then four cases of trying to make generated events work (none cross-browser)..." See also the description of the W3C DOM mailing list (wdf-dom): "This list studies the JavaScript implementation of the W3C DOM in the various browser..."

  • [January 23, 2001] "Netscape 6, Part IV: DOM Differences and Commonalities with IE5.x." By Yehuda Shiran. From WebReference.com. January 2001. ['Netscape 6 and IE5.x are both based on the W3C's Document Object Model (DOM) but there are some differences. Learn how to find common ground to quilt DOM-based cross-browser scripts.'] "This column is the fourth part of our series on Netscape 6. In this column we'll start looking at the differences between Netscape 6's Document Object Model (DOM) and Internet Explorer 5.x's DOM. The DOM gives scripters a standardized way to access various elements of an HTML page, and should greatly simplify writing cross-browser scripts in the long run. Both browsers support a basic set of the W3C's methods and attributes, as well as the innerHTML property (not included in the W3C DOM, but included by popular demand). The differences are found in the second tier of functionality. A good example is the difference in modeling of the root nodes of the DOM tree, document and documentElement objects. Netscape 6 also models the ownership relationship in a document, while Internet Explorer 5.x does not. Another advantage of Netscape 6's DOM is its ability to model fragment nodes, which Internet Explorer does not support. In this column, you will learn: (1) How to distinguish between the two root nodes (2) How to use the lower root node, browser-independently (3) How to use the ownership relationship (4) How to reference objects in Netscape 6 (5) How to create and remove attributes on the fly (6) How to create document fragments (7) How to use the innerHTML property, browser-independently..."

  • [September 16, 1998] "The W3C Document Object Model (DOM) - A Programmer's View of Documents." By Tim Bray and Lauren Wood. In The Gilbane Report on Open Information & Document Systems Volume 6, Number 4 (July/August 1998), pages 1-13. ISSN: 1067-8719. Executive Summary: "Documents are many things to many people. Computer programmers are a group whose point of view is becoming increasingly important. This is driven in particular by the advent of XML, which at one level is designed for the programmer. There is a long history of programming interfaces to documents. The most visible in recent times has been 'Dynamic HTML - which has unfortunately proved less than usable in practice. It would appear that the soon-to-arrive Document Object Model specification from the World Wide Web consortium will fix Dynamic HTML's problems and, for the first time, provide a widely-supported programmer's-eye view into a document."

    "The goal of the W3C Document Object Model (DOM) is to provide a standard API for XML and HTML content, making it accessible to programmers of all stripes (from VBScript and JavaScript to C++ and Java). The DOM will finally allow for delivery on the promise of DHTML. It will provide the cross-browser predictability programmers need to build really useful applications. The reduced development costs achieved through a single API that can be used with all the major scripting and programming language will encourage business managers to make the investment in more ambitious Web content applications. The DOM may sound intimidating to non-programmers, but it is important to grasp its potential even as the work to complete it continues.

  • [November 06, 1998] "Programming Marked-Up Documents." By Lauren Wood. In Markup Languages: Theory & Practice Volume 1, Number 1 (Winter 1999) 91-100. Abstract: "The Document Object Model is a programming interface to HTML and XML documents. The level 1 DOM specification enables application writers to access, navigate, and manipulate the content and structure of HTML and XML documents. The paper describes the motivation behind the work on the DOM, as well as the rationale behind some of the design decisions. A precis of future work is given." See the Table of Contents for the inaugural issue of Markup Languages: Theory and Practice.

  • [July 29, 1999] "Visualizing DOM Level 1 - A handy one-page reference for programmers." By Vance Christiaanse. From XML.com. July 28, 1999. [Download this diagram of the DOM Level 1 interfaces.] "I created a class diagram that shows the interfaces defined in the DOM Level 1 specification along with their attributes and methods. It's convenient for getting an overview of the DOM and for looking up the exact method name you need while programming. I've found it useful keeping separate what is required by the spec and the additional functionality provided by XML::DOM Perl module." Options: Large diagram or Small diagram. Note that a Document Object Model (DOM) Level 2 Specification has also been issued recently (July 19, 1999) by the W3C DOM Working Group.

  • [November 06, 1998] "The DOM for Non-Programmers." By Elaine Brennan. In <TAG> Volume 11, Number 10 (October 1998), pages 1-4. The W3C DOM specification is "not a document designed for easy readability by non-programmers, so this article is one non-programmer's take on the contents - and implications - of the DOM in the XML universe."

  • [July 01, 1998] "The Document Object Model." By Bob DuCharme. In <TAG> The SGML Newsletter 11/6 (June 1998) pages 7-8. Setting the stage for introducing the W3C's 'Document Object Model' activity: "SGML has always had a lot in common with the object-oriented approach to modeling data: a) both address the problem of representing data that won't fit neatly into tables of fixed-width fields that make up a relationsl database; b) both define object classes (or in SGML's case, element types) by specifying what kinds of data and what members of other defined object classes make up the members of each newly-defined class; c) both let you define attributes as categories of information that you can assign to each object . . ."

  • "Q&A: Lauren Wood, Chair, W3C DOM. W3C Spec Adds Structure to Web." [Interview with Lauren Wood,] by Nate Zelnick. WebWeek, Internet.Com November 10, 1997. [local archive copy]

  • [October 02, 2000] "Total DOMination." By Michael Floyd. In WebTechniques (October, 2000). [XML@Large.] ['Walking the DOM was never this easy. Michael Floyd takes a look at the Microsoft MSXML parser.'] "Without question, the DOM is well documented in the W3C specification, in the documentation of various parser tools, and in the growing collection of XML books on the market. To that effect, the DOM is probably the best-documented component of XML (outside of XML itself), largely because the specification is stable and it's been available for roughly two years. For all of the information about the DOM and its workings, however, there still seems to be little solid information on how you can use various components of XML. This month, I'd like to take a look at the DOM and show how you can perform actual tasks using it. Of course, the DOM encompasses far more than can be covered in a single article. Instead, I'll provide a brief overview of the DOM, then focus on the Core DOM that's the portion of the API applicable to XML. In particular, it's important to understand the Node, NodeList, and NamedNodeMap interfaces. It's also useful to be able to predict and compensate for the DOM's pitfalls. When an XML parser loads a document, it essentially scans the document, looks for elements, attributes, text, and so on and constructs a hierarchical tree based on those items. When the parser encounters, say, an element in the source document, it creates a new node in the tree containing a representation of that element. (This is somewhat of an oversimplification, but it's sufficient for this discussion.) Then the DOM's purpose is to provide a standard set of programming interfaces for accessing the nodes in this document tree, and for reading, writing, and modifying individual nodes or entire fragments of the tree. It's important to note that at the time of this writing, the DOM Level 1 specification is the current standard. However, DOM Level 2 is near completion and the W3C has already begun work on a Level 3 specification. Because few tools fully implement DOM Level 2, let's focus on DOM Level 1. In DOM Level 1, the API can be organized into four objects: Document, Node, Nodelist, and NamedNodeMap..."

  • W3C Document Object Model (DOM) - Suggested enhancements for the Document Object Model (DOM) - ÁNOQ of the Sun [Johnny Andersen].

  • [July 28, 1998] "DOM's Potential Shines." By Richard Karpinski. In InternetWeek (July 27, 1998), pages 1, 49. "As the World Wide Web Consortium (W3C) prepares to release the DOM next month as a proposed standard, a new light is being shone on its ability to complement not just HTML but also the Extensible Markup Language.

  • [March 18, 1998] "Dynamic Navigation with DOM. Taking Advantage of the Document Object Model." By Mark McManus . In Web Techniques Magazine Volume 3, Issue 3 (March 1998).

  • [October 30, 1998] "W3C Completes DOM Specification. Document Object Model Soothes Cross-browser Headaches." By Liora Alschuler. From XML.com (October 21, 1998). [Also, e Seybold Report on Internet Publishing Vol. 3, No. 3.]


Other References

  • [October 18, 2000] DOM1 Reference. By Jiri Znamenacek [Jiri.Znamenacek@idoox.com]. "Main features: (1) Names of interfaces, methods and attributes are clickable and colour-differentiated so navigation is very intuitive and easy. (2) Click on 'Go to standard' leads to the relevant part of the specification. (3) For every HTML-concerning interface graphic examples are provided...Examples provided with the reference also contain javascript calls to the relevant functions of DOM1 in your browser and its comparison with expected output. A very nice compatibility checker. "

  • [September 16, 1999] Re: "Is anyone working on a C/C++ DOM implementation using expat?" If anyone is working on a C DOM implementation using expat, there is a C interface definition for DOM (.h) available at http://www.ascc.net/~ricko/src/dom_interface.h which they might find convenient to use (contributions and suggestions welcome). Rick Jelliffe, Thu, 16 Sep 1999.

  • NIST XML/DOM Conformance Testing. Organized through NIST's Software Diagnostics and Conformance Testing Division [SDTC], under Mary Brady. "In order to enable the next level of web applications, we need a flexible method of defining, interacting with, and exchanging data for a variety of domain-specific applications. The Extensible Markup Language (XML) provides a standards-based approach to universal methods for defining and exchanging data. Using XML, one can create customized markup languages for exchanging information within their own domain. In addition, the Document Object Model (DOM) defines ECMAScript and Java bindings for interacting with both XML and HTML data, permitting dynamic creation and manipulation of web pages defined using these metalanguages. Virtually all application domains are looking to use XML and DOM to manipulate and exchange structured information. In addition, XML processors and support for the DOM API are beginning to appear in beta versions of popular web browsers and associated applications. As such, conformance of these products to the W3C Recommendations will permit robust, interoperable solutions." [local archive copy]

  • [November 16, 1999] A posting from Takuki Kamiya (Fujitsu Ltd.) announces the availability of an XPath interface for XT Version 0.85'. The author says: "I have written an DOM query utility in Java on top of XT. You can use it to retrieve DOM Nodes that matches to a given XPath selector. I share the code with the community for free to see if anyone finds it useful... Free with no warranty. Comments are welcome. Any feedback is invited."


Hosted By
OASIS - Organization for the Advancement of Structured Information Standards

Sponsored By

IBM Corporation
ISIS Papyrus
Microsoft Corporation
Oracle Corporation

Primeton

XML Daily Newslink
Receive daily news updates from Managing Editor, Robin Cover.

 Newsletter Subscription
 Newsletter Archives
Globe Image

Document URI: http://xml.coverpages.org/dom.html  —  Legal stuff
Robin Cover, Editor: robin@oasis-open.org