Partager via


filter property

Gets the function object that the iterator uses to filter nodes that go into TreeWalker hierarchies or NodeIterator lists.

 

Syntax

HRESULT value = object.get_filter(** p);

Property values

Type: Object

A NodeFilter function that returns ones of the following values:

FILTER_ACCEPT (1)

Accept the node.

FILTER_REJECT (2)

Reject the node. For TreeWalker, child nodes are also rejected. For NodeIterator, this flag is synonymous with FILTER_SKIP.

FILTER_SKIP (3)

Skip the node. Child nodes are considered.

Standards information

Remarks

The NodeFilter is a callback function that provides customized filtering for NodeIterator and TreeWalker. The filter function accepts a node as its only parameter, and indicates whether the node is accepted, rejected, or skipped.

function myFilter(node) {
    // NodeFilter function that returns one of the following flags:
    // NodeFilter.FILTER_ACCEPT, NodeFilter.FILTER_REJECT, NodeFilter.FILTER_SKIP
}