\section{DOM::Node\-Filter Class Reference}
\label{classDOM_1_1NodeFilter}\index{DOM::NodeFilter@{DOM::NodeFilter}}
Filters are objects that know how to \char`\"{}filter out\char`\"{} nodes.  


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

\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Accept\-Code} \{ {\bf FILTER\_\-ACCEPT} =  1, 
{\bf FILTER\_\-REJECT} =  2, 
{\bf FILTER\_\-SKIP} =  3
 \}
\begin{CompactList}\small\item\em The following constants are returned by the {\bf accept\-Node()}{\rm (p.\,\pageref{classDOM_1_1NodeFilter_a4})} method:. \item\end{CompactList}\item 
enum {\bf Show\-Code} \{ \par
{\bf SHOW\_\-ALL} =  0x\-FFFFFFFF, 
{\bf SHOW\_\-ELEMENT} =  0x00000001, 
{\bf SHOW\_\-ATTRIBUTE} =  0x00000002, 
{\bf SHOW\_\-TEXT} =  0x00000004, 
\par
{\bf SHOW\_\-CDATA\_\-SECTION} =  0x00000008, 
{\bf SHOW\_\-ENTITY\_\-REFERENCE} =  0x00000010, 
{\bf SHOW\_\-ENTITY} =  0x00000020, 
{\bf SHOW\_\-PROCESSING\_\-INSTRUCTION} =  0x00000040, 
\par
{\bf SHOW\_\-COMMENT} =  0x00000080, 
{\bf SHOW\_\-DOCUMENT} =  0x00000100, 
{\bf SHOW\_\-DOCUMENT\_\-TYPE} =  0x00000200, 
{\bf SHOW\_\-DOCUMENT\_\-FRAGMENT} =  0x00000400, 
\par
{\bf SHOW\_\-NOTATION} =  0x00000800
 \}
\begin{CompactList}\small\item\em These are the available values for the what\-To\-Show parameter. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Node\-Filter} (const  {\bf Node\-Filter} \&other)\label{classDOM_1_1NodeFilter_a1}

\item 
virtual {\bf Node\-Filter} \& {\bf operator=} (const  {\bf Node\-Filter} \&other)\label{classDOM_1_1NodeFilter_a2}

\item 
virtual short {\bf accept\-Node} (const  {\bf Node} \&n)
\begin{CompactList}\small\item\em Test whether a specified node is visible in the logical view of a {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})} or {\bf Node\-Iterator}{\rm (p.\,\pageref{classDOM_1_1NodeIterator})}. \item\end{CompactList}\item 
virtual Node\-Filter\-Impl $\ast$ {\bf handle} () const \label{classDOM_1_1NodeFilter_a5}

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

\item 
void {\bf set\-Custom\-Node\-Filter} ({\bf Custom\-Node\-Filter} $\ast$custom)\label{classDOM_1_1NodeFilter_a7}

\item 
{\bf Custom\-Node\-Filter} $\ast$ {\bf custom\-Node\-Filter} ()\label{classDOM_1_1NodeFilter_a8}

\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Node\-Filter} {\bf create\-Custom} ({\bf Custom\-Node\-Filter} $\ast$custom)\label{classDOM_1_1NodeFilter_e0}

\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
{\bf Node\-Filter} (Node\-Filter\-Impl $\ast$i)\label{classDOM_1_1NodeFilter_b0}

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

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf Node\-Iterator}\label{classDOM_1_1NodeFilter_n0}

\item 
class {\bf Node\-Iterator\-Impl}\label{classDOM_1_1NodeFilter_n1}

\item 
class {\bf Tree\-Walker}\label{classDOM_1_1NodeFilter_n2}

\item 
class {\bf Tree\-Walker\-Impl}\label{classDOM_1_1NodeFilter_n3}

\item 
class {\bf Node\-Filter\-Impl}\label{classDOM_1_1NodeFilter_n4}

\end{CompactItemize}


\subsection{Detailed Description}
Filters are objects that know how to \char`\"{}filter out\char`\"{} nodes. 

If an Iterator or {\tt  {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})} } is given a filter, before it returns the next node, it applies the filter. If the filter says to accept the node, the Iterator returns it; otherwise, the Iterator looks for the next node and pretends that the node that was rejected was not there.

The {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} does not provide any filters. Filter is just an interface that users can implement to provide their own filters.

Filters do not need to know how to iterate, nor do they need to know anything about the data structure that is being iterated. This makes it very easy to write filters, since the only thing they have to know how to do is evaluate a single node. One filter may be used with a number of different kinds of Iterators, encouraging code reuse.

To create your own cutsom {\bf Node\-Filter}{\rm (p.\,\pageref{classDOM_1_1NodeFilter})}, define a subclass of {\bf Custom\-Node\-Filter}{\rm (p.\,\pageref{classDOM_1_1CustomNodeFilter})} which overrides the {\bf accept\-Node()}{\rm (p.\,\pageref{classDOM_1_1NodeFilter_a4})} method and assign an instance of it to the {\bf Node\-Filter}{\rm (p.\,\pageref{classDOM_1_1NodeFilter})}. For more details see the {\bf Custom\-Node\-Filter}{\rm (p.\,\pageref{classDOM_1_1CustomNodeFilter})} class 



Definition at line 184 of file dom2\_\-traversal.h.

\subsection{Member Enumeration Documentation}
\index{DOM::NodeFilter@{DOM::Node\-Filter}!AcceptCode@{AcceptCode}}
\index{AcceptCode@{AcceptCode}!DOM::NodeFilter@{DOM::Node\-Filter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf DOM::Node\-Filter::Accept\-Code}}\label{classDOM_1_1NodeFilter_w16}


The following constants are returned by the {\bf accept\-Node()}{\rm (p.\,\pageref{classDOM_1_1NodeFilter_a4})} method:. 



Definition at line 203 of file dom2\_\-traversal.h.\index{DOM::NodeFilter@{DOM::Node\-Filter}!ShowCode@{ShowCode}}
\index{ShowCode@{ShowCode}!DOM::NodeFilter@{DOM::Node\-Filter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf DOM::Node\-Filter::Show\-Code}}\label{classDOM_1_1NodeFilter_w17}


These are the available values for the what\-To\-Show parameter. 

They are the same as the set of possible types for {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})}, and their values are derived by using a bit position corresponding to the value of Node\-Type for the equivalent node type. 

Definition at line 216 of file dom2\_\-traversal.h.

\subsection{Member Function Documentation}
\index{DOM::NodeFilter@{DOM::Node\-Filter}!acceptNode@{acceptNode}}
\index{acceptNode@{acceptNode}!DOM::NodeFilter@{DOM::Node\-Filter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}short Node\-Filter::accept\-Node (const {\bf Node} \& {\em n})\hspace{0.3cm}{\tt  [virtual]}}\label{classDOM_1_1NodeFilter_a4}


Test whether a specified node is visible in the logical view of a {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})} or {\bf Node\-Iterator}{\rm (p.\,\pageref{classDOM_1_1NodeIterator})}. 

This function will be called by the implementation of {\bf Tree\-Walker}{\rm (p.\,\pageref{classDOM_1_1TreeWalker})} and {\bf Node\-Iterator}{\rm (p.\,\pageref{classDOM_1_1NodeIterator})}; it is not intended to be called directly from user code.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em n}]The node to check to see if it passes the filter or not.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]a constant to determine whether the node is accepted, rejected, or skipped, as defined {\tt above } . \end{Desc}


Definition at line 167 of file dom2\_\-traversal.cpp.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
dom2\_\-traversal.h\item 
dom2\_\-traversal.cpp\end{CompactItemize}
