Method: Document.createNodeIterator()
Availability
|
BlackBerry®
Device Software version 4.6 or later
|
The createNodeIterator() method creates a new NodeIterator object, which you can use to iterate through a set of Document nodes rooted at the given node.
Syntax
Document.createNodeIterator( root, whatToShow, filter, entityReferenceExpansion )
Parameters
Parameter
|
Type
|
Description
|
root
|
Node
|
The node to be iterated with its children. The NodeIterator object is initially positioned just before this node. The value of root must not be null.
|
whatToShow
|
unsigned long
|
The types of nodes to show in the tree view presented by the NodeIterator. The value may be one or more of:
- 0xFFFFFFFF = SHOW_ALL
- 0x00000001 = SHOW_ELEMENT
- 0x00000002 = SHOW_ATTRIBUTE
- 0x00000004 = SHOW_TEXT
- 0x00000008 = SHOW_CDATA_SECTION
- 0x00000010 = SHOW_ENTITY_REFERENCE
- 0x00000020 = SHOW_ENTITY
- 0x00000040 = SHOW_PROCESSING_INSTRUCTION
- 0x00000080 = SHOW_COMMENT
- 0x00000100 = SHOW_DOCUMENT
- 0x00000200 = SHOW_DOCUMENT_TYPE
- 0x00000400 = SHOW_DOCUMENT_FRAGMENT
- 0x00000800 = SHOW_NOTATION
Multiple values may be specified using a bitwise OR.
Note that because attributes, entities, and notations are not the child of any other node, they never appear in the NodeIterator object’s logical view unless root is defined as a Node of that type. If the respective object is not defined as the root, then SHOW_ATTRIBUTE, SHOW_ENTITY, and SHOW_NOTATION have no meaning.
|
filter
|
NodeFilter
|
The filter to use with this NodeIterator object. This parameter may be null.
|
entityReferenceExpansion
|
boolean
|
When true, this method specifies that entity reference nodes should be expanded.
|
Return values
Returns the new NodeIterator object.
Exceptions
Exception
|
Description
|
NOT_SUPPORTED_ERR
|
This error is thrown if the specified root is null.
|
Was this information helpful? Send us your comments.