class CustomNodeFilter

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

Full nameDOM::CustomNodeFilter
Definition#include <dom2_traversal.h>
InheritsDOM::DomShared [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Members


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.

 CustomNodeFilter ()

CustomNodeFilter

 ~CustomNodeFilter ()

~CustomNodeFilter

[virtual]

short  acceptNode (const Node &n)

acceptNode

[virtual]

bool  isNull ()

isNull

[virtual]

DOMString  customNodeFilterType ()

customNodeFilterType

[virtual]

not part of the DOM

Returns a name specifying the type of custom node filter. Useful for checking if an custom node filter is of a particular sublass.

CustomNodeFilterImpl * impl

impl

[protected]


Generated by: dfaure on faure on Tue Apr 16 08:50:42 2002, using kdoc 2.0a53.