.TH "DOM::NamedNodeMap" 3 "28 Jan 2004" "khtml Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
DOM::NamedNodeMap \- Objects implementing the \fC \fBNamedNodeMap\fP \fP interface are used to represent collections of nodes that can be accessed by name.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <dom_node.h>\fP
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBNamedNodeMap\fP (const  \fBNamedNodeMap\fP &other)"
.br
.ti -1c
.RI "\fBNamedNodeMap\fP & \fBoperator=\fP (const  \fBNamedNodeMap\fP &other)"
.br
.ti -1c
.RI "unsigned long \fBlength\fP () const "
.br
.RI "\fIThe number of nodes in the map. \fP"
.ti -1c
.RI "\fBNode\fP \fBgetNamedItem\fP (const  \fBDOMString\fP &name) const "
.br
.RI "\fIRetrieves a node specified by name. \fP"
.ti -1c
.RI "\fBNode\fP \fBsetNamedItem\fP (const  \fBNode\fP &arg)"
.br
.RI "\fIAdds a node using its \fC nodeName \fP attribute. \fP"
.ti -1c
.RI "\fBNode\fP \fBremoveNamedItem\fP (const  \fBDOMString\fP &name)"
.br
.RI "\fIRemoves a node specified by name. \fP"
.ti -1c
.RI "\fBNode\fP \fBitem\fP (unsigned long index) const "
.br
.RI "\fIReturns the \fC index \fP th item in the map. \fP"
.ti -1c
.RI "\fBNode\fP \fBgetNamedItemNS\fP (const  \fBDOMString\fP &namespaceURI, const  \fBDOMString\fP &localName) const "
.br
.RI "\fIIntroduced in \fBDOM\fP Level 2. \fP"
.ti -1c
.RI "\fBNode\fP \fBsetNamedItemNS\fP (const  \fBNode\fP &arg)"
.br
.RI "\fIIntroduced in \fBDOM\fP Level 2. \fP"
.ti -1c
.RI "\fBNode\fP \fBremoveNamedItemNS\fP (const  \fBDOMString\fP &namespaceURI, const  \fBDOMString\fP &localName)"
.br
.RI "\fIIntroduced in \fBDOM\fP Level 2. \fP"
.ti -1c
.RI "NamedNodeMapImpl * \fBhandle\fP () const   throw ()"
.br
.ti -1c
.RI "bool \fBisNull\fP () const   throw ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "\fBNamedNodeMap\fP (NamedNodeMapImpl *i)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "NamedNodeMapImpl * \fBimpl\fP"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBNode\fP"
.br
.ti -1c
.RI "class \fBDocumentType\fP"
.br
.ti -1c
.RI "class \fBNodeImpl\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
Objects implementing the \fC \fBNamedNodeMap\fP \fP interface are used to represent collections of nodes that can be accessed by name. 

Note that \fC \fBNamedNodeMap\fP \fP does not inherit from \fC \fBNodeList\fP \fP ; \fC \fBNamedNodeMap\fP \fP s are not maintained in any particular order. Objects contained in an object implementing \fC \fBNamedNodeMap\fP \fP may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a \fC \fBNamedNodeMap\fP \fP , and does not imply that the \fBDOM\fP specifies an order to these Nodes. 
.PP
Definition at line 61 of file dom_node.h.
.SH "Member Function Documentation"
.PP 
.SS "unsigned long NamedNodeMap::length () const"
.PP
The number of nodes in the map. The range of valid child node indices is 0 to \fC length-1 \fP inclusive. Definition at line 119 of file dom_node.cpp.
.SS "\fBNode\fP NamedNodeMap::getNamedItem (const \fBDOMString\fP & name) const"
.PP
Retrieves a node specified by name. \fBParameters:\fP
.RS 4
\fIname\fP Name of a node to retrieve.
.RE
.PP
\fBReturns:\fP
.RS 4
A \fC \fBNode\fP \fP (of any type) with the specified name, or \fC null \fP if the specified name did not identify any node in the map. 
.RE
.PP
Definition at line 67 of file dom_node.cpp.
.PP
References getNamedItemNS(), and KStdAccel::name().
.SS "\fBNode\fP NamedNodeMap::setNamedItem (const \fBNode\fP & arg)"
.PP
Adds a node using its \fC nodeName \fP attribute. As the \fC nodeName \fP attribute is used to derive the name which the node must be stored under, multiple nodes of certain types (those that have a 'special' string value) cannot be stored as the names would clash. This is seen as preferable to allowing nodes to be aliased.
.PP
\fBParameters:\fP
.RS 4
\fIarg\fP A node to store in a named node map. The node will later be accessible using the value of the \fC nodeName \fP attribute of the node. If a node with that name is already present in the map, it is replaced by the new one.
.RE
.PP
\fBReturns:\fP
.RS 4
If the new \fC \fBNode\fP \fP replaces an existing node with the same name the previously existing \fC \fBNode\fP \fP is returned, otherwise \fC null \fP is returned.
.RE
.PP
\fBExceptions:\fP
.RS 4
\fIDOMException\fP WRONG_DOCUMENT_ERR: Raised if \fC arg \fP was created from a different document than the one that created the \fC \fBNamedNodeMap\fP \fP .
.RE
.PP
NO_MODIFICATION_ALLOWED_ERR: Raised if this \fC \fBNamedNodeMap\fP \fP is readonly.
.PP
INUSE_ATTRIBUTE_ERR: Raised if \fC arg \fP is an \fC \fBAttr\fP \fP that is already an attribute of another \fC \fBElement\fP \fP object. The \fBDOM\fP user must explicitly clone \fC \fBAttr\fP \fP nodes to re-use them in other elements. Definition at line 72 of file dom_node.cpp.
.PP
References setNamedItemNS().
.SS "\fBNode\fP NamedNodeMap::removeNamedItem (const \fBDOMString\fP & name)"
.PP
Removes a node specified by name. If the removed node is an \fC \fBAttr\fP \fP with a default value it is immediately replaced.
.PP
\fBParameters:\fP
.RS 4
\fIname\fP The name of a node to remove.
.RE
.PP
\fBReturns:\fP
.RS 4
The node removed from the map or \fC null \fP if no node with such a name exists.
.RE
.PP
\fBExceptions:\fP
.RS 4
\fIDOMException\fP NOT_FOUND_ERR: Raised if there is no node named \fC name \fP in the map. 
.RE
.PP
Definition at line 77 of file dom_node.cpp.
.PP
References KStdAccel::name(), and removeNamedItemNS().
.SS "\fBNode\fP NamedNodeMap::item (unsigned long index) const"
.PP
Returns the \fC index \fP th item in the map. If \fC index \fP is greater than or equal to the number of nodes in the map, this returns \fC null \fP .
.PP
\fBParameters:\fP
.RS 4
\fIindex\fP Index into the map.
.RE
.PP
\fBReturns:\fP
.RS 4
The node at the \fC index \fP th position in the \fC \fBNamedNodeMap\fP \fP , or \fC null \fP if that is not a valid index. 
.RE
.PP
Definition at line 82 of file dom_node.cpp.
.SS "\fBNode\fP NamedNodeMap::getNamedItemNS (const \fBDOMString\fP & namespaceURI, const \fBDOMString\fP & localName) const"
.PP
Introduced in \fBDOM\fP Level 2. Retrieves a node specified by local name and namespace URI. HTML-only \fBDOM\fP implementations do not need to implement this method.
.PP
\fBParameters:\fP
.RS 4
\fInamespaceURI\fP The namespace URI of the node to retrieve.
.br
\fIlocalName\fP The local name of the node to retrieve.
.RE
.PP
\fBReturns:\fP
.RS 4
A \fBNode\fP (of any type) with the specified local name and namespace URI, or null if they do not identify any node in this map. 
.RE
.PP
Definition at line 88 of file dom_node.cpp.
.PP
Referenced by getNamedItem().
.SS "\fBNode\fP NamedNodeMap::setNamedItemNS (const \fBNode\fP & arg)"
.PP
Introduced in \fBDOM\fP Level 2. Adds a node using its namespaceURI and localName. If a node with that namespace URI and that local name is already present in this map, it is replaced by the new one. HTML-only \fBDOM\fP implementations do not need to implement this method.
.PP
\fBParameters:\fP
.RS 4
\fIarg\fP A node to store in this map. The node will later be accessible using the value of its namespaceURI and localName attributes.
.RE
.PP
\fBReturns:\fP
.RS 4
If the new \fBNode\fP replaces an existing node the replaced \fBNode\fP is returned, otherwise null is returned.
.RE
.PP
\fBExceptions:\fP
.RS 4
\fIDOMException\fP WRONG_DOCUMENT_ERR: Raised if arg was created from a different document than the one that created this map.
.RE
.PP
NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
.PP
INUSE_ATTRIBUTE_ERR: Raised if arg is an \fBAttr\fP that is already an attribute of another \fBElement\fP object. The \fBDOM\fP user must explicitly clone \fBAttr\fP nodes to re-use them in other elements. Definition at line 94 of file dom_node.cpp.
.PP
References DOM::Node::impl.
.PP
Referenced by setNamedItem().
.SS "\fBNode\fP NamedNodeMap::removeNamedItemNS (const \fBDOMString\fP & namespaceURI, const \fBDOMString\fP & localName)"
.PP
Introduced in \fBDOM\fP Level 2. Removes a node specified by local name and namespace URI. A removed attribute may be known to have a default value when this map contains the attributes attached to an element, as returned by the attributes attribute of the \fBNode\fP interface. If so, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix when applicable. HTML-only \fBDOM\fP implementations do not need to implement this method.
.PP
\fBParameters:\fP
.RS 4
\fInamespaceURI\fP The namespace URI of the node to remove.
.br
\fIlocalName\fP The local name of the node to remove.
.RE
.PP
\fBReturns:\fP
.RS 4
The node removed from this map if a node with such a local name and namespace URI exists.
.RE
.PP
\fBExceptions:\fP
.RS 4
\fIDOMException\fP NOT_FOUND_ERR: Raised if there is no node with the specified namespaceURI and localName in this map.
.RE
.PP
NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. Definition at line 104 of file dom_node.cpp.
.PP
Referenced by removeNamedItem().

.SH "Author"
.PP 
Generated automatically by Doxygen for khtml Library from the source code.
