\section{DOM::Element Class Reference}
\label{classDOM_1_1Element}\index{DOM::Element@{DOM::Element}}
By far the vast majority of objects (apart from text) that authors encounter when traversing a document are {\tt  {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})} } nodes.  


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

Inheritance diagram for DOM::Element:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=77pt]{classDOM_1_1Element__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for DOM::Element:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=59pt]{classDOM_1_1Element__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Element} (const  {\bf Node} \&other)\label{classDOM_1_1Element_a1}

\item 
{\bf Element} (const  {\bf Element} \&other)\label{classDOM_1_1Element_a2}

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

\item 
{\bf Element} \& {\bf operator=} (const  {\bf Element} \&other)\label{classDOM_1_1Element_a4}

\item 
{\bf DOMString} {\bf tag\-Name} () const 
\begin{CompactList}\small\item\em The name of the element. \item\end{CompactList}\item 
{\bf DOMString} {\bf get\-Attribute} (const  {\bf DOMString} \&name)
\begin{CompactList}\small\item\em Retrieves an attribute value by name. \item\end{CompactList}\item 
void {\bf set\-Attribute} (const  {\bf DOMString} \&name, const  {\bf DOMString} \&value)
\begin{CompactList}\small\item\em Adds a new attribute. \item\end{CompactList}\item 
void {\bf remove\-Attribute} (const  {\bf DOMString} \&name)
\begin{CompactList}\small\item\em Removes an attribute by name. \item\end{CompactList}\item 
{\bf Attr} {\bf get\-Attribute\-Node} (const  {\bf DOMString} \&name)
\begin{CompactList}\small\item\em Retrieves an {\tt  {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} } node by name. \item\end{CompactList}\item 
{\bf Attr} {\bf set\-Attribute\-Node} (const  {\bf Attr} \&new\-Attr)
\begin{CompactList}\small\item\em Adds a new attribute. \item\end{CompactList}\item 
{\bf Attr} {\bf remove\-Attribute\-Node} (const  {\bf Attr} \&old\-Attr)
\begin{CompactList}\small\item\em Removes the specified attribute. \item\end{CompactList}\item 
{\bf Node\-List} {\bf get\-Elements\-By\-Tag\-Name} (const  {\bf DOMString} \&name)
\begin{CompactList}\small\item\em Returns a {\tt  {\bf Node\-List}{\rm (p.\,\pageref{classDOM_1_1NodeList})} } of all descendant elements with a given tag name, in the order in which they would be encountered in a preorder traversal of the {\tt  {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})} } tree. \item\end{CompactList}\item 
{\bf Node\-List} {\bf get\-Elements\-By\-Tag\-Name\-NS} (const  {\bf DOMString} \&namespace\-URI, const  {\bf DOMString} \&local\-Name)
\begin{CompactList}\small\item\em Introduced in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2 Returns a {\bf Node\-List}{\rm (p.\,\pageref{classDOM_1_1NodeList})} of all the descendant Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of this {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})} tree. \item\end{CompactList}\item 
{\bf DOMString} {\bf get\-Attribute\-NS} (const  {\bf DOMString} \&namespace\-URI, const  {\bf DOMString} \&local\-Name)
\begin{CompactList}\small\item\em Introduced in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2. \item\end{CompactList}\item 
void {\bf set\-Attribute\-NS} (const  {\bf DOMString} \&namespace\-URI, const  {\bf DOMString} \&qualified\-Name, const  {\bf DOMString} \&value)
\begin{CompactList}\small\item\em Introduced in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2. \item\end{CompactList}\item 
void {\bf remove\-Attribute\-NS} (const  {\bf DOMString} \&namespace\-URI, const  {\bf DOMString} \&local\-Name)
\begin{CompactList}\small\item\em Introduced in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2. \item\end{CompactList}\item 
{\bf Attr} {\bf get\-Attribute\-Node\-NS} (const  {\bf DOMString} \&namespace\-URI, const  {\bf DOMString} \&local\-Name)
\begin{CompactList}\small\item\em Introduced in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2. \item\end{CompactList}\item 
{\bf Attr} {\bf set\-Attribute\-Node\-NS} (const  {\bf Attr} \&new\-Attr)
\begin{CompactList}\small\item\em Introduced in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2. \item\end{CompactList}\item 
bool {\bf has\-Attribute} (const  {\bf DOMString} \&name)
\begin{CompactList}\small\item\em Returns true when an attribute with a given name is specified on this element or has a default value, false otherwise. \item\end{CompactList}\item 
bool {\bf has\-Attribute\-NS} (const  {\bf DOMString} \&namespace\-URI, const  {\bf DOMString} \&local\-Name)
\begin{CompactList}\small\item\em Introduced in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2. \item\end{CompactList}\item 
{\bf CSSStyle\-Declaration} {\bf style} ()
\begin{CompactList}\small\item\em Introduced in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2 This method is from the {\bf CSSStyle\-Declaration}{\rm (p.\,\pageref{classDOM_1_1CSSStyleDeclaration})} interface. \item\end{CompactList}\item 
bool {\bf is\-HTMLElement} () const \label{classDOM_1_1Element_a23}

\item 
{\bf Element} {\bf form} () const 
\begin{CompactList}\small\item\em KHTML extension to {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} This method returns the associated form element. \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
bool {\bf khtml\-Valid\-Attr\-Name} (const  {\bf DOMString} \&name)\label{classDOM_1_1Element_e0}

\item 
bool {\bf khtml\-Valid\-Prefix} (const  {\bf DOMString} \&name)\label{classDOM_1_1Element_e1}

\item 
bool {\bf khtml\-Valid\-Qualified\-Name} (const  {\bf DOMString} \&name)\label{classDOM_1_1Element_e2}

\item 
bool {\bf khtml\-Malformed\-Qualified\-Name} (const  {\bf DOMString} \&name)\label{classDOM_1_1Element_e3}

\item 
bool {\bf khtml\-Malformed\-Prefix} (const  {\bf DOMString} \&name)\label{classDOM_1_1Element_e4}

\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
{\bf Element} (Element\-Impl $\ast$\_\-impl)\label{classDOM_1_1Element_b0}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf Document}\label{classDOM_1_1Element_n0}

\item 
class {\bf HTMLDocument}\label{classDOM_1_1Element_n1}

\item 
class {\bf Attr}\label{classDOM_1_1Element_n2}

\end{CompactItemize}


\subsection{Detailed Description}
By far the vast majority of objects (apart from text) that authors encounter when traversing a document are {\tt  {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})} } nodes. 

Assume the following XML document: $<$element\-Example id=''demo''$>$ $<$subelement1/$>$ $<$subelement2$>$$<$subsubelement/$>$$<$/subelement2$>$ $<$/element\-Example$>$

When represented using {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})}, the top node is an {\tt  {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})} } node for ''element\-Example'', which contains two child {\tt  {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})} } nodes, one for ''subelement1'' and one for ''subelement2''. ''subelement1'' contains no child nodes.

Elements may have attributes associated with them; since the {\tt  {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})} } interface inherits from {\tt  {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})} } , the generic {\tt  {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})} } interface method {\tt  get\-Attributes } may be used to retrieve the set of all attributes for an element. There are methods on the {\tt  {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})} } interface to retrieve either an {\tt  {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} } object by name or an attribute value by name. In XML, where an attribute value may contain entity references, an {\tt  {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} } object should be retrieved to examine the possibly fairly complex sub-tree representing the attribute value. On the other hand, in HTML, where all attributes have simple string values, methods to directly access an attribute value can safely be used as a convenience. 



Definition at line 207 of file dom\_\-element.h.

\subsection{Member Function Documentation}
\index{DOM::Element@{DOM::Element}!tagName@{tagName}}
\index{tagName@{tagName}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} Element::tag\-Name () const}\label{classDOM_1_1Element_a6}


The name of the element. 

For example, in: $<$element\-Example id=''demo''$>$ ... $<$/element\-Example$>$ , {\tt  tag\-Name } has the value {\tt  ''element\-Example'' } . Note that this is case-preserving in XML, as are all of the operations of the {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})}. The HTML {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} returns the {\tt  tag\-Name } of an HTML element in the canonical uppercase form, regardless of the case in the source HTML document. 

Definition at line 145 of file dom\_\-element.cpp.\index{DOM::Element@{DOM::Element}!getAttribute@{getAttribute}}
\index{getAttribute@{getAttribute}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} Element::get\-Attribute (const {\bf DOMString} \& {\em name})}\label{classDOM_1_1Element_a7}


Retrieves an attribute value by name. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]The name of the attribute to retrieve.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The {\tt  {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} } value as a string, or the empty string if that attribute does not have a specified or default value. \end{Desc}


Definition at line 151 of file dom\_\-element.cpp.

References get\-Attribute\-NS(), and KStd\-Accel::name().\index{DOM::Element@{DOM::Element}!setAttribute@{setAttribute}}
\index{setAttribute@{setAttribute}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Element::set\-Attribute (const {\bf DOMString} \& {\em name}, const {\bf DOMString} \& {\em value})}\label{classDOM_1_1Element_a8}


Adds a new attribute. 

If an attribute with that name is already present in the element, its value is changed to be that of the value parameter. This value is a simple string, it is not parsed as it is being set. So any markup (such as syntax to be recognized as an entity reference) is treated as literal text, and needs to be appropriately escaped by the implementation when it is written out. In order to assign an attribute value that contains entity references, the user must create an {\tt  {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} } node plus any {\tt  {\bf Text}{\rm (p.\,\pageref{classDOM_1_1Text})} } and {\tt  {\bf Entity\-Reference}{\rm (p.\,\pageref{classDOM_1_1EntityReference})} } nodes, build the appropriate subtree, and use {\tt  set\-Attribute\-Node } to assign it as the value of an attribute.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]The name of the attribute to create or alter.\item[{\em value}]Value to set in string form.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em DOMException}]INVALID\_\-CHARACTER\_\-ERR: Raised if the specified name contains an invalid character.\end{description}
\end{Desc}
NO\_\-MODIFICATION\_\-ALLOWED\_\-ERR: Raised if this node is readonly. 

Definition at line 156 of file dom\_\-element.cpp.

References KStd\-Accel::name(), and set\-Attribute\-NS().\index{DOM::Element@{DOM::Element}!removeAttribute@{removeAttribute}}
\index{removeAttribute@{removeAttribute}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Element::remove\-Attribute (const {\bf DOMString} \& {\em name})}\label{classDOM_1_1Element_a9}


Removes an attribute by name. 

If the removed attribute has a default value it is immediately replaced.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]The name of the attribute to remove.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]\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}


Definition at line 161 of file dom\_\-element.cpp.

References KStd\-Accel::name(), and remove\-Attribute\-NS().\index{DOM::Element@{DOM::Element}!getAttributeNode@{getAttributeNode}}
\index{getAttributeNode@{getAttributeNode}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Attr} Element::get\-Attribute\-Node (const {\bf DOMString} \& {\em name})}\label{classDOM_1_1Element_a10}


Retrieves an {\tt  {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} } node by name. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]The name of the attribute to retrieve.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The {\tt  {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} } node with the specified attribute name or {\tt  null } if there is no such attribute. \end{Desc}


Definition at line 166 of file dom\_\-element.cpp.

References get\-Attribute\-Node\-NS(), and KStd\-Accel::name().\index{DOM::Element@{DOM::Element}!setAttributeNode@{setAttributeNode}}
\index{setAttributeNode@{setAttributeNode}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Attr} Element::set\-Attribute\-Node (const {\bf Attr} \& {\em new\-Attr})}\label{classDOM_1_1Element_a11}


Adds a new attribute. 

If an attribute with that name is already present in the element, it is replaced by the new one.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em new\-Attr}]The {\tt  {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} } node to add to the attribute list.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]If the {\tt  new\-Attr } attribute replaces an existing attribute with the same name, the previously existing {\tt  {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} } node is returned, otherwise {\tt  null } is returned.\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em DOMException}]WRONG\_\-DOCUMENT\_\-ERR: Raised if {\tt  new\-Attr } was created from a different document than the one that created the element.\end{description}
\end{Desc}
NO\_\-MODIFICATION\_\-ALLOWED\_\-ERR: Raised if this node is readonly.

INUSE\_\-ATTRIBUTE\_\-ERR: Raised if {\tt  new\-Attr } is already an attribute of another {\tt  {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})} } object. The {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} user must explicitly clone {\tt  {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} } nodes to re-use them in other elements. 

Definition at line 171 of file dom\_\-element.cpp.

References set\-Attribute\-Node\-NS().\index{DOM::Element@{DOM::Element}!removeAttributeNode@{removeAttributeNode}}
\index{removeAttributeNode@{removeAttributeNode}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Attr} Element::remove\-Attribute\-Node (const {\bf Attr} \& {\em old\-Attr})}\label{classDOM_1_1Element_a12}


Removes the specified attribute. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em old\-Attr}]The {\tt  {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} } node to remove from the attribute list. If the removed {\tt  {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} } has a default value it is immediately replaced.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The {\tt  {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} } node that was 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\-Attr } is not an attribute of the element. 

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

References DOM::Node::handle(), DOM::Node::is\-Null(), and DOM::Attr::owner\-Element().\index{DOM::Element@{DOM::Element}!getElementsByTagName@{getElementsByTagName}}
\index{getElementsByTagName@{getElementsByTagName}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node\-List} Element::get\-Elements\-By\-Tag\-Name (const {\bf DOMString} \& {\em name})}\label{classDOM_1_1Element_a13}


Returns a {\tt  {\bf Node\-List}{\rm (p.\,\pageref{classDOM_1_1NodeList})} } of all descendant elements with a given tag name, in the order in which they would be encountered in a preorder traversal of the {\tt  {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})} } tree. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]The name of the tag to match on. The special value \char`\"{}$\ast$\char`\"{} matches all tags.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A list of matching {\tt  {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})} } nodes. \end{Desc}


Definition at line 192 of file dom\_\-element.cpp.

References get\-Elements\-By\-Tag\-Name\-NS(), and KStd\-Accel::name().\index{DOM::Element@{DOM::Element}!getElementsByTagNameNS@{getElementsByTagNameNS}}
\index{getElementsByTagNameNS@{getElementsByTagNameNS}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node\-List} Element::get\-Elements\-By\-Tag\-Name\-NS (const {\bf DOMString} \& {\em namespace\-URI}, const {\bf DOMString} \& {\em local\-Name})}\label{classDOM_1_1Element_a14}


Introduced in {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} Level 2 Returns a {\bf Node\-List}{\rm (p.\,\pageref{classDOM_1_1NodeList})} of all the descendant Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of this {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})} tree. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em namespace\-URI}]The namespace URI of the elements to match on. The special value \char`\"{}$\ast$\char`\"{} matches all namespaces.\item[{\em local\-Name}]The local name of the elements to match on. The special value \char`\"{}$\ast$\char`\"{} matches all local names.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A new {\bf Node\-List}{\rm (p.\,\pageref{classDOM_1_1NodeList})} object containing all the matched Elements. \end{Desc}


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

References DOM::DOMString::implementation().

Referenced by get\-Elements\-By\-Tag\-Name().\index{DOM::Element@{DOM::Element}!getAttributeNS@{getAttributeNS}}
\index{getAttributeNS@{getAttributeNS}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} Element::get\-Attribute\-NS (const {\bf DOMString} \& {\em namespace\-URI}, const {\bf DOMString} \& {\em local\-Name})}\label{classDOM_1_1Element_a15}


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

No Exceptions.

Retrieves an attribute value by local name and namespace URI. HTML-only {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} implementations do not need to implement this method.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em namespace\-URI}]The namespace URI of the attribute to retrieve.\item[{\em local\-Name}]The local name of the attribute to retrieve.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} value as a string, or the empty string if that attribute does not have a specified or default value. \end{Desc}


Definition at line 207 of file dom\_\-element.cpp.

References DOM::DOMString::implementation().

Referenced by get\-Attribute().\index{DOM::Element@{DOM::Element}!setAttributeNS@{setAttributeNS}}
\index{setAttributeNS@{setAttributeNS}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Element::set\-Attribute\-NS (const {\bf DOMString} \& {\em namespace\-URI}, const {\bf DOMString} \& {\em qualified\-Name}, const {\bf DOMString} \& {\em value})}\label{classDOM_1_1Element_a16}


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

Adds a new attribute. If an attribute with the same local name and namespace URI is already present on the element, its prefix is changed to be the prefix part of the qualified\-Name, and its value is changed to be the value parameter. This value is a simple string; it is not parsed as it is being set. So any markup (such as syntax to be recognized as an entity reference) is treated as literal text, and needs to be appropriately escaped by the implementation when it is written out. In order to assign an attribute value that contains entity references, the user must create an {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} node plus any {\bf Text}{\rm (p.\,\pageref{classDOM_1_1Text})} and {\bf Entity\-Reference}{\rm (p.\,\pageref{classDOM_1_1EntityReference})} nodes, build the appropriate subtree, and use set\-Attribute\-Node\-NS or set\-Attribute\-Node to assign it as the value of an attribute.

HTML-only {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} implementations do not need to implement this method.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em namespace\-URI}]The namespace URI of the attribute to create or alter.\item[{\em qualified\-Name}]The qualified name of the attribute to create or alter.\item[{\em value}]The value to set in string form.\end{description}
\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em DOMException}]INVALID\_\-CHARACTER\_\-ERR: Raised if the specified qualified name contains an illegal character.\end{description}
\end{Desc}
NO\_\-MODIFICATION\_\-ALLOWED\_\-ERR: Raised if this node is readonly.

NAMESPACE\_\-ERR: Raised if the qualified\-Name is malformed, if the qualified\-Name has a prefix and the namespace\-URI is null, if the qualified\-Name has a prefix that is \char`\"{}xml\char`\"{} and the namespace\-URI is different from \char`\"{}http://www.w3.org/XML/1998/namespace\char`\"{}, or if the qualified\-Name is \char`\"{}xmlns\char`\"{} and the namespace\-URI is different from \char`\"{}http://www.w3.org/2000/xmlns/\char`\"{}. 

Definition at line 218 of file dom\_\-element.cpp.

References DOM::DOMString::find(), DOM::DOMString::implementation(), DOM::Node::local\-Name(), and DOM::DOMString::remove().

Referenced by set\-Attribute().\index{DOM::Element@{DOM::Element}!removeAttributeNS@{removeAttributeNS}}
\index{removeAttributeNS@{removeAttributeNS}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Element::remove\-Attribute\-NS (const {\bf DOMString} \& {\em namespace\-URI}, const {\bf DOMString} \& {\em local\-Name})}\label{classDOM_1_1Element_a17}


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

Removes an attribute by local name and namespace URI. If the removed attribute has a default value it is immediately replaced. The replacing attribute has the same namespace URI and local name, as well as the original prefix.

HTML-only {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} implementations do not need to implement this method.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em namespace\-URI}]The namespace URI of the attribute to remove.\item[{\em local\-Name}]The local name of the attribute to remove.\end{description}
\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}


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

References DOM::DOMString::implementation().

Referenced by remove\-Attribute().\index{DOM::Element@{DOM::Element}!getAttributeNodeNS@{getAttributeNodeNS}}
\index{getAttributeNodeNS@{getAttributeNodeNS}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Attr} Element::get\-Attribute\-Node\-NS (const {\bf DOMString} \& {\em namespace\-URI}, const {\bf DOMString} \& {\em local\-Name})}\label{classDOM_1_1Element_a18}


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

Retrieves an {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} node by local name and namespace URI. HTML-only {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} implementations do not need to implement this method.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em namespace\-URI}]The namespace URI of the attribute to retrieve.\item[{\em local\-Name}]The local name of the attribute to retrieve.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} node with the specified attribute local name and namespace URI or null if there is no such attribute. \end{Desc}


Definition at line 256 of file dom\_\-element.cpp.

References DOM::DOMString::implementation().

Referenced by get\-Attribute\-Node().\index{DOM::Element@{DOM::Element}!setAttributeNodeNS@{setAttributeNodeNS}}
\index{setAttributeNodeNS@{setAttributeNodeNS}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Attr} Element::set\-Attribute\-Node\-NS (const {\bf Attr} \& {\em new\-Attr})}\label{classDOM_1_1Element_a19}


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

Adds a new attribute. If an attribute with that local name and that namespace URI is already present in the element, it is replaced by the new one.

HTML-only {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} implementations do not need to implement this method.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em new\-Attr}]The {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} node to add to the attribute list.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]If the new\-Attr attribute replaces an existing attribute with the same local name and namespace URI, the replaced {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} node is returned, otherwise null is returned.\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em DOMException}]WRONG\_\-DOCUMENT\_\-ERR: Raised if new\-Attr was created from a different document than the one that created the element.\end{description}
\end{Desc}
NO\_\-MODIFICATION\_\-ALLOWED\_\-ERR: Raised if this node is readonly.

INUSE\_\-ATTRIBUTE\_\-ERR: Raised if new\-Attr is already an attribute of another {\bf Element}{\rm (p.\,\pageref{classDOM_1_1Element})} object. The {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} user must explicitly clone {\bf Attr}{\rm (p.\,\pageref{classDOM_1_1Attr})} nodes to re-use them in other elements. 

Definition at line 271 of file dom\_\-element.cpp.

References DOM::Node::handle(), and DOM::Node::is\-Null().

Referenced by set\-Attribute\-Node().\index{DOM::Element@{DOM::Element}!hasAttribute@{hasAttribute}}
\index{hasAttribute@{hasAttribute}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Element::has\-Attribute (const {\bf DOMString} \& {\em name})}\label{classDOM_1_1Element_a20}


Returns true when an attribute with a given name is specified on this element or has a default value, false otherwise. 

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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]The name of the attribute to look for.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if an attribute with the given name is specified on this element or has a default value, false otherwise. \end{Desc}


Definition at line 285 of file dom\_\-element.cpp.

References has\-Attribute\-NS(), and KStd\-Accel::name().\index{DOM::Element@{DOM::Element}!hasAttributeNS@{hasAttributeNS}}
\index{hasAttributeNS@{hasAttributeNS}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Element::has\-Attribute\-NS (const {\bf DOMString} \& {\em namespace\-URI}, const {\bf DOMString} \& {\em local\-Name})}\label{classDOM_1_1Element_a21}


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

Returns true when an attribute with a given local name and namespace URI is specified on this element or has a default value, false otherwise. HTML-only {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} implementations do not need to implement this method.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em namespace\-URI}]The namespace URI of the attribute to look for.\item[{\em local\-Name}]The local name of the attribute to look for.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if an attribute with the given local name and namespace URI is specified or has a default value on this element, false otherwise. \end{Desc}


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

References DOM::DOMString::implementation().

Referenced by has\-Attribute().\index{DOM::Element@{DOM::Element}!style@{style}}
\index{style@{style}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf CSSStyle\-Declaration} Element::style ()}\label{classDOM_1_1Element_a22}


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

The style attribute 

Definition at line 315 of file dom\_\-element.cpp.\index{DOM::Element@{DOM::Element}!form@{form}}
\index{form@{form}!DOM::Element@{DOM::Element}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Element} Element::form () const}\label{classDOM_1_1Element_a24}


KHTML extension to {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} This method returns the associated form element. 

returns null if this element is not a form-like element or if this elment is not in the scope of a form element. 

Reimplemented in {\bf DOM::HTMLButton\-Element} {\rm (p.\,\pageref{classDOM_1_1HTMLButtonElement_a6})}, {\bf DOM::HTMLField\-Set\-Element} {\rm (p.\,\pageref{classDOM_1_1HTMLFieldSetElement_a6})}, {\bf DOM::HTMLInput\-Element} {\rm (p.\,\pageref{classDOM_1_1HTMLInputElement_a10})}, {\bf DOM::HTMLLegend\-Element} {\rm (p.\,\pageref{classDOM_1_1HTMLLegendElement_a6})}, {\bf DOM::HTMLSelect\-Element} {\rm (p.\,\pageref{classDOM_1_1HTMLSelectElement_a12})}, {\bf DOM::HTMLText\-Area\-Element} {\rm (p.\,\pageref{classDOM_1_1HTMLTextAreaElement_a8})}, {\bf DOM::HTMLOption\-Element} {\rm (p.\,\pageref{classDOM_1_1HTMLOptionElement_a6})}, {\bf DOM::HTMLIs\-Index\-Element} {\rm (p.\,\pageref{classDOM_1_1HTMLIsIndexElement_a6})}, and {\bf DOM::HTMLObject\-Element} {\rm (p.\,\pageref{classDOM_1_1HTMLObjectElement_a6})}.

Definition at line 309 of file dom\_\-element.cpp.

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