Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.