\section{DOM::Custom\-Node\-Filter Class Reference}
\label{classDOM_1_1CustomNodeFilter}\index{DOM::CustomNodeFilter@{DOM::CustomNodeFilter}}
{\bf Custom\-Node\-Filter}{\rm (p.\,\pageref{classDOM_1_1CustomNodeFilter})} can be used to define your own {\bf Node\-Filter}{\rm (p.\,\pageref{classDOM_1_1NodeFilter})} for use with Node\-Iterators and Tree\-Walkers.  


{\tt \#include $<$dom2\_\-traversal.h$>$}

\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
virtual short {\bf accept\-Node} (const  {\bf Node} \&n)\label{classDOM_1_1CustomNodeFilter_a2}

\item 
virtual bool {\bf is\-Null} ()\label{classDOM_1_1CustomNodeFilter_a3}

\item 
virtual {\bf DOMString} {\bf custom\-Node\-Filter\-Type} ()\label{classDOM_1_1CustomNodeFilter_a4}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
Custom\-Node\-Filter\-Impl $\ast$ {\bf impl}\label{classDOM_1_1CustomNodeFilter_p0}

\end{CompactItemize}


\subsection{Detailed Description}
{\bf Custom\-Node\-Filter}{\rm (p.\,\pageref{classDOM_1_1CustomNodeFilter})} can be used to define your own {\bf Node\-Filter}{\rm (p.\,\pageref{classDOM_1_1NodeFilter})} for use with Node\-Iterators and Tree\-Walkers. 

You can create a custom filter by doing the follwing:

class My\-Custom\-Node\-Filter \{ ..... virtual short accept\-Node (const {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})} \&n); ..... \}

Then in your program:

short My\-Custom\-Node\-Filter::accept\-Node (const {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})} \&n) \{ if (condition) return Node\-Filter::FILTER\_\-ACCEPT; else .... \}

My\-Custom\-Filter $\ast$filter = new My\-Custom\-Filter(); {\bf Node\-Filter}{\rm (p.\,\pageref{classDOM_1_1NodeFilter})} nf = Node\-Filter::create\-Cutsom(filter); {\bf Node\-Iterator}{\rm (p.\,\pageref{classDOM_1_1NodeIterator})} ni = document.create\-Node\-Iterator(document,Node\-Filter.SHOW\_\-ALL,nf,false);

The default implementation of accept\-Node() returns Node\-Filter::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:\begin{CompactItemize}
\item 
dom2\_\-traversal.h\item 
dom2\_\-traversal.cpp\end{CompactItemize}
