ZVON > References > DOM2 Reference

acceptNode (method )

Owning interface and usage:  
NodeFilter.acceptNode(n)

Member of these other interfaces:  
none

Description:  
Test whether a specified node is visible in the logical view of a TreeWalker or NodeIterator. This function will be called by the implementation of TreeWalker and NodeIterator; it is not normally called directly from user code. (Though you could do so if you wanted to use the same filter to guide your own application logic.)

Possible Constants to Return:
The following constants are returned by the acceptNode() method:
  1 = FILTER_ACCEPT (of type short) `
Accept the node. Navigation methods defined for NodeIterator or TreeWalker will return this node.
  2 = FILTER_REJECT (of type short) `
Reject the node. Navigation methods defined for NodeIterator or TreeWalker will not return this node. For TreeWalker, the children of this node will also be rejected. NodeIterators treat this as a synonym for FILTER_SKIP.
  3 = FILTER_SKIP (of type short) `
Skip this single node. Navigation methods defined for NodeIterator or TreeWalker will not return this node. For both NodeIterator and TreeWalker, the children of this node will still be considered.

Parameters:  
Node n  -  The node to check to see if it passes the filter or not.

Returns:  
short -  a constant to determine whether the node is accepted, rejected, or skipped, as defined above.

Exceptions:  
none