Help Center

Local Navigation

Object: NodeIterator

Availability

BlackBerry® Device Software version 4.6 or later

The NodeIterator object enables you to navigate up and down through a flat representation of the document tree. This object is similar to the TreeWalker objects, except that TreeWalker presents nodes in a tree-oriented view, rather than the list view presented by NodeIterator.

Create a NodeIterator using Document.createNodeIterator().

NodeIterator properties

Property name

Type

Description

Status

Support level

Availability

expandEntityReferences

boolean

Returns whether or not the NodeIterator expands the entity references it encounters as it traverses the document.

read only

DOM 2 Traversal

4.6 or later

filter

NodeFilter

Returns the NodeFilter used to filter nodes for traversal.

read only

DOM 2 Traversal

4.6 or later

root

Node

Returns the Node at which the NodeIterator begins traversing the document.

read only

DOM 2 Traversal

4.6 or later

whatToShow

unsigned long

Returns which node types are presented by the NodeIterator, represented by one or more NodeFilter constants.

Multiple values may be specified using a bitwise OR.

read only

DOM 2 Traversal

4.6 or later

NodeIterator methods

Method name

Description

Support level

Availability

detach()

Detaches the NodeIterator from the set which it iterated over.

DOM 2 Traversal

4.6 or later

nextNode()

Moves the NodeIterator to the next visible Node in the document order, relative to the current node.

DOM 2 Traversal

4.6 or later

previousNode()

Moves the NodeIterator to the previous visible Node in the document order, relative to the current node.

DOM 2 Traversal

4.6 or later

Previous topic: NodeFilter methods

Was this information helpful? Send us your comments.