DOM::CustomNodeFilter class Reference (khtml Library)

| # khtml Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# DOM::CustomNodeFilter Class Reference

CustomNodeFilter can be used to define your own NodeFilter for use with NodeIterators and TreeWalkers. More...

`#include <dom2_traversal.h>`

List of all members.

## Public Member Functions
virtual short | acceptNode (const Node &n)
virtual bool | isNull ()
virtual DOMString | customNodeFilterType ()
## Protected Attributes
CustomNodeFilterImpl * | impl

## Detailed Description

CustomNodeFilter can be used to define your own NodeFilter for use with NodeIterators and TreeWalkers.

You can create a custom filter by doing the follwing:

class MyCustomNodeFilter { ..... virtual short acceptNode (const Node &n); ..... }

Then in your program:

short MyCustomNodeFilter::acceptNode (const Node &n) { if (condition) return NodeFilter::FILTER_ACCEPT; else .... }

MyCustomFilter *filter = new MyCustomFilter(); NodeFilter nf = NodeFilter::createCutsom(filter); NodeIterator ni = document.createNodeIterator(document,NodeFilter.SHOW_ALL,nf,false);

The default implementation of acceptNode() returns NodeFilter::FILTER_ACCEPT for all nodes.

Definition at line 295 of file dom2_traversal.h.

The documentation for this class was generated from the following files:

- dom2_traversal.h
- dom2_traversal.cpp

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:35:56 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001