The Document Object Model
Promoting
Interoperability for Dynamic Web Pages and XML Applications
October 1st: W3C released the Document Object Model Level 1 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).
|
The Document Object Model (DOM) 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 DOM is an application programming interface (API)
for
HTML and
XML documents.
The goal of the DOM specification is to define a programmatic interface
for XML and HTML.
It defines the logical structure of documents and the way a document is accessed and manipulated.
This specification defines the foundation of a platform- and language-neutral
interface to access and update dynamically a document's content, structure,
and style.
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.
The DOM provides
- a standard set of objects for representing
HTML and XML documents and data,
- a standard model of how these objects may 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 DOM is a platform- and language-neutral API
that allows authors to write programs and scripts to dynamically access and update
the content, structure and style of documents,
without changes across tools and browsers from different vendors.
Using the scripting language of their choice,
authors can access and manipulate all elements of a web page,
including tags, attributes, images, objects, and text
- creating, moving, and modifying these elements when and as needed.
The DOM exposes every HTML element in a web page,
including its attributes and
CSS properties.
HTML 4.0
provides authors
a standard way to embed scripts
in a document,
but doesn't specify how those scripts can manipulate the document's content,
structure, and style. Several vendors already offer powerful mechanisms for
doing so, but these mechanisms don't always work with different software
packages.
See: Understanding the DOM, by Nate Zelnick.
|