Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
createTreeWalker
Collapse the table of content
Expand the table of content

createTreeWalker method

Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document.

Document Object Model (DOM) Level 2 Traversal and Range Specification, Section 1.2Internet Explorer 9

 

Syntax


HRESULT retVal = object.createTreeWalker(pRootNode, ulWhatToShow, pFilter, fEntityReferenceExpansion, ppTreeWalker);

Parameters

pRootNode [in]

Type: Node

The root element or node to start traversing on.

ulWhatToShow [in]

Type: long

The type of nodes or elements to appear in the node list. For more information, see IDOMNodeIterator::whatToShow.

pFilter [in]

Type: VARIANT

A custom NodeFilter function to use. For more information, see IDOMNodeIterator::filter. Use a pointer to a null value for no filter.

fEntityReferenceExpansion [in]

Type: VARIANT_BOOL

A flag that specifies whether entity reference nodes are expanded. For more information, see IDOMNodeIterator::expandEntityReferences.

ppTreeWalker [out, retval]

Type: TreeWalker

Returns a TreeWalker object.

Return value

Type: HRESULT

This method can return one of these values.

Return codeDescription
S_OK

The operation completed successfully.

NotSupportedError

pRootNode is NULL.

 

Standards information

Remarks

Use the IDocumentTraversal::createTreeWalker method when you want to navigate a representation of the document's hierarchical structure. If you would rather traverse a sequence of nodes without regard to document structure, use IDocumentTraversal::createNodeIterator.

When a custom NodeFilter function isn't needed, use a pointer to a null value rather than just a null value.

See also

IDocumentTraversal::createNodeIterator

 

 

Community Additions

ADD
Show:
© 2015 Microsoft