View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide

Document Object Model (DOM)

Home   How To   Code Pool   Public Library   Theory   Events
The Document Object Model (DOM) is a standardized set of interfaces for representing XML documents in an object-oriented structure. It can be implemented for any programming language to provide common functionality for handling XML data in programs. The DOM specification is issued by the W3C, see [].

The conceptual key behind the DOM is its recursive-compositional structure. This means: every part of an XML document is genrally called a „node“. No matter whether the „node“ is an XML tag (like ' ... '), pure text, a comment, CDATA-sections or anything else. Even the whole document itself is called a „node“. This way, the XML document can be described recursively by saying „everything is a node, and may have child-nodes“.

The following UML class-diagram shows the basic interfaces an their relationships specified by the DOM:

Uploaded Image: DOMinterfaces.png

(Note: Such an inheritance structure with a common abstract superclass or interface (here Node) which allows all its instances to be composed of instances of the same common superclass again, is named „Composite-Pattern“ in terms of OOP-design patterns. It is also often found in the models of graphical user interfaces, e.g. Java where „everything is a JComponent, and may have child-JComponents“.)

Using a language-specific implementation of the DOM-standard, the contents of XML documents can be parsed, processed, and formatted from program code in that specific language. See XML parsing and formatting for an implementation of the DOM-Level-1 specification for the SuperCollider-language.

See also XML parsing and formatting, Unified Modeling Language (UML).


Links to this Page