## com.gargoylesoftware.htmlunit.html
Class DomNode

    java.lang.Object
      com.gargoylesoftware.htmlunit.html.DomNode

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable, org.w3c.dom.Node

Direct Known Subclasses:
  DomCharacterData, DomDocumentFragment, DomDocumentType, DomNamespaceNode, DomProcessingInstruction, SgmlPage

    public abstract class DomNode

extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable, org.w3c.dom.Node

Base class for nodes in the HTML DOM tree. This class is modeled after the W3C DOM specification, but does not implement it.

Version:
  $Revision: 4794 $
Author:
  Mike Bowler, Mike J. Bresnahan, David K. Taylor, Christian Sell, Chris Erskine, Mike Williams, Marc Guillemot, Denis N. Antonioli, Daniel Gredler, Ahmed Ashour, Rodney Gitzel, Sudhan Moghe, Tom Anderson
See Also:
  Serialized Form

Nested Class Summary
`protected class` `DomNode.ChildIterator` An iterator over all children of this node.
`protected class` `DomNode.DescendantElementsIterator` An iterator over all HtmlElement descendants in document order.

Field Summary
`protected static java.lang.String` `AS_TEXT_BLANK` Indicates a non blank that can't be trimmed or reduced.
`protected static java.lang.String` `AS_TEXT_BLOCK_SEPARATOR` Indicates a block.
`protected static java.lang.String` `AS_TEXT_NEW_LINE` Indicates a new line.
`protected static java.lang.String` `AS_TEXT_TAB` Indicates a tab.
`static java.lang.String` `PROPERTY_ELEMENT` The name of the "element" property.
`static java.lang.String` `READY_STATE_COMPLETE` A ready state constant for IE (state 5).
`static java.lang.String` `READY_STATE_INTERACTIVE` A ready state constant for IE (state 4).
`static java.lang.String` `READY_STATE_LOADED` A ready state constant for IE (state 3).
`static java.lang.String` `READY_STATE_LOADING` A ready state constant for IE (state 2).
`static java.lang.String` `READY_STATE_UNINITIALIZED` A ready state constant for IE (state 1).

Fields inherited from interface org.w3c.dom.Node

`ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE`

Constructor Summary
`protected` `DomNode()` Deprecated.
`protected` `DomNode(SgmlPage page)` Creates a new instance.

Method Summary
`void` `addDomChangeListener(DomChangeListener listener)` Adds a `DomChangeListener` to the listener list.
`DomNode` `appendChild(org.w3c.dom.Node node)`
`java.lang.String` `asText()` Returns a textual representation of this element that represents what would be visible to the user if this page was shown in a web browser.
`java.lang.String` `asXml()` Returns a string representation of the XML document from this element and all it's children (recursively).
`protected void` `checkChildHierarchy(org.w3c.dom.Node newChild)` Check for insertion errors for a new child node.
`DomNode` `cloneNode(boolean deep)`
`short` `compareDocumentPosition(org.w3c.dom.Node other)`
`protected void` `fireNodeAdded(DomNode parentNode, DomNode addedNode)` Support for reporting DOM changes.
`protected void` `fireNodeDeleted(DomNode parentNode, DomNode deletedNode)` Support for reporting DOM changes.
`java.lang.Iterable<HtmlElement>` `getAllHtmlChildElements()` Returns an `Iterable` that will recursively iterate over all of this node's descendants.
`protected java.util.List<org.w3c.dom.Node>` `getAncestors(boolean includeSelf)` Gets the ancestors of the node.
`org.w3c.dom.NamedNodeMap` `getAttributes()`
`java.lang.String` `getBaseURI()` Not yet implemented.

`

`<E> java.util.List<E>`

`

`getByXPath(java.lang.String xpathExpr)`
Evaluates the specified XPath expression from this node, returning the matching elements.

`java.lang.String` `getCanonicalXPath()` Returns the canonical XPath expression which identifies this node, for instance `"/html/body/table[3]/tbody/tr[5]/td[2]/span/a[3]"`.
`DomNodeList<DomNode>` `getChildNodes()`
`java.lang.Iterable<DomNode>` `getChildren()`
`int` `getEndColumnNumber()` Returns the column number in the source page where the DOM node ends.
`int` `getEndLineNumber()` Returns the line number in the source page where the DOM node ends.
`java.lang.Object` `getFeature(java.lang.String feature, java.lang.String version)` Not yet implemented.

`

`<X> X`

`

`getFirstByXPath(java.lang.String xpathExpr)`
Evaluates the specified XPath expression from this node, returning the first matching element, or `null` if no node matches the specified XPath expression.

`DomNode` `getFirstChild()`
`DomNode` `getLastChild()`
`java.lang.String` `getLocalName()`
`java.lang.String` `getNamespaceURI()`
`DomNode` `getNextSibling()`
`abstract java.lang.String` `getNodeName()` Returns this node's node name.
`abstract short` `getNodeType()` Returns this node's node type.
`java.lang.String` `getNodeValue()`
`org.w3c.dom.Document` `getOwnerDocument()`
`SgmlPage` `getPage()` Returns the page that contains this node.
`DomNode` `getParentNode()`
`java.lang.String` `getPrefix()`
`DomNode` `getPreviousSibling()`
`java.lang.String` `getReadyState()` Returns this node's ready state (IE only).
`net.sourceforge.htmlunit.corejs.javascript.ScriptableObject` `getScriptObject()` INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. Returns the JavaScript object that corresponds to this node, lazily initializing a new one if necessary.
`int` `getStartColumnNumber()` Returns the column number in the source page where the DOM node starts.
`int` `getStartLineNumber()` Returns the line number in the source page where the DOM node starts.
`java.lang.String` `getTextContent()`
`java.lang.Object` `getUserData(java.lang.String key)` Not yet implemented.
`boolean` `hasAttributes()`
`boolean` `hasChildNodes()`
`void` `insertBefore(DomNode newNode)` Inserts a new child node before this node into the child relationship this node is a part of.
`org.w3c.dom.Node` `insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)`
`boolean` `isAncestorOf(DomNode node)` Returns `true` if this node is an ancestor of the specified node.
`protected boolean` `isBlock()` Indicates if the text representation of this element is made as a block, ie if new lines need to be inserted before and after it.
`boolean` `isDefaultNamespace(java.lang.String namespaceURI)` Not yet implemented.
`boolean` `isDisplayed()` Returns `true` if this node is displayed and can be visible to the user (ignoring screen size, scrolling limitations, color, font-size, or overlapping nodes).
`boolean` `isEqualNode(org.w3c.dom.Node arg)` Not yet implemented.
`boolean` `isSameNode(org.w3c.dom.Node other)`
`boolean` `isSupported(java.lang.String namespace, java.lang.String featureName)` Not yet implemented.
`protected boolean` `isTrimmedText()` Returns a flag indicating whether or not this node should have any leading and trailing whitespace removed when `asText()` is called.
`java.lang.String` `lookupNamespaceURI(java.lang.String prefix)` Not yet implemented.
`java.lang.String` `lookupPrefix(java.lang.String namespaceURI)` Not yet implemented.
`void` `normalize()`
`protected void` `notifyIncorrectness(java.lang.String message)` Notifies the registered `IncorrectnessListener` of something that is not fully correct.
`protected void` `onAddedToPage()` Lifecycle method invoked whenever a node is added to a page.
`protected void` `onAllChildrenAddedToPage(boolean postponed)` Lifecycle method invoked after a node and all its children have been added to a page, during parsing of the HTML.
`protected void` `printChildrenAsXml(java.lang.String indent, java.io.PrintWriter printWriter)` Recursively writes the XML data for the node tree starting at `node`.
`protected void` `printXml(java.lang.String indent, java.io.PrintWriter printWriter)` Recursively writes the XML data for the node tree starting at `node`.
`void` `remove()` Removes this node from all relationships with other nodes.
`void` `removeAllChildren()` Removes all of this node's children.
`org.w3c.dom.Node` `removeChild(org.w3c.dom.Node child)`
`void` `removeDomChangeListener(DomChangeListener listener)` Removes a `DomChangeListener` from the listener list.
`void` `replace(DomNode newNode)` Replaces this node with another node.
`org.w3c.dom.Node` `replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)`

`

`<E> java.util.List<E>`

`

`selectNodes(java.lang.String xpathExpr)`

`

`<X> X`

`

`selectSingleNode(java.lang.String xpathExpr)`

`protected void` `setNextSibling(DomNode next)`
`void` `setNodeValue(java.lang.String x)`
`protected void` `setParentNode(DomNode parent)` Sets the parent node.
`void` `setPrefix(java.lang.String prefix)`
`protected void` `setPreviousSibling(DomNode previous)`
`void` `setReadyState(java.lang.String state)` Sets this node's ready state (IE only).
`void` `setScriptObject(net.sourceforge.htmlunit.corejs.javascript.ScriptableObject scriptObject)` INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. Sets the JavaScript object that corresponds to this node.
`void` `setTextContent(java.lang.String textContent)`
`java.lang.Object` `setUserData(java.lang.String key, java.lang.Object data, org.w3c.dom.UserDataHandler handler)` Not yet implemented.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### AS_TEXT_BLOCK_SEPARATOR

    protected static final java.lang.String AS_TEXT_BLOCK_SEPARATOR

  Indicates a block. Will be rendered as line separator (multiple block marks are ignored)

  See Also:
    Constant Field Values

### AS_TEXT_NEW_LINE

    protected static final java.lang.String AS_TEXT_NEW_LINE

  Indicates a new line. Will be rendered as line separator.

  See Also:
    Constant Field Values

### AS_TEXT_BLANK

    protected static final java.lang.String AS_TEXT_BLANK

  Indicates a non blank that can't be trimmed or reduced.

  See Also:
    Constant Field Values

### AS_TEXT_TAB

    protected static final java.lang.String AS_TEXT_TAB

  Indicates a tab.

  See Also:
    Constant Field Values

### READY_STATE_UNINITIALIZED

    public static final java.lang.String READY_STATE_UNINITIALIZED

  A ready state constant for IE (state 1).

  See Also:
    Constant Field Values

### READY_STATE_LOADING

    public static final java.lang.String READY_STATE_LOADING

  A ready state constant for IE (state 2).

  See Also:
    Constant Field Values

### READY_STATE_LOADED

    public static final java.lang.String READY_STATE_LOADED

  A ready state constant for IE (state 3).

  See Also:
    Constant Field Values

### READY_STATE_INTERACTIVE

    public static final java.lang.String READY_STATE_INTERACTIVE

  A ready state constant for IE (state 4).

  See Also:
    Constant Field Values

### READY_STATE_COMPLETE

    public static final java.lang.String READY_STATE_COMPLETE

  A ready state constant for IE (state 5).

  See Also:
    Constant Field Values

### PROPERTY_ELEMENT

    public static final java.lang.String PROPERTY_ELEMENT

  The name of the "element" property. Used when watching property change events.

  See Also:
    Constant Field Values

Constructor Detail

### DomNode

    @Deprecated
    protected DomNode()

  Deprecated.

  Never call this, used for Serialization.

### DomNode

    protected DomNode(SgmlPage page)

  Creates a new instance.

  Parameters:
    `page` - the page which contains this node

Method Detail

### getStartLineNumber

    public int getStartLineNumber()

  Returns the line number in the source page where the DOM node starts.

  Returns:
    the line number in the source page where the DOM node starts

### getStartColumnNumber

    public int getStartColumnNumber()

  Returns the column number in the source page where the DOM node starts.

  Returns:
    the column number in the source page where the DOM node starts

### getEndLineNumber

    public int getEndLineNumber()

  Returns the line number in the source page where the DOM node ends.

  Returns:
    0 if no information on the line number is available (for instance for nodes dynamically added), -1 if the end tag has not yet been parsed (during page loading)

### getEndColumnNumber

    public int getEndColumnNumber()

  Returns the column number in the source page where the DOM node ends.

  Returns:
    0 if no information on the line number is available (for instance for nodes dynamically added), -1 if the end tag has not yet been parsed (during page loading)

### getPage

    public SgmlPage getPage()

  Returns the page that contains this node.

  Returns:
    the page that contains this node

### getOwnerDocument

    public org.w3c.dom.Document getOwnerDocument()

  Specified by:
    `getOwnerDocument` in interface `org.w3c.dom.Node`

### setScriptObject

    public void setScriptObject(net.sourceforge.htmlunit.corejs.javascript.ScriptableObject scriptObject)

  INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
  Sets the JavaScript object that corresponds to this node. This is not guaranteed to be set even if there is a JavaScript object for this DOM node.

  Parameters:
    `scriptObject` - the JavaScript object

### getLastChild

    public DomNode getLastChild()

  Specified by:
    `getLastChild` in interface `org.w3c.dom.Node`

### getParentNode

    public DomNode getParentNode()

  Specified by:
    `getParentNode` in interface `org.w3c.dom.Node`

### setParentNode

    protected void setParentNode(DomNode parent)

  Sets the parent node.

  Parameters:
    `parent` - the parent node

### getPreviousSibling

    public DomNode getPreviousSibling()

  Specified by:
    `getPreviousSibling` in interface `org.w3c.dom.Node`

### getNextSibling

    public DomNode getNextSibling()

  Specified by:
    `getNextSibling` in interface `org.w3c.dom.Node`

### getFirstChild

    public DomNode getFirstChild()

  Specified by:
    `getFirstChild` in interface `org.w3c.dom.Node`

### isAncestorOf

    public boolean isAncestorOf(DomNode node)

  Returns `true` if this node is an ancestor of the specified node.

  Parameters:
    `node` - the node to check
  Returns:
    `true` if this node is an ancestor of the specified node

### setPreviousSibling

    protected void setPreviousSibling(DomNode previous)

  Parameters:
    `previous` - set the previousSibling field value

### setNextSibling

    protected void setNextSibling(DomNode next)

  Parameters:
    `next` - set the nextSibling field value

### getNodeType

    public abstract short getNodeType()

  Returns this node's node type.

  Specified by:
    `getNodeType` in interface `org.w3c.dom.Node`
  Returns:
    this node's node type

### getNodeName

    public abstract java.lang.String getNodeName()

  Returns this node's node name.

  Specified by:
    `getNodeName` in interface `org.w3c.dom.Node`
  Returns:
    this node's node name

### getNamespaceURI

    public java.lang.String getNamespaceURI()

  Specified by:
    `getNamespaceURI` in interface `org.w3c.dom.Node`

### getLocalName

    public java.lang.String getLocalName()

  Specified by:
    `getLocalName` in interface `org.w3c.dom.Node`

### getPrefix

    public java.lang.String getPrefix()

  Specified by:
    `getPrefix` in interface `org.w3c.dom.Node`

### setPrefix

    public void setPrefix(java.lang.String prefix)

  Specified by:
    `setPrefix` in interface `org.w3c.dom.Node`

### hasChildNodes

    public boolean hasChildNodes()

  Specified by:
    `hasChildNodes` in interface `org.w3c.dom.Node`

### getChildNodes

    public DomNodeList<DomNode> getChildNodes()

  Specified by:
    `getChildNodes` in interface `org.w3c.dom.Node`

### isSupported

    public boolean isSupported(java.lang.String namespace,
                               java.lang.String featureName)

  Not yet implemented.

  Specified by:
    `isSupported` in interface `org.w3c.dom.Node`

### normalize

    public void normalize()

  Specified by:
    `normalize` in interface `org.w3c.dom.Node`

### getBaseURI

    public java.lang.String getBaseURI()

  Not yet implemented.

  Specified by:
    `getBaseURI` in interface `org.w3c.dom.Node`

### compareDocumentPosition

    public short compareDocumentPosition(org.w3c.dom.Node other)

  Specified by:
    `compareDocumentPosition` in interface `org.w3c.dom.Node`

### getAncestors

    protected java.util.List<org.w3c.dom.Node> getAncestors(boolean includeSelf)

  Gets the ancestors of the node.

  Parameters:
    `includeSelf` - should this node be returned too
  Returns:
    a list of the ancestors with the root at the first position

### getTextContent

    public java.lang.String getTextContent()

  Specified by:
    `getTextContent` in interface `org.w3c.dom.Node`

### setTextContent

    public void setTextContent(java.lang.String textContent)

  Specified by:
    `setTextContent` in interface `org.w3c.dom.Node`

### isSameNode

    public boolean isSameNode(org.w3c.dom.Node other)

  Specified by:
    `isSameNode` in interface `org.w3c.dom.Node`

### lookupPrefix

    public java.lang.String lookupPrefix(java.lang.String namespaceURI)

  Not yet implemented.

  Specified by:
    `lookupPrefix` in interface `org.w3c.dom.Node`

### isDefaultNamespace

    public boolean isDefaultNamespace(java.lang.String namespaceURI)

  Not yet implemented.

  Specified by:
    `isDefaultNamespace` in interface `org.w3c.dom.Node`

### lookupNamespaceURI

    public java.lang.String lookupNamespaceURI(java.lang.String prefix)

  Not yet implemented.

  Specified by:
    `lookupNamespaceURI` in interface `org.w3c.dom.Node`

### isEqualNode

    public boolean isEqualNode(org.w3c.dom.Node arg)

  Not yet implemented.

  Specified by:
    `isEqualNode` in interface `org.w3c.dom.Node`

### getFeature

    public java.lang.Object getFeature(java.lang.String feature,
                                       java.lang.String version)

  Not yet implemented.

  Specified by:
    `getFeature` in interface `org.w3c.dom.Node`

### getUserData

    public java.lang.Object getUserData(java.lang.String key)

  Not yet implemented.

  Specified by:
    `getUserData` in interface `org.w3c.dom.Node`

### setUserData

    public java.lang.Object setUserData(java.lang.String key,
                                        java.lang.Object data,
                                        org.w3c.dom.UserDataHandler handler)

  Not yet implemented.

  Specified by:
    `setUserData` in interface `org.w3c.dom.Node`

### hasAttributes

    public boolean hasAttributes()

  Specified by:
    `hasAttributes` in interface `org.w3c.dom.Node`

### isTrimmedText

    protected boolean isTrimmedText()

  Returns a flag indicating whether or not this node should have any leading and trailing whitespace removed when `asText()` is called. This method should usually return `true`, but must return `false` for such things as text formatting tags.

  Returns:
    a flag indicating whether or not this node should have any leading and trailing whitespace removed when `asText()` is called

### isDisplayed

    public boolean isDisplayed()

  Returns `true` if this node is displayed and can be visible to the user (ignoring screen size, scrolling limitations, color, font-size, or overlapping nodes).

  Returns:
    true if the node is visible to the user
  See Also:
    CSS2 Visibility, CSS2 Display, MSDN Documentation

### asText

    public java.lang.String asText()

  Returns a textual representation of this element that represents what would be visible to the user if this page was shown in a web browser. For example, a single-selection select element would return the currently selected value as text.

  Returns:
    a textual representation of this element that represents what would be visible to the user if this page was shown in a web browser

### isBlock

    protected boolean isBlock()

  Indicates if the text representation of this element is made as a block, ie if new lines need to be inserted before and after it.

  Returns:
    `true` if this element represents a block

### asXml

    public java.lang.String asXml()

  Returns a string representation of the XML document from this element and all it's children (recursively). The charset used is the current page encoding.

  Returns:
    the XML string

### printXml

    protected void printXml(java.lang.String indent,
                            java.io.PrintWriter printWriter)

  Recursively writes the XML data for the node tree starting at `node`.

  Parameters:
    `indent` - white space to indent child nodes
    `printWriter` - writer where child nodes are written

### printChildrenAsXml

    protected void printChildrenAsXml(java.lang.String indent,
                                      java.io.PrintWriter printWriter)

  Recursively writes the XML data for the node tree starting at `node`.

  Parameters:
    `indent` - white space to indent child nodes
    `printWriter` - writer where child nodes are written

### getNodeValue

    public java.lang.String getNodeValue()

  Specified by:
    `getNodeValue` in interface `org.w3c.dom.Node`

### setNodeValue

    public void setNodeValue(java.lang.String x)

  Specified by:
    `setNodeValue` in interface `org.w3c.dom.Node`

### cloneNode

    public DomNode cloneNode(boolean deep)

  Specified by:
    `cloneNode` in interface `org.w3c.dom.Node`

### getScriptObject

    public net.sourceforge.htmlunit.corejs.javascript.ScriptableObject getScriptObject()

  INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
  Returns the JavaScript object that corresponds to this node, lazily initializing a new one if necessary. The logic of when and where the JavaScript object is created needs a clean up: functions using a DOM node's JavaScript object should not have to check if they should create it first.

  Returns:
    the JavaScript object that corresponds to this node

### appendChild

    public DomNode appendChild(org.w3c.dom.Node node)

  Specified by:
    `appendChild` in interface `org.w3c.dom.Node`

### checkChildHierarchy

    protected void checkChildHierarchy(org.w3c.dom.Node newChild)
                                throws org.w3c.dom.DOMException

  Check for insertion errors for a new child node. This is overridden by derived classes to enforce which types of children are allowed.

  Parameters:
    `newChild` - the new child node that is being inserted below this node
  Throws:
    `org.w3c.dom.DOMException` - HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself, or if this node is of type Document and the DOM application attempts to insert a second DocumentType or Element node. WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node.

### insertBefore

    public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild,
                                         org.w3c.dom.Node refChild)

  Specified by:
    `insertBefore` in interface `org.w3c.dom.Node`

### insertBefore

    public void insertBefore(DomNode newNode)
                      throws java.lang.IllegalStateException

  Inserts a new child node before this node into the child relationship this node is a part of. If the specified node is this node, this method is a no-op.

  Parameters:
    `newNode` - the new node to insert
  Throws:
    `java.lang.IllegalStateException` - if this node is not a child of any other node

### getAttributes

    public org.w3c.dom.NamedNodeMap getAttributes()

  Specified by:
    `getAttributes` in interface `org.w3c.dom.Node`

### removeChild

    public org.w3c.dom.Node removeChild(org.w3c.dom.Node child)

  Specified by:
    `removeChild` in interface `org.w3c.dom.Node`

### remove

    public void remove()

  Removes this node from all relationships with other nodes.

### replaceChild

    public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild,
                                         org.w3c.dom.Node oldChild)

  Specified by:
    `replaceChild` in interface `org.w3c.dom.Node`

### replace

    public void replace(DomNode newNode)
                 throws java.lang.IllegalStateException

  Replaces this node with another node. If the specified node is this node, this method is a no-op.

  Parameters:
    `newNode` - the node to replace this one
  Throws:
    `java.lang.IllegalStateException` - if this node is not a child of any other node

### onAddedToPage

    protected void onAddedToPage()

  Lifecycle method invoked whenever a node is added to a page. Intended to be overridden by nodes which need to perform custom logic when they are added to a page. This method is recursive, so if you override it, please be sure to call `super.onAddedToPage()`.

### onAllChildrenAddedToPage

    protected void onAllChildrenAddedToPage(boolean postponed)

  Lifecycle method invoked after a node and all its children have been added to a page, during parsing of the HTML. Intended to be overridden by nodes which need to perform custom logic after they and all their child nodes have been processed by the HTML parser. This method is not recursive, and the default implementation is empty, so there is no need to call `super.onAllChildrenAddedToPage()` if you implement this method.

  Parameters:
    `postponed` - whether to use `PostponedAction` or no

### getChildren

    public final java.lang.Iterable<DomNode> getChildren()

  Returns:
    an Iterable over the children of this node

### getAllHtmlChildElements

    public final java.lang.Iterable<HtmlElement> getAllHtmlChildElements()

  Returns an `Iterable` that will recursively iterate over all of this node's descendants.

  Returns:
    an `Iterable` that will recursively iterate over all of this node's descendants

### getReadyState

    public java.lang.String getReadyState()

  Returns this node's ready state (IE only).

  Returns:
    this node's ready state

### setReadyState

    public void setReadyState(java.lang.String state)

  Sets this node's ready state (IE only).

  Parameters:
    `state` - this node's ready state

### removeAllChildren

    public void removeAllChildren()

  Removes all of this node's children.

### getByXPath

    public <E> java.util.List<E> getByXPath(java.lang.String xpathExpr)

  Evaluates the specified XPath expression from this node, returning the matching elements.

  Parameters:
    `xpathExpr` - the XPath expression to evaluate
  Returns:
    the elements which match the specified XPath expression
  See Also:
    `getFirstByXPath(String)`, `getCanonicalXPath()`

### selectNodes

    public <E> java.util.List<E> selectNodes(java.lang.String xpathExpr)

### getFirstByXPath

    public <X> X getFirstByXPath(java.lang.String xpathExpr)

  Evaluates the specified XPath expression from this node, returning the first matching element, or `null` if no node matches the specified XPath expression.

  Type Parameters:
    `X` - the expression type
  Parameters:
    `xpathExpr` - the XPath expression
  Returns:
    the first element matching the specified XPath expression
  See Also:
    `getByXPath(String)`, `getCanonicalXPath()`

### selectSingleNode

    public <X> X selectSingleNode(java.lang.String xpathExpr)

### getCanonicalXPath

    public java.lang.String getCanonicalXPath()

  Returns the canonical XPath expression which identifies this node, for instance `"/html/body/table[3]/tbody/tr[5]/td[2]/span/a[3]"`.

  WARNING: This sort of automated XPath expression is often quite bad at identifying a node, as it is highly sensitive to changes in the DOM tree.

  Returns:
    the canonical XPath expression which identifies this node
  See Also:
    `getByXPath(String)`

### notifyIncorrectness

    protected void notifyIncorrectness(java.lang.String message)

  Notifies the registered `IncorrectnessListener` of something that is not fully correct.

  Parameters:
    `message` - the notification to send to the registered `IncorrectnessListener`

### addDomChangeListener

    public void addDomChangeListener(DomChangeListener listener)

  Adds a `DomChangeListener` to the listener list. The listener is registered for all descendants of this node.

  Parameters:
    `listener` - the DOM structure change listener to be added
  See Also:
    `removeDomChangeListener(DomChangeListener)`

### removeDomChangeListener

    public void removeDomChangeListener(DomChangeListener listener)

  Removes a `DomChangeListener` from the listener list. The listener is deregistered for all descendants of this node.

  Parameters:
    `listener` - the DOM structure change listener to be removed
  See Also:
    `addDomChangeListener(DomChangeListener)`

### fireNodeAdded

    protected void fireNodeAdded(DomNode parentNode,
                                 DomNode addedNode)

  Support for reporting DOM changes. This method can be called when a node has been added and it will send the appropriate `DomChangeEvent` to any registered `DomChangeListener`s. Note that this method recursively calls this node's parent's `fireNodeAdded(DomNode, DomNode)`.

  Parameters:
    `parentNode` - the parent of the node that was added
    `addedNode` - the node that was added

### fireNodeDeleted

    protected void fireNodeDeleted(DomNode parentNode,
                                   DomNode deletedNode)

  Support for reporting DOM changes. This method can be called when a node has been deleted and it will send the appropriate `DomChangeEvent` to any registered `DomChangeListener`s. Note that this method recursively calls this node's parent's `fireNodeDeleted(DomNode, DomNode)`.

  Parameters:
    `parentNode` - the parent of the node that was deleted
    `deletedNode` - the node that was deleted

Copyright © 2002-2011 Gargoyle Software Inc.. All Rights Reserved.