Advertisement

Document Object Model

From Academic Kids

Document Object Model (DOM) is a form of representation of structured documents as an object-oriented model. DOM is the official World Wide Web Consortium (W3C) standard for representing structured documents in a platform- and language-neutral manner. The DOM is also the basis for a wide range of application programming interfaces, some of which are standardized by the W3C.

DOM was initially supported by web browsers 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 incompatibilities in the DOM implementation between different browsers, the W3C came up with standard specifications for DOM.

DOM puts no restrictions on the document's underlying data structure. A well-structured document can take the tree form using DOM. Most XML parsers (e.g., Xerces) and 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.

Contents

Levels

The current DOM specification is Level 2, but some of the Level 3 specifications are now W3C Recommendations.

Level 0 
Includes all the vendor-specific DOMs that existed before creation of DOM Level 1, e.g. document.images, document.forms, document.layers, and document.all. Note, this is not a formal specification published by the W3C but rather a reference to what existed before the standardisation process.
Level 1 
Navigation of DOM document and to manipulate content.
Level 2 
XML Namespace support, filtered views and events.
Level 3 
Consists of 6 different specifications: 1) the DOM Level 3 Core; 2) the DOM Level 3 Load and Save; 3) the DOM Level 3 XPath; 4) the DOM Level 3 Views and Formatting; 5) DOM Level 3 Requirements; and 6) the DOM Level 3 Validation, which further enhance the DOM.

Web browser incompatibilities

A different DOM implementation in different browser venders has led to inter-operability problems for web browsers.

As Microsoft's Internet Explorer browser is, as of 2005, the de-facto standard web browser, this poses real problems for the developers of more standards-compliant browsers such as Mozilla. If they adopt the Microsoft extensions to the DOM, they risk losing any credibility in their calls for web-sites to become standards-compliant, and if they do not, they risk alienating their users by losing much or all of the content of web-sites which use the non-standard extensions. Cynics regard this as another case of Microsoft applying embrace, extend and extinguish (EEE) tactics. This could be considered ironic, as both Microsoft and Netscape were guilty of supplying non-standard features in an arms-race for standards control, and Mozilla was born out of a Netscape initiative. Historically speaking, Microsoft's Internet Browser has been more standard compliant than Netscape in every year.

The general consensus appears to be that this will only change if new standards-compliant browsers gain a significant market-share on the Web, thus making the use of non-standard extensions a commercial problem for the authors of non-standards-compliant websites.

Specifications

See also

  • DOM Events
  • SAX - A set of APIs for accessing and manipulating XML documents in a sequential manner.
  • JDOM - A Java-based document object model for XML that integrates with DOM and SAX and uses parsers to build the document.
  • Comparison of layout engines (DOM)

External links

  • Interfaces for ...
    • C++ (http://xml.apache.org/xerces-c/program-dom.html)
    • Java (http://www.w3.org/2003/01/dom2-javadoc/index.html) - W3C Document Object Model Level 2
    • Lisp (http://interaction.in-progress.com/developer/dom/)
    • Pascal (http://www.philo.de/xml/downloads.shtml) (Kylix)
    • Perl (http://search.cpan.org/~tjmather/XML-DOM-1.43/)
    • PHP (http://www.php.net/manual/en/ref.domxml.php)
    • Python (http://www.python.org/doc/current/lib/module-xml.dom.html)
    • Ruby (http://libgdome-ruby.berlios.de/)
    • TCL (http://tclxml.sourceforge.net/tcldom.html)de:Document Object Model

es:Document Object Model fr:Document Object Model ja:Document Object Model nl:Document Object Model pl:Obiektowy model dokumentu zh:文档对象模型

Navigation

Academic Kids Menu

  • Art and Cultures
    • Art (http://www.academickids.com/encyclopedia/index.php/Art)
    • Architecture (http://www.academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (http://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (http://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools