Interface IDocumentTraversal

Interface IDocumentTraversal

Namespace: Aspose.Html.Dom.Traversal
Assembly: Aspose.HTML.dll (25.2.0)

DocumentTraversal contains methods that create iterators and tree-walkers to traverse a node and its children in document order (depth first, pre-order traversal, which is equivalent to the order in which the start tags occur in the text representation of the document). In DOMs which support the Traversal feature, DocumentTraversal will be implemented by the same objects that implement the Document interface.

See also the Document object Model (DOM) Level 2 Traversal and Range Specification. @since DOM Level 2

[ComVisible(true)]
[DOMNoInterfaceObject]
public interface IDocumentTraversal

Methods

CreateNodeIterator(Node)

Create a new NodeIterator over the subtree rooted at the specified node.

[DOMName("createNodeIterator")]
INodeIterator CreateNodeIterator(Node root)

Parameters

root Node

node which will be iterated together with its children. The iterator is initially positioned just before this node. The whatToShow flags and the filter, if any, are not considered when setting this position. The root must not be null.

Returns

INodeIterator

The newly created NodeIterator.

Exceptions

DOMException

NOT_SUPPORTED_ERR: Raised if the specified root is null.

CreateNodeIterator(Node, long)

Create a new NodeIterator over the subtree rooted at the specified node.

[DOMName("createNodeIterator")]
INodeIterator CreateNodeIterator(Node root, long whatToShow)

Parameters

root Node

node which will be iterated together with its children. The iterator is initially positioned just before this node. The whatToShow flags and the filter, if any, are not considered when setting this position. The root must not be null.

whatToShow long

flag specifies which node types may appear in the logical view of the tree presented by the iterator. See the description of NodeFilter for the set of possible SHOW_ values.These flags can be combined using OR.

Returns

INodeIterator

The newly created NodeIterator.

Exceptions

DOMException

NOT_SUPPORTED_ERR: Raised if the specified root is null.

CreateNodeIterator(Node, long, INodeFilter)

Create a new NodeIterator over the subtree rooted at the specified node.

[DOMName("createNodeIterator")]
INodeIterator CreateNodeIterator(Node root, long whatToShow, INodeFilter filter)

Parameters

root Node

node which will be iterated together with its children. The iterator is initially positioned just before this node. The whatToShow flags and the filter, if any, are not considered when setting this position. The root must not be null.

whatToShow long

flag specifies which node types may appear in the logical view of the tree presented by the iterator. See the description of NodeFilter for the set of possible SHOW_ values.These flags can be combined using OR.

filter INodeFilter

NodeFilter to be used with this TreeWalker, or null to indicate no filter.

Returns

INodeIterator

The newly created NodeIterator.

Exceptions

DOMException

NOT_SUPPORTED_ERR: Raised if the specified root is null.

CreateTreeWalker(Node)

Create a new TreeWalker over the subtree rooted at the specified node.

[DOMName("createTreeWalker")]
ITreeWalker CreateTreeWalker(Node root)

Parameters

root Node

node which will serve as the root for the TreeWalker. The whatToShow flags and the NodeFilter are not considered when setting this value; any node type will be accepted as the root. The currentNode of the TreeWalker is initialized to this node, whether or not it is visible. The root functions as a stopping point for traversal methods that look upward in the document structure, such as parentNode and nextNode. The root must not be null.

Returns

ITreeWalker

The newly created TreeWalker.

CreateTreeWalker(Node, long)

Create a new TreeWalker over the subtree rooted at the specified node.

[DOMName("createTreeWalker")]
ITreeWalker CreateTreeWalker(Node root, long whatToShow)

Parameters

root Node

node which will serve as the root for the TreeWalker. The whatToShow flags and the NodeFilter are not considered when setting this value; any node type will be accepted as the root. The currentNode of the TreeWalker is initialized to this node, whether or not it is visible. The root functions as a stopping point for traversal methods that look upward in the document structure, such as parentNode and nextNode. The root must not be null.

whatToShow long

flag specifies which node types may appear in the logical view of the tree presented by the tree-walker. See the description of NodeFilter for the set of possible SHOW_ values.These flags can be combined using OR.

Returns

ITreeWalker

The newly created TreeWalker.

CreateTreeWalker(Node, long, INodeFilter)

Create a new TreeWalker over the subtree rooted at the specified node.

[DOMName("createTreeWalker")]
ITreeWalker CreateTreeWalker(Node root, long whatToShow, INodeFilter filter)

Parameters

root Node

node which will serve as the root for the TreeWalker. The whatToShow flags and the NodeFilter are not considered when setting this value; any node type will be accepted as the root. The currentNode of the TreeWalker is initialized to this node, whether or not it is visible. The root functions as a stopping point for traversal methods that look upward in the document structure, such as parentNode and nextNode. The root must not be null.

whatToShow long

flag specifies which node types may appear in the logical view of the tree presented by the tree-walker. See the description of NodeFilter for the set of possible SHOW_ values.These flags can be combined using OR.

filter INodeFilter

NodeFilter to be used with this TreeWalker, or null to indicate no filter.

Returns

ITreeWalker

The newly created TreeWalker.