The DOMNode interface is the primary datatype for the entire Document Object Model. It represents a single node in the document tree. While all objects implementing the Node interface expose methods for dealing with children, not all objects implementing the Node interface may have children. For example, Text nodes may not have children, and adding children to such nodes results in a DOMException being raised. The attributes nodeName, nodeValue and attributes are included as a mechanism to get at node information without casting down to the specific derived interface. In cases where there is no obvious mapping of these attributes for a specific nodeType (e.g., nodeValue for an Element or attributes for a Comment), this returns null. Note that the specialized interfaces may contain additional and more convenient mechanisms to get and set the relevant information.


Class Attributes Index

 o ELEMENT_NODE
The node is an DOMElement.
 o ATTRIBUTE_NODE
The node is a DOMAttr.
 o TEXT_NODE
The node is a DOMText.
 o CDATA_SECTION_NODE
The node is a DOMCDATASection.
 o ENTITY_REFERENCE_NODE
The node is a DOMEntityReference.
 o ENTITY_NODE
The node is a DOMNode.
 o PROCESSING_INSTRUCTION_NODE
The node is a DOMProcessingInstruction.
 o COMMENT_NODE
The node is a DOMComment.
 o DOCUMENT_NODE
The node is a DOMDocument.
 o DOCUMENT_TYPE_NODE
The node is a DOMDocumentType.
 o DOCUMENT_FRAGMENT_NODE
The node is a DOMDocumentFragment.
 o NOTATION_NODE
The node is a DOMNotation.

Instance Methods Index

 o GetNodeName()
The name of this node.
 o GetNodeValue()
The value of this node.
 o SetNodeValue( String arg1 )
Sets the value of the this node.
 o GetNodeType()
The type of node.
 o GetParentNode()
The parent of this node.
 o GetChildNodes()
A list of child nodes.
 o GetFirstChild()
The first child of this node.
 o GetLastChild()
The last child of this node.
 o GetPreviousSibling()
The previous sibling of this node.
 o GetNextSibling()
The next sibling of this node.
 o GetAttributes()
The attributes of this node.
 o GetOwnerDocument()
The DOMDocument object that this node belongs to.
 o InsertBefore( DOMNode newChild, DOMNode refChild )
Insert the newChild node before the refChild node.
 o ReplaceChild( DOMNode newChild, DOMNode oldChild )
Replace the oldChild node with the newChild node.
 o RemoveChild( DOMNode oldChild )
Remove the oldChild node.
 o AppendChild( DOMNode newChild )
Append the newChild node.
 o HasChildNodes()
Determine if a node has children.
 o CloneNode( Boolean deep )
Duplicate the node.
 o Cast()
Cast the node to the appropriate type.

Class Attributes

 o ELEMENT_NODE
 Integer ELEMENT_NODE

The node is an DOMElement.

 o ATTRIBUTE_NODE
 Integer ATTRIBUTE_NODE

The node is an DOMAttr.

 o TEXT_NODE
 Integer TEXT_NODE

The node is an DOMText.

 o CDATA_SECTION_NODE
 Integer CDATA_SECTION_NODE

The node is an DOMCDATASection.

 o ENTITY_REFERENCE_NODE
 Integer ENTITY_REFERENCE_NODE

The node is an DOMEntityReference.

 o ENTITY_NODE
 Integer ENTITY_NODE

The node is an DOMEntity.

 o PROCESSING_INSTRUCTION_NODE
 Integer PROCESSING_INSTRUCTION_NODE

The node is an DOMProcessingInstruction.

 o COMMENT_NODE
 Integer COMMENT_NODE

The node is an DOMComment.

 o DOCUMENT_NODE
 Integer DOCUMENT_NODE

The node is an DOMDocument.

 o DOCUMENT_TYPE_NODE
 Integer DOCUMENT_TYPE_NODE

The node is an DOMDocumentType.

 o DOCUMENT_FRAGMENT_NODE
 Integer DOCUMENT_FRAGMENT_NODE

The node is an DOMDocumentFragment.

 o NOTATION_NODE
 Integer NOTATION_NODE

The node is an DOMNotation.

Instance Methods

 o GetNodeName
 String GetNodeName()

The name of this node.

Returns:
The name of this node.
 o GetNodeValue
 String GetNodeValue()

The value of this node, depending on its type; see the table above. When it is defined to be null, setting it has no effect.

Returns:
The value of this node.
 o SetNodeValue
 Void SetNodeValue(
             String nodeValue )

Sets the value of the node.

Parameters:
nodeValue  -  The value to set the node
 
 o GetNodeType
 Integer GetNodeType()

A code representing the type of the underlying object, as defined above.

Returns:
A code representing the type of the underlying object.
 o GetParentNode
 DOMNode GetParentNode()

The parent of this node. All nodes, except Attr, Document, DocumentFragment, Entity, and Notation may have a parent. However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this is null.

Returns:
A DOMNode that represents the parent.
 o GetChildNodes
 DOMNodeList GetChildNodes()

A NodeList that contains all children of this node. If there are no children, this is a NodeList containing no nodes. The content of the returned NodeList is "live" in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the NodeList accessors; it is not a static snapshot of the content of the node. This is true for every NodeList, including the ones returned by the getElementsByTagName method.

Returns:
A DOMNodeList of the children.
 o GetFirstChild
 DOMNode GetFirstChild()

The first child of this node. If there is no such node, this returns null.

Returns:
A DOMNode representing the first child.
 o GetLastChild
 DOMNode GetLastChild()

The last child of this node. If there is no such node, this returns null.

Returns:
A DOMNode representing the last child.
 o GetPreviousSibling
 DOMNode GetPreviousSibling()

The node immediately preceding this node. If there is no such node, this returns null.

Returns:
The node immediately preceding this node.
 o GetNextSibling
 DOMNode GetNextSibling()

The node immediately following this node. If there is no such node, this returns null.

Returns:
The node immediately following this node.
 o GetAttributes
 DOMNamedNodeMap GetAttributes()

A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.

Returns:
A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.
 o GetOwnerDocument
 DOMDocument GetOwnerDocument()

The Document object associated with this node. This is also the Document object used to create new nodes. When this node is a Document or a DocumentType which is not used with any Document yet, this is null.

Returns:
The Document object associated with this node.
 o InsertBefore
 DOMNode InsertBefore(
                DOMNode newChild,
                DOMNode refChild )

Inserts the node newChild before the existing child node refChild. If refChild is null, insert newChild at the end of the list of children. If newChild is a DocumentFragment object, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.

Parameters:
newChild  -  The node to insert.
refChild  -  The reference node, i.e., the node before which the new node must be inserted.
Returns:
The node being inserted
 o ReplaceChild
 DOMNode ReplaceChild(
                DOMNode newChild,
                DOMNode oldChild )

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If newChild is a DocumentFragment object, refChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.

Parameters:
newChild  -  The new node to put in the child list.
oldChild  -  The node being replaced in the list.
Returns:
The node replaced.
 o RemoveChild
 DOMNode RemoveChild(
               DOMNode oldChild )

Removes the child node indicated by oldChild from the list of children, and returns it.

Parameters:
oldChild  -  The node being removed.
Returns:
The node removed.
 o AppendChild
 DOMNode AppendChild(
               DOMNode newChild )

Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed.

Parameters:
newChild  -  The node to add.
Returns:
The node added.
 o HasChildNodes
 Boolean HasChildNodes()

This is a convenience method to allow easy determination of whether a node has any children.

Returns:
True if the node has any children, false if the node has no children.
 o CloneNode
 DOMNode CloneNode(
              Boolean deep )

Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent (parentNode returns null.). Cloning an Element copies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any text it contains unless it is a deep clone, since the text is contained in a child Text node. Cloning any other type of node simply returns a copy of this node. Note that cloning an immutable subtree results in a mutable copy, but the children of an EntityReference clone are readonly.

Parameters:
deep  -  If true, recursively clone the subtree under the specified node; if false, clone only the node itself (and its attributes, if it is an Element).
Returns:
The duplicate node.
 o Cast
 Dynamic Cast()

Cast the DOMNode to the appropriate type.

Returns:
The actual type of this node (e.g. DOMElement, DOMText, etc.).