Understanding the DOM Part 3 DOM Level 1 Core Fundamental Interfaces
This guide provides an explanation of the fundamental interfaces defined by the W3C's Document Object Model Level One Core recommendation. Under each interface object is a list of attributes it exposes (the bulleted lists). These interfaces, methods and parameters are required of any DOM implementation.
|Interface ||Methods |
|DOMImplementation ||The DOMImplementation interface is used to determine the specific functions that an application supports. For instance, whether the DOM support of the app covers the core functions or any of the extended HTML or XML services. ||hasFeature |
|DocumentFragment ||The DocumentFragment interface is a lightweight version of a full Document object. It is useful for holding a node and its children so that it can be copied, edited or moved within a larger document or for the creation of a sibling to an existing node. fragments are placeholder objects, so when a fragment is inserted into a document, its children are inserted into the specified node instead of the fragment itself. |
|Document is the root interface for a document. Its methods can be used to build an XML or HTML document by creating all of the different node types. || |
- previousSibling nextSibling
| The Node object is the primary datatype for the DOM. It represents a node in the document tree. Not all objects implementing the Node interface may have children, though all nodes support the methods to work with children. Trying to add a child to a Text nodes will raise a DOMException. || |
| The NodeList interface just provides the list of nodes in order. ||item |
|NamedNodeMap || Objects implementing the NamedNodeMap interface are used to represent collections of nodes that can be accessed by name. || |
|CharacterData ||The CharacterData interface extends Node with a set of attributes and methods for accessing character data in the DOM. This set is defined here rather than on each object that uses these attributes and methods for clarity. No DOM objects correspond directly to CharacterData, though Text and others do inherit the interface from it. All offsets in this interface start from 0. || |
[ Click here to move to the next part of the article ]
The Attribute interface represents an attribute in an Element object. Typically the allowable values for the attribute are defined in a document type definition. Remember that Node attributes are not considered children, so they don't show up on the tree.
Contact the WebDeveloper.com® staff
Last modified: Friday, 25-Feb-2011 12:28:06 EST
Join Editor-in-Chief David Fiedler and find truth, justice, and a clue or two.