\section{DOM::Node Class Reference}
\label{classDOM_1_1Node}\index{DOM::Node@{DOM::Node}}
The {\tt {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})}} interface is the primary datatype for the entire {\bf Document}{\rm (p.\,\pageref{classDOM_1_1Document})} Object Model.  


{\tt \#include $<$dom\_\-node.h$>$}

Inheritance diagram for DOM::Node:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=141pt]{classDOM_1_1Node__inherit__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Node\-Type} \{ \par
{\bf ELEMENT\_\-NODE} =  1, 
{\bf ATTRIBUTE\_\-NODE} =  2, 
{\bf TEXT\_\-NODE} =  3, 
{\bf CDATA\_\-SECTION\_\-NODE} =  4, 
\par
{\bf ENTITY\_\-REFERENCE\_\-NODE} =  5, 
{\bf ENTITY\_\-NODE} =  6, 
{\bf PROCESSING\_\-INSTRUCTION\_\-NODE} =  7, 
{\bf COMMENT\_\-NODE} =  8, 
\par
{\bf DOCUMENT\_\-NODE} =  9, 
{\bf DOCUMENT\_\-TYPE\_\-NODE} =  10, 
{\bf DOCUMENT\_\-FRAGMENT\_\-NODE} =  11, 
{\bf NOTATION\_\-NODE} =  12
 \}
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Node} (const {\bf Node} \&other)\label{classDOM_1_1Node_a1}

\item 
{\bf Node} (Node\-Impl $\ast$\_\-impl)\label{classDOM_1_1Node_a2}

\item 
{\bf Node} \& {\bf operator=} (const {\bf Node} \&other)\label{classDOM_1_1Node_a3}

\item 
bool {\bf operator==} (const {\bf Node} \&other) const \label{classDOM_1_1Node_a4}

\item 
bool {\bf operator!=} (const {\bf Node} \&other) const \label{classDOM_1_1Node_a5}

\item 
{\bf DOMString} {\bf node\-Name} () const 
\item 
{\bf DOMString} {\bf node\-Value} () const 
\item 
void {\bf set\-Node\-Value} (const {\bf DOMString} \&)
\item 
unsigned short {\bf node\-Type} () const 
\item 
{\bf Node} {\bf parent\-Node} () const 
\item 
{\bf Node\-List} {\bf child\-Nodes} () const 
\item 
{\bf Node} {\bf first\-Child} () const 
\item 
{\bf Node} {\bf last\-Child} () const 
\item 
{\bf Node} {\bf previous\-Sibling} () const 
\item 
{\bf Node} {\bf next\-Sibling} () const 
\item 
{\bf Named\-Node\-Map} {\bf attributes} () const 
\item 
{\bf Document} {\bf owner\-Document} () const 
\item 
{\bf Node} {\bf insert\-Before} (const {\bf Node} \&new\-Child, const {\bf Node} \&ref\-Child)
\item 
{\bf Node} {\bf replace\-Child} (const {\bf Node} \&new\-Child, const {\bf Node} \&old\-Child)
\item 
{\bf Node} {\bf remove\-Child} (const {\bf Node} \&old\-Child)
\item 
{\bf Node} {\bf append\-Child} (const {\bf Node} \&new\-Child)
\item 
bool {\bf has\-Child\-Nodes} ()
\item 
{\bf Node} {\bf clone\-Node} (bool deep)
\item 
void {\bf normalize} ()
\item 
bool {\bf is\-Supported} (const {\bf DOMString} \&feature, const {\bf DOMString} \&version) const 
\item 
{\bf DOMString} {\bf namespace\-URI} () const 
\item 
{\bf DOMString} {\bf prefix} () const 
\item 
void {\bf set\-Prefix} (const {\bf DOMString} \&prefix)
\item 
{\bf DOMString} {\bf local\-Name} () const 
\item 
bool {\bf has\-Attributes} ()
\item 
void {\bf add\-Event\-Listener} (const {\bf DOMString} \&type, {\bf Event\-Listener} $\ast$listener, const bool use\-Capture)
\item 
void {\bf remove\-Event\-Listener} (const {\bf DOMString} \&type, {\bf Event\-Listener} $\ast$listener, bool use\-Capture)
\item 
bool {\bf dispatch\-Event} (const {\bf Event} \&evt)
\item 
Q\_\-UINT32 {\bf element\-Id} () const \label{classDOM_1_1Node_a35}

\item 
bool {\bf is\-Null} () const 
\item 
Node\-Impl $\ast$ {\bf handle} () const \label{classDOM_1_1Node_a37}

\item 
unsigned long {\bf index} () const \label{classDOM_1_1Node_a38}

\item 
{\bf QString} {\bf to\-HTML} () KDE\_\-DEPRECATED\label{classDOM_1_1Node_a39}

\item 
void {\bf apply\-Changes} ()\label{classDOM_1_1Node_a40}

\item 
void {\bf get\-Cursor} (int offset, int \&\_\-x, int \&\_\-y, int \&height) KDE\_\-DEPRECATED
\item 
{\bf QRect} {\bf get\-Rect} ()
\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
Node\-Impl $\ast$ {\bf impl}\label{classDOM_1_1Node_p0}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf Named\-Node\-Map}\label{classDOM_1_1Node_n0}

\item 
class {\bf Node\-List}\label{classDOM_1_1Node_n1}

\item 
class {\bf HTMLCollection}\label{classDOM_1_1Node_n2}

\item 
class {\bf Style\-Sheet}\label{classDOM_1_1Node_n3}

\end{CompactItemize}


\subsection{Detailed Description}
The {\tt {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})}} interface is the primary datatype for the entire {\bf Document}{\rm (p.\,\pageref{classDOM_1_1Document})} Object Model. 

It represents a single node in the document tree. While all objects implementing the {\tt {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})}} interface expose methods for dealing with children, not all objects implementing the {\tt {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})}} interface may have children. For example, {\tt {\bf Text}{\rm (p.\,\pageref{classDOM_1_1Text})}} nodes may not have children, and adding children to such nodes results in a {\tt {\bf DOMException}{\rm (p.\,\pageref{classDOM_1_1DOMException})}} being raised.

The attributes {\tt node\-Name} , {\tt node\-Value} and {\tt attributes} are included as a mechanism to get at node information without casting down to the specific derived interface. In cases where there is no obvious mapping of these attributes for a specific {\tt node\-Type} (e.g., {\tt node\-Value} for an {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})} or {\tt attributes} for a {\bf Comment}{\rm (p.\,\pageref{classDOM_1_1Comment})}), this returns {\tt null} . Note that the specialized interfaces may contain additional and more convenient mechanisms to get and set the relevant information. 



Definition at line 270 of file dom\_\-node.h.

\subsection{Member Enumeration Documentation}
\index{DOM::Node@{DOM::Node}!NodeType@{NodeType}}
\index{NodeType@{NodeType}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf DOM::Node::Node\-Type}}\label{classDOM_1_1Node_w12}


An integer indicating which type of node this is. 

The values of {\tt node\-Name}, {\tt node\-Value}, and {\tt attributes} vary according to the node type as follows: \begin{TabularC}{4}
\hline
&node\-Name &node\-Value &attributes  \\\hline
{\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})} &tag\-Name &null &{\bf Named\-Node\-Map}{\rm (p.\,\pageref{classDOM_1_1NamedNodeMap})}  \\\hline
{\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} &name of attribute &value of attribute &null  \\\hline
{\bf Text}{\rm (p.\,\pageref{classDOM_1_1Text})} &\#text &content of the text node &null  \\\hline
{\bf CDATASection}{\rm (p.\,\pageref{classDOM_1_1CDATASection})} &\#cdata-section &content of the CDATA Section &null  \\\hline
{\bf Entity\-Reference}{\rm (p.\,\pageref{classDOM_1_1EntityReference})} &name of entity referenced &null &null  \\\hline
{\bf Entity}{\rm (p.\,\pageref{classDOM_1_1Entity})} &entity name &null &null  \\\hline
{\bf Processing\-Instruction}{\rm (p.\,\pageref{classDOM_1_1ProcessingInstruction})} &target &entire content excluding the target &null  \\\hline
{\bf Comment}{\rm (p.\,\pageref{classDOM_1_1Comment})} &\#comment &content of the comment &null  \\\hline
{\bf Document}{\rm (p.\,\pageref{classDOM_1_1Document})} &\#document &null &null  \\\hline
{\bf Document\-Type}{\rm (p.\,\pageref{classDOM_1_1DocumentType})} &document type name &null &null  \\\hline
{\bf Document\-Fragment}{\rm (p.\,\pageref{classDOM_1_1DocumentFragment})} &\#document-fragment &null &null  \\\hline
{\bf Notation}{\rm (p.\,\pageref{classDOM_1_1Notation})} &notation name &null &null  \\\hline
\end{TabularC}


Definition at line 381 of file dom\_\-node.h.

\subsection{Member Function Documentation}
\index{DOM::Node@{DOM::Node}!nodeName@{nodeName}}
\index{nodeName@{nodeName}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} Node::node\-Name () const}\label{classDOM_1_1Node_a7}


The name of this node, depending on its type; see the table above. 



Definition at line 176 of file dom\_\-node.cpp.

Referenced by KHTMLPart::set\-Caret\-Position().\index{DOM::Node@{DOM::Node}!nodeValue@{nodeValue}}
\index{nodeValue@{nodeValue}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} Node::node\-Value () const}\label{classDOM_1_1Node_a8}


The value of this node, depending on its type; see the table above. 

\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em DOMException}]DOMSTRING\_\-SIZE\_\-ERR: Raised when it would return more characters than fit in a {\tt {\bf DOMString}{\rm (p.\,\pageref{classDOM_1_1DOMString})}} variable on the implementation platform. \end{description}
\end{Desc}


Definition at line 182 of file dom\_\-node.cpp.\index{DOM::Node@{DOM::Node}!setNodeValue@{setNodeValue}}
\index{setNodeValue@{setNodeValue}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Node::set\-Node\-Value (const {\bf DOMString} \&)}\label{classDOM_1_1Node_a9}


see node\-Value 

\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em DOMException}]NO\_\-MODIFICATION\_\-ALLOWED\_\-ERR: Raised when the node is readonly. \end{description}
\end{Desc}


Definition at line 189 of file dom\_\-node.cpp.\index{DOM::Node@{DOM::Node}!nodeType@{nodeType}}
\index{nodeType@{nodeType}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned short Node::node\-Type () const}\label{classDOM_1_1Node_a10}


A code representing the type of the underlying object, as defined above. 



Definition at line 199 of file dom\_\-node.cpp.

Referenced by KHTMLPart::selected\-Text().\index{DOM::Node@{DOM::Node}!parentNode@{parentNode}}
\index{parentNode@{parentNode}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Node::parent\-Node () const}\label{classDOM_1_1Node_a11}


The parent of this node. 

All nodes, except {\tt {\bf Document}{\rm (p.\,\pageref{classDOM_1_1Document})}} , {\tt {\bf Document\-Fragment}{\rm (p.\,\pageref{classDOM_1_1DocumentFragment})}} , and {\tt {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})}} may have a parent. However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this is {\tt null} . 

Definition at line 205 of file dom\_\-node.cpp.

Referenced by KHTMLPart::khtml\-Mouse\-Release\-Event(), DOM::Tree\-Walker::parent\-Node(), and KHTMLPart::selected\-Text().\index{DOM::Node@{DOM::Node}!childNodes@{childNodes}}
\index{childNodes@{childNodes}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node\-List} Node::child\-Nodes () const}\label{classDOM_1_1Node_a12}


A {\tt {\bf Node\-List}{\rm (p.\,\pageref{classDOM_1_1NodeList})}} that contains all children of this node. 

If there are no children, this is a {\tt {\bf Node\-List}{\rm (p.\,\pageref{classDOM_1_1NodeList})}} containing no nodes. The content of the returned {\tt {\bf Node\-List}{\rm (p.\,\pageref{classDOM_1_1NodeList})}} is ''live'' in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the {\tt {\bf Node\-List}{\rm (p.\,\pageref{classDOM_1_1NodeList})}} accessors; it is not a static snapshot of the content of the node. This is true for every {\tt {\bf Node\-List}{\rm (p.\,\pageref{classDOM_1_1NodeList})}} , including the ones returned by the {\tt get\-Elements\-By\-Tag\-Name} method. 

Definition at line 211 of file dom\_\-node.cpp.\index{DOM::Node@{DOM::Node}!firstChild@{firstChild}}
\index{firstChild@{firstChild}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Node::first\-Child () const}\label{classDOM_1_1Node_a13}


The first child of this node. 

If there is no such node, this returns {\tt null} . 

Definition at line 217 of file dom\_\-node.cpp.

Referenced by DOM::Tree\-Walker::first\-Child(), KHTMLPart::khtml\-Mouse\-Release\-Event(), and KHTMLPart::selected\-Text().\index{DOM::Node@{DOM::Node}!lastChild@{lastChild}}
\index{lastChild@{lastChild}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Node::last\-Child () const}\label{classDOM_1_1Node_a14}


The last child of this node. 

If there is no such node, this returns {\tt null} . 

Definition at line 223 of file dom\_\-node.cpp.

Referenced by DOM::Tree\-Walker::last\-Child().\index{DOM::Node@{DOM::Node}!previousSibling@{previousSibling}}
\index{previousSibling@{previousSibling}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Node::previous\-Sibling () const}\label{classDOM_1_1Node_a15}


The node immediately preceding this node. 

If there is no such node, this returns {\tt null} . 

Definition at line 229 of file dom\_\-node.cpp.

Referenced by DOM::Tree\-Walker::previous\-Sibling().\index{DOM::Node@{DOM::Node}!nextSibling@{nextSibling}}
\index{nextSibling@{nextSibling}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Node::next\-Sibling () const}\label{classDOM_1_1Node_a16}


The node immediately following this node. 

If there is no such node, this returns {\tt null} . 

Definition at line 235 of file dom\_\-node.cpp.

Referenced by KHTMLPart::khtml\-Mouse\-Release\-Event(), DOM::Tree\-Walker::next\-Sibling(), and KHTMLPart::selected\-Text().\index{DOM::Node@{DOM::Node}!attributes@{attributes}}
\index{attributes@{attributes}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Named\-Node\-Map} Node::attributes () const}\label{classDOM_1_1Node_a17}


A {\tt {\bf Named\-Node\-Map}{\rm (p.\,\pageref{classDOM_1_1NamedNodeMap})}} containing the attributes of this node (if it is an {\tt {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})}} ) or {\tt null} otherwise. 



Definition at line 241 of file dom\_\-node.cpp.

Referenced by DOM::Element::has\-Attribute(), DOM::Element::has\-Attribute\-NS(), has\-Attributes(), DOM::Element::remove\-Attribute\-Node(), DOM::Element::set\-Attribute\-Node(), and DOM::Element::set\-Attribute\-Node\-NS().\index{DOM::Node@{DOM::Node}!ownerDocument@{ownerDocument}}
\index{ownerDocument@{ownerDocument}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Document} Node::owner\-Document () const}\label{classDOM_1_1Node_a18}


The {\tt {\bf Document}{\rm (p.\,\pageref{classDOM_1_1Document})}} object associated with this node. 

This is also the {\tt {\bf Document}{\rm (p.\,\pageref{classDOM_1_1Document})}} object used to create new nodes. When this node is a {\tt {\bf Document}{\rm (p.\,\pageref{classDOM_1_1Document})}} this is {\tt null} . 

Definition at line 247 of file dom\_\-node.cpp.\index{DOM::Node@{DOM::Node}!insertBefore@{insertBefore}}
\index{insertBefore@{insertBefore}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Node::insert\-Before (const {\bf Node} \& {\em new\-Child}, const {\bf Node} \& {\em ref\-Child})}\label{classDOM_1_1Node_a19}


Inserts the node {\tt new\-Child} before the existing child node {\tt ref\-Child} . 

If {\tt ref\-Child} is {\tt null} , insert {\tt new\-Child} at the end of the list of children.

If {\tt new\-Child} is a {\tt {\bf Document\-Fragment}{\rm (p.\,\pageref{classDOM_1_1DocumentFragment})}} object, all of its children are inserted, in the same order, before {\tt ref\-Child} . If the {\tt new\-Child} is already in the tree, it is first removed.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em new\-Child}]The node to insert.\item[{\em ref\-Child}]The reference node, i.e., the node before which the new node must be inserted.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The node being inserted.\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em DOMException}]HIERARCHY\_\-REQUEST\_\-ERR: Raised if this node is of a type that does not allow children of the type of the {\tt new\-Child} node, or if the node to insert is one of this node's ancestors.\end{description}
\end{Desc}
WRONG\_\-DOCUMENT\_\-ERR: Raised if {\tt new\-Child} was created from a different document than the one that created this node.

NO\_\-MODIFICATION\_\-ALLOWED\_\-ERR: Raised if this node is readonly.

NOT\_\-FOUND\_\-ERR: Raised if {\tt ref\-Child} is not a child of this node. 

Definition at line 258 of file dom\_\-node.cpp.

References impl.\index{DOM::Node@{DOM::Node}!replaceChild@{replaceChild}}
\index{replaceChild@{replaceChild}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Node::replace\-Child (const {\bf Node} \& {\em new\-Child}, const {\bf Node} \& {\em old\-Child})}\label{classDOM_1_1Node_a20}


Replaces the child node {\tt old\-Child} with {\tt new\-Child} in the list of children, and returns the {\tt old\-Child} node. 

If the {\tt new\-Child} is already in the tree, it is first removed.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em new\-Child}]The new node to put in the child list.\item[{\em old\-Child}]The node being replaced in the list.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The node replaced.\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em DOMException}]HIERARCHY\_\-REQUEST\_\-ERR: Raised if this node is of a type that does not allow children of the type of the {\tt new\-Child} node, or it the node to put in is one of this node's ancestors.\end{description}
\end{Desc}
WRONG\_\-DOCUMENT\_\-ERR: Raised if {\tt new\-Child} was created from a different document than the one that created this node.

NO\_\-MODIFICATION\_\-ALLOWED\_\-ERR: Raised if this node is readonly.

NOT\_\-FOUND\_\-ERR: Raised if {\tt old\-Child} is not a child of this node. 

Definition at line 269 of file dom\_\-node.cpp.

References impl.\index{DOM::Node@{DOM::Node}!removeChild@{removeChild}}
\index{removeChild@{removeChild}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Node::remove\-Child (const {\bf Node} \& {\em old\-Child})}\label{classDOM_1_1Node_a21}


Removes the child node indicated by {\tt old\-Child} from the list of children, and returns it. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em old\-Child}]The node being removed.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The node removed.\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em DOMException}]NO\_\-MODIFICATION\_\-ALLOWED\_\-ERR: Raised if this node is readonly.\end{description}
\end{Desc}
NOT\_\-FOUND\_\-ERR: Raised if {\tt old\-Child} is not a child of this node. 

Definition at line 280 of file dom\_\-node.cpp.\index{DOM::Node@{DOM::Node}!appendChild@{appendChild}}
\index{appendChild@{appendChild}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Node::append\-Child (const {\bf Node} \& {\em new\-Child})}\label{classDOM_1_1Node_a22}


Adds the node {\tt new\-Child} to the end of the list of children of this node. 

If the {\tt new\-Child} is already in the tree, it is first removed.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em new\-Child}]The node to add.\end{description}
\end{Desc}
If it is a {\tt {\bf Document\-Fragment}{\rm (p.\,\pageref{classDOM_1_1DocumentFragment})}} object, the entire contents of the document fragment are moved into the child list of this node

\begin{Desc}
\item[Returns:]The node added.\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em DOMException}]HIERARCHY\_\-REQUEST\_\-ERR: Raised if this node is of a type that does not allow children of the type of the {\tt new\-Child} node, or if the node to append is one of this node's ancestors.\end{description}
\end{Desc}
WRONG\_\-DOCUMENT\_\-ERR: Raised if {\tt new\-Child} was created from a different document than the one that created this node.

NO\_\-MODIFICATION\_\-ALLOWED\_\-ERR: Raised if this node is readonly. 

Definition at line 290 of file dom\_\-node.cpp.

References impl.\index{DOM::Node@{DOM::Node}!hasChildNodes@{hasChildNodes}}
\index{hasChildNodes@{hasChildNodes}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Node::has\-Child\-Nodes ()}\label{classDOM_1_1Node_a23}


This is a convenience method to allow easy determination of whether a node has any children. 

\begin{Desc}
\item[Returns:]{\tt true} if the node has any children, {\tt false} if the node has no children. \end{Desc}


Definition at line 309 of file dom\_\-node.cpp.\index{DOM::Node@{DOM::Node}!cloneNode@{cloneNode}}
\index{cloneNode@{cloneNode}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} Node::clone\-Node (bool {\em deep})}\label{classDOM_1_1Node_a24}


Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. 

The duplicate node has no parent ( {\tt parent\-Node} returns {\tt null} .).

Cloning an {\tt {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})}} copies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any text it contains unless it is a deep clone, since the text is contained in a child {\tt {\bf Text}{\rm (p.\,\pageref{classDOM_1_1Text})}} node. Cloning any other type of node simply returns a copy of this node.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em deep}]If {\tt true} , recursively clone the subtree under the specified node; if {\tt false} , clone only the node itself (and its attributes, if it is an {\tt {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})}} ).\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The duplicate node. \end{Desc}


Definition at line 315 of file dom\_\-node.cpp.\index{DOM::Node@{DOM::Node}!normalize@{normalize}}
\index{normalize@{normalize}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Node::normalize ()}\label{classDOM_1_1Node_a25}


Modified in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2. 

Puts all {\bf Text}{\rm (p.\,\pageref{classDOM_1_1Text})} nodes in the full depth of the sub-tree underneath this {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})}, including attribute nodes, into a \char`\"{}normal\char`\"{} form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates {\bf Text}{\rm (p.\,\pageref{classDOM_1_1Text})} nodes, i.e., there are neither adjacent {\bf Text}{\rm (p.\,\pageref{classDOM_1_1Text})} nodes nor empty {\bf Text}{\rm (p.\,\pageref{classDOM_1_1Text})} nodes. This can be used to ensure that the {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} view of a document is the same as if it were saved and re-loaded, and is useful when operations (such as XPointer [XPointer] lookups) that depend on a particular document tree structure are to be used.

Note: In cases where the document contains CDATASections, the normalize operation alone may not be sufficient, since XPointers do not differentiate between {\bf Text}{\rm (p.\,\pageref{classDOM_1_1Text})} nodes and {\bf CDATASection}{\rm (p.\,\pageref{classDOM_1_1CDATASection})} nodes. 

Definition at line 321 of file dom\_\-node.cpp.\index{DOM::Node@{DOM::Node}!isSupported@{isSupported}}
\index{isSupported@{isSupported}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Node::is\-Supported (const {\bf DOMString} \& {\em feature}, const {\bf DOMString} \& {\em version}) const}\label{classDOM_1_1Node_a26}


Introduced in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2. 

Tests whether the {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} implementation implements a specific feature and that feature is supported by this node.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em feature}]The name of the feature to test. This is the same name which can be passed to the method has\-Feature on {\bf DOMImplementation}{\rm (p.\,\pageref{classDOM_1_1DOMImplementation})}.\item[{\em version}]This is the version number of the feature to test. In Level 2, version 1, this is the string \char`\"{}2.0\char`\"{}. If the version is not specified, supporting any version of the feature will cause the method to return true.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Returns true if the specified feature is supported on this node, false otherwise. \end{Desc}


Definition at line 327 of file dom\_\-node.cpp.\index{DOM::Node@{DOM::Node}!namespaceURI@{namespaceURI}}
\index{namespaceURI@{namespaceURI}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} Node::namespace\-URI () const}\label{classDOM_1_1Node_a27}


Introduced in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2. 

The namespace URI of this node, or null if it is unspecified. This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is merely the namespace URI given at creation time. For nodes of any type other than ELEMENT\_\-NODE and ATTRIBUTE\_\-NODE and nodes created with a {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 1 method, such as create\-Element from the {\bf Document}{\rm (p.\,\pageref{classDOM_1_1Document})} interface, this is always null.

Note: Per the Namespaces in XML Specification [Namespaces] an attribute does not inherit its namespace from the element it is attached to. If an attribute is not explicitly given a namespace, it simply has no namespace. 

Definition at line 336 of file dom\_\-node.cpp.\index{DOM::Node@{DOM::Node}!prefix@{prefix}}
\index{prefix@{prefix}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} Node::prefix () const}\label{classDOM_1_1Node_a28}


Introduced in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2. 

The namespace prefix of this node, or null if it is unspecified. Note that setting this attribute, when permitted, changes the node\-Name attribute, which holds the qualified name, as well as the tag\-Name and name attributes of the {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})} and {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} interfaces, when applicable. Note also that changing the prefix of an attribute that is known to have a default value, does not make a new attribute with the default value and the original prefix appear, since the namespace\-URI and local\-Name do not change. For nodes of any type other than ELEMENT\_\-NODE and ATTRIBUTE\_\-NODE and nodes created with a {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 1 method, such as create\-Element from the {\bf Document}{\rm (p.\,\pageref{classDOM_1_1Document})} interface, this is always null. 

Definition at line 342 of file dom\_\-node.cpp.

Referenced by set\-Prefix().\index{DOM::Node@{DOM::Node}!setPrefix@{setPrefix}}
\index{setPrefix@{setPrefix}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Node::set\-Prefix (const {\bf DOMString} \& {\em prefix})}\label{classDOM_1_1Node_a29}


see prefix 

\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em DOMException}]INVALID\_\-CHARACTER\_\-ERR: Raised if the specified prefix contains an illegal character.\end{description}
\end{Desc}
NO\_\-MODIFICATION\_\-ALLOWED\_\-ERR: Raised if this node is readonly.

NAMESPACE\_\-ERR: Raised if the specified prefix is malformed, if the namespace\-URI of this node is null, if the specified prefix is \char`\"{}xml\char`\"{} and the namespace\-URI of this node is different from \char`\"{}http://www.w3.org/XML/1998/namespace\char`\"{}, if this node is an attribute and the specified prefix is \char`\"{}xmlns\char`\"{} and the namespace\-URI of this node is different from \char`\"{}http://www.w3.org/2000/xmlns/\char`\"{}, or if this node is an attribute and the qualified\-Name of this node is \char`\"{}xmlns\char`\"{} [Namespaces]. 

Definition at line 348 of file dom\_\-node.cpp.

References prefix().\index{DOM::Node@{DOM::Node}!localName@{localName}}
\index{localName@{localName}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} Node::local\-Name () const}\label{classDOM_1_1Node_a30}


Introduced in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2. 

Returns the local part of the qualified name of this node. For nodes of any type other than ELEMENT\_\-NODE and ATTRIBUTE\_\-NODE and nodes created with a {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 1 method, such as create\-Element from the {\bf Document}{\rm (p.\,\pageref{classDOM_1_1Document})} interface, this is always null. 

Definition at line 357 of file dom\_\-node.cpp.\index{DOM::Node@{DOM::Node}!hasAttributes@{hasAttributes}}
\index{hasAttributes@{hasAttributes}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Node::has\-Attributes ()}\label{classDOM_1_1Node_a31}


Returns whether this node (if it is an element) has any attributes. 

\begin{Desc}
\item[Returns:]a boolean. True if this node has any attributes, false otherwise. Introduced in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2 \end{Desc}


Definition at line 301 of file dom\_\-node.cpp.

References attributes(), and DOM::Named\-Node\-Map::length().\index{DOM::Node@{DOM::Node}!addEventListener@{addEventListener}}
\index{addEventListener@{addEventListener}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Node::add\-Event\-Listener (const {\bf DOMString} \& {\em type}, {\bf Event\-Listener} $\ast$ {\em listener}, const bool {\em use\-Capture})}\label{classDOM_1_1Node_a32}


Introduced in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2 This method is from the Event\-Target interface. 

This method allows the registration of event listeners on the event target. If an {\bf Event\-Listener}{\rm (p.\,\pageref{classDOM_1_1EventListener})} is added to an Event\-Target while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase.

If multiple identical Event\-Listeners are registered on the same Event\-Target with the same parameters the duplicate instances are discarded. They do not cause the {\bf Event\-Listener}{\rm (p.\,\pageref{classDOM_1_1EventListener})} to be called twice and since they are discarded they do not need to be removed with the remove\-Event\-Listener method. Parameters

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]The event type for which the user is registering\item[{\em listener}]The listener parameter takes an interface implemented by the user which contains the methods to be called when the event occurs.\item[{\em use\-Capture}]If true, use\-Capture indicates that the user wishes to initiate capture. After initiating capture, all events of the specified type will be dispatched to the registered {\bf Event\-Listener}{\rm (p.\,\pageref{classDOM_1_1EventListener})} before being dispatched to any Event\-Targets beneath them in the tree. Events which are bubbling upward through the tree will not trigger an {\bf Event\-Listener}{\rm (p.\,\pageref{classDOM_1_1EventListener})} designated to use capture. \end{description}
\end{Desc}


Definition at line 363 of file dom\_\-node.cpp.\index{DOM::Node@{DOM::Node}!removeEventListener@{removeEventListener}}
\index{removeEventListener@{removeEventListener}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Node::remove\-Event\-Listener (const {\bf DOMString} \& {\em type}, {\bf Event\-Listener} $\ast$ {\em listener}, bool {\em use\-Capture})}\label{classDOM_1_1Node_a33}


Introduced in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2 This method is from the Event\-Target interface. 

This method allows the removal of event listeners from the event target. If an {\bf Event\-Listener}{\rm (p.\,\pageref{classDOM_1_1EventListener})} is removed from an Event\-Target while it is processing an event, it will not be triggered by the current actions.

Event\-Listeners can never be invoked after being removed.

Calling remove\-Event\-Listener with arguments which do not identify any currently registered {\bf Event\-Listener}{\rm (p.\,\pageref{classDOM_1_1EventListener})} on the Event\-Target has no effect.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]Specifies the event type of the {\bf Event\-Listener}{\rm (p.\,\pageref{classDOM_1_1EventListener})} being removed.\item[{\em listener}]The {\bf Event\-Listener}{\rm (p.\,\pageref{classDOM_1_1EventListener})} parameter indicates the {\bf Event\-Listener}{\rm (p.\,\pageref{classDOM_1_1EventListener})} to be removed.\item[{\em use\-Capture}]Specifies whether the {\bf Event\-Listener}{\rm (p.\,\pageref{classDOM_1_1EventListener})} being removed was registered as a capturing listener or not. If a listener was registered twice, one with capture and one without, each must be removed separately. Removal of a capturing listener does not affect a non-capturing version of the same listener, and vice versa. \end{description}
\end{Desc}


Definition at line 372 of file dom\_\-node.cpp.\index{DOM::Node@{DOM::Node}!dispatchEvent@{dispatchEvent}}
\index{dispatchEvent@{dispatchEvent}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Node::dispatch\-Event (const {\bf Event} \& {\em evt})}\label{classDOM_1_1Node_a34}


Introduced in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2 This method is from the Event\-Target interface. 

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the Event\-Target on which dispatch\-Event is called.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em evt}]Specifies the event type, behavior, and contextual information to be used in processing the event.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The return value of dispatch\-Event indicates whether any of the listeners which handled the event called prevent\-Default. If prevent\-Default was called the value is false, else the value is true.\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em Event\-Exception}]UNSPECIFIED\_\-EVENT\_\-TYPE\_\-ERR: Raised if the Event's type was not specified by initializing the event before dispatch\-Event was called. Specification of the Event's type as null or an empty string will also trigger this exception. \end{description}
\end{Desc}


Definition at line 380 of file dom\_\-node.cpp.\index{DOM::Node@{DOM::Node}!isNull@{isNull}}
\index{isNull@{isNull}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool DOM::Node::is\-Null () const\hspace{0.3cm}{\tt  [inline]}}\label{classDOM_1_1Node_a36}


tests if this {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})} is 0. 

Useful especially, if casting to a derived class:



\footnotesize\begin{verbatim} Node n = .....;
 // try to convert into an Element:
 Element e = n;
 if( e.isNull() )
   kdDebug(300) << "node isn't an element node" << endl;
\end{verbatim}
\normalsize
 

Definition at line 858 of file dom\_\-node.h.

Referenced by KHTMLPart::khtml\-Mouse\-Double\-Click\-Event(), KHTMLPart::khtml\-Mouse\-Move\-Event(), KHTMLPart::khtml\-Mouse\-Press\-Event(), KHTMLPart::khtml\-Mouse\-Release\-Event(), and KHTMLPart::selected\-Text().\index{DOM::Node@{DOM::Node}!getCursor@{getCursor}}
\index{getCursor@{getCursor}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Node::get\-Cursor (int {\em offset}, int \& {\em \_\-x}, int \& {\em \_\-y}, int \& {\em height})}\label{classDOM_1_1Node_a41}


\begin{Desc}
\item[{\bf Deprecated}]without substitution since 3.2 \end{Desc}


Definition at line 420 of file dom\_\-node.cpp.\index{DOM::Node@{DOM::Node}!getRect@{getRect}}
\index{getRect@{getRect}!DOM::Node@{DOM::Node}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QRect} Node::get\-Rect ()}\label{classDOM_1_1Node_a42}


not part of the {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})}. 

\begin{Desc}
\item[Returns:]the exact coordinates and size of this element. \end{Desc}


Definition at line 427 of file dom\_\-node.cpp.

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