|
DOM Level 2 (working draft)Bog'liq Ceponkus, Hoodbhoy - Applied XML - Toolkit for ProgrammersDOM Level 2 (working draft).
At the time of writing, this specification was a working
draft. Its main purpose is to give a glimpse into what the future holds for the DOM. There
is no implementation of this specification; the disclaimer at the top of the spec states that
the contents are guaranteed to change. Rather than risk having you get mad at us for
covering a nonstandard specification, we won’t be covering this document. Rest
assured, when the new DOM is standardized, we will have a revised version.
DOM Level 1 Core.
This specification defines the methods and properties that can be
used to manipulate XML. This specification outlines the XML DOM that is covered in later
chapters.
DOM Level 1 HTML.
This specification extends the Level 1 Core specification to provide
additional functionality for HTML, known as Dynamic HTML. Script authors can use these
interfaces to manipulate an HTML page.
DOM Level 0.
This specification doesn’t exist, but the title refers to the combination of
the HTML DOMs exposed in Microsoft Internet Explorer 3 and Netscape Navigator 3.
The Tree Model
XML is a hierarchical language: The tags contained within an XML document have
parent-child relationships (see Figure 4.1). The hierarchical nature of an XML document
naturally leads to a tree for the representation of an XML document. The DOM
specification does not state that the internal structure of the XML document should be a
tree; rather the set of interfaces that are presented leads directly to a conceptual model of
a tree. In other words, the parser uses whatever internal structure programmers see fit.
On the other hand, users of this parser see a tree representation of the XML document
as provided by the DOM interfaces. Each construct in an XML document, such as an
element or an attribute, is represented as a node in the tree. This tree representation is
designed with object-oriented principles. The nodes that represent the XML document
constructs each have their own set of properties and methods, and share functionality
from a base class. Some of the functionality present in all nodes includes the mechanism
to navigate through the tree and the ability to manipulate the contents of nodes.
|
| |