<h1>xercesc::DOMNamedNodeMap Class Reference</h1><!-- doxytag: class="xercesc::DOMNamedNodeMap" --><code><aclass="el"href="classxercesc_1_1DOMNamedNodeMap.html">DOMNamedNodeMap</a></code>s are used to represent collections of nodes that can be accessed by name.
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Adds a node using its <code>nodeName</code> attribute. <ahref="#b0460a9ab57ae2a669d18a720f18c40d"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the <code>index</code>th item in the map. <ahref="#272048d482af8525eb64ad1e1e7b459f"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Retrieves a node specified by name. <ahref="#d7703fc5a8bc51757f175f10d6439cdd"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">The number of nodes in the map. <ahref="#a653328f663e1ef939d6dbec7276aa30"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Removes a node specified by name. <ahref="#61daea55f82f379af62c90abd973bf1b"></a><br></td></tr>
<tr><tdcolspan="2"><divclass="groupHeader">Functions introduced in DOM Level 2</div></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Retrieves a node specified by local name and namespace URI. <ahref="#6e1c7c073b1b098ee924a11b2653702c"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Adds a node using its <code>namespaceURI</code> and <code>localName</code>. <ahref="#659e7833aba836cc3f24c6b93e653b0c"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Removes a node specified by local name and namespace URI. <ahref="#908b939cd8cf54d649c478ed6720db73"></a><br></td></tr>
<code><aclass="el"href="classxercesc_1_1DOMNamedNodeMap.html">DOMNamedNodeMap</a></code>s are used to represent collections of nodes that can be accessed by name.
<p>
Note that <code><aclass="el"href="classxercesc_1_1DOMNamedNodeMap.html">DOMNamedNodeMap</a></code> does not inherit from <code><aclass="el"href="classxercesc_1_1DOMNodeList.html">DOMNodeList</a></code>; <code><aclass="el"href="classxercesc_1_1DOMNamedNodeMap.html">DOMNamedNodeMap</a></code>s are not maintained in any particular order. Nodes contained in a <code><aclass="el"href="classxercesc_1_1DOMNamedNodeMap.html">DOMNamedNodeMap</a></code> may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents, and does not imply that the DOM specifies an order to these Nodes.<p>
As the <code>nodeName</code> 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. <dlcompact><dt><b>Parameters:</b></dt><dd>
<tr><tdvalign="top"></td><tdvalign="top"><em>arg</em> </td><td>A node to store in a named node map. The node will later be accessible using the value of the <code>nodeName</code> attribute of the node. If a node with that name is already present in the map, it is replaced by the new one. </td></tr>
<dlclass="return"compact><dt><b>Returns:</b></dt><dd>If the new <code><aclass="el"href="classxercesc_1_1DOMNode.html">DOMNode</a></code> replaces an existing node the replaced <code><aclass="el"href="classxercesc_1_1DOMNode.html">DOMNode</a></code> is returned, otherwise <code>null</code> is returned. </dd></dl>
<dlcompact><dt><b>Exceptions:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em><aclass="el"href="classxercesc_1_1DOMException.html">DOMException</a></em> </td><td>WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a different document than the one that created the <code><aclass="el"href="classxercesc_1_1DOMNamedNodeMap.html">DOMNamedNodeMap</a></code>. <br>
NO_MODIFICATION_ALLOWED_ERR: Raised if this <code><aclass="el"href="classxercesc_1_1DOMNamedNodeMap.html">DOMNamedNodeMap</a></code> is readonly. <br>
INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an <code><aclass="el"href="classxercesc_1_1DOMAttr.html">DOMAttr</a></code> that is already an attribute of another <code><aclass="el"href="classxercesc_1_1DOMElement.html">DOMElement</a></code> object. The DOM user must explicitly clone <code><aclass="el"href="classxercesc_1_1DOMAttr.html">DOMAttr</a></code> nodes to re-use them in other elements. </td></tr>
If <code>index</code> is greater than or equal to the number of nodes in the map, this returns <code>null</code>. <dlcompact><dt><b>Parameters:</b></dt><dd>
<dlclass="return"compact><dt><b>Returns:</b></dt><dd>The node at the <code>index</code>th position in the <code><aclass="el"href="classxercesc_1_1DOMNamedNodeMap.html">DOMNamedNodeMap</a></code>, or <code>null</code> if that is not a valid index. </dd></dl>
<dlclass="return"compact><dt><b>Returns:</b></dt><dd>A <code><aclass="el"href="classxercesc_1_1DOMNode.html">DOMNode</a></code> (of any type) with the specified <code>nodeName</code>, or <code>null</code> if it does not identify any node in the map. </dd></dl>
The range of valid child node indices is 0 to <code>length-1</code> inclusive. <dlclass="since"compact><dt><b>Since:</b></dt><dd>DOM Level 1 </dd></dl>
If the removed node is an <code><aclass="el"href="classxercesc_1_1DOMAttr.html">DOMAttr</a></code> with a default value it is immediately replaced. <dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>name</em> </td><td>The <code>nodeName</code> of a node to remove. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em><aclass="el"href="classxercesc_1_1DOMException.html">DOMException</a></em> </td><td>NOT_FOUND_ERR: Raised if there is no node named <code>name</code> in the map. <br>
NO_MODIFICATION_ALLOWED_ERR: Raised if this <code><aclass="el"href="classxercesc_1_1DOMNamedNodeMap.html">DOMNamedNodeMap</a></code> is readonly. </td></tr>
<dlclass="return"compact><dt><b>Returns:</b></dt><dd>A <code><aclass="el"href="classxercesc_1_1DOMNode.html">DOMNode</a></code> (of any type) with the specified local name and namespace URI, or <code>null</code> if they do not identify any node in the map. </dd></dl>
<tr><tdvalign="top"></td><tdvalign="top"><em>arg</em> </td><td>A node to store in a named node map. The node will later be accessible using the value of the <code>namespaceURI</code> and <code>localName</code> attribute of the node. If a node with those namespace URI and local name is already present in the map, it is replaced by the new one. </td></tr>
<dlclass="return"compact><dt><b>Returns:</b></dt><dd>If the new <code><aclass="el"href="classxercesc_1_1DOMNode.html">DOMNode</a></code> replaces an existing node the replaced <code><aclass="el"href="classxercesc_1_1DOMNode.html">DOMNode</a></code> is returned, otherwise <code>null</code> is returned. </dd></dl>
<tr><tdvalign="top"></td><tdvalign="top"><em><aclass="el"href="classxercesc_1_1DOMException.html">DOMException</a></em> </td><td>WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a different document than the one that created the <code><aclass="el"href="classxercesc_1_1DOMNamedNodeMap.html">DOMNamedNodeMap</a></code>. <br>
NO_MODIFICATION_ALLOWED_ERR: Raised if this <code><aclass="el"href="classxercesc_1_1DOMNamedNodeMap.html">DOMNamedNodeMap</a></code> is readonly. <br>
INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an <code><aclass="el"href="classxercesc_1_1DOMAttr.html">DOMAttr</a></code> that is already an attribute of another <code><aclass="el"href="classxercesc_1_1DOMElement.html">DOMElement</a></code> object. The DOM user must explicitly clone <code><aclass="el"href="classxercesc_1_1DOMAttr.html">DOMAttr</a></code> nodes to re-use them in other elements. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>namespaceURI</em> </td><td>The <em>namespace URI</em> of the node to remove. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>localName</em> </td><td>The <em>local name</em> of the node to remove. When this <code><aclass="el"href="classxercesc_1_1DOMNamedNodeMap.html">DOMNamedNodeMap</a></code> contains the attributes attached to an element, as returned by the attributes attribute of the <code><aclass="el"href="classxercesc_1_1DOMNode.html">DOMNode</a></code> interface, if the removed attribute is known to have a default value, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix. </td></tr>
<dlclass="return"compact><dt><b>Returns:</b></dt><dd>The node removed from the map if a node with such a local name and namespace URI exists. </dd></dl>
<tr><tdvalign="top"></td><tdvalign="top"><em><aclass="el"href="classxercesc_1_1DOMException.html">DOMException</a></em> </td><td>NOT_FOUND_ERR: Raised if there is no node named <code>name</code> in the map. <br>
NO_MODIFICATION_ALLOWED_ERR: Raised if this <code><aclass="el"href="classxercesc_1_1DOMNamedNodeMap.html">DOMNamedNodeMap</a></code> is readonly. </td></tr>