The DOM Core





Summary

The org.w3c.dom package includes 13 different subclasses of Node that represent the various possible components of a DOM tree:

Document

The root of the DOM tree. Acts as a factory class for the other kinds of nodes; offers access to the root element, document type declaration, and DOM implementation.

DocumentType

Represents the document type declaration. Provides access to the notations and entities declared in the document's DTD.

Element

Represents an element, including its local name, prefixed name, namespace URI, and attributes.

CharacterData

A common superinterface for Text CDATASection, and Comment. Provides methods to read and modify the text content of these nodes.

Text

Represents a text node in the DOM tree. Has a method to split a text node into two text nodes.

Attr

Represents an attribute of an element; not part of the tree. Has methods to get the name, value, owner element, and default status of an attribute and to change the value of an attribute (but not the name). Most of the time, the attribute-related methods in the Element interface are used rather than working directly with attribute nodes.

Comment

Represents a comment node in the DOM tree. Inherits all its methods from the superinterfaces CharacterData and Node.

ProcessingInstruction

Represents a processing instruction node in the DOM tree. Has methods to get the target and to get and set the data.

CDATASection

Represents a CDATA section node in the DOM tree. Inherits all its methods from the superinterfaces Text, CharacterData, and Node.

EntityReference

Represents an entity reference node in the DOM tree. The children of this node are formed from the replacement text of the entity. Some parsers resolve entity references without putting any entity reference nodes in the tree.

Entity

Represents a parsed or unparsed general entity declared in the DTD. Includes methods to get the public and system ID of the entity. The children of an Entity object are formed from the replacement text of the entity. Entity objects are only accessible through the NamedNodeMap returned by the getEntities() method in the DocumentType interface.

Notation

Represents a notation declared in the DTD. Includes methods to get the public ID and/or system ID of the notation. Only accessible through the NamedNodeMap returned by the getNotations() method in the DocumentType interface.

DocumentFragment

A placeholder for a part of a document that contains multiple sibling nodes that can be moved as a group. It differs from other nodes in that when a document fragment is inserted into a node, the children of the document fragment are placed in that node, but not the document fragment itself.

Each of these interfaces inherits the methods of the Node interface as well as methods providing unique functionality for that particular kind of node.


     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows