<h1>xercesc::DOMNamedNodeMap Class Reference</h1><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">Retrieves a node specified by local name and namespace URI. <ahref="#z330_0"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Adds a node using its <code>namespaceURI</code> and <code>localName</code>. <ahref="#z330_1"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Removes a node specified by local name and namespace URI. <ahref="#z330_2"></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>
<dlcompact><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>
<dlcompact><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>
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>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>index</em> </td><td>Index into the map. </td></tr>
</table>
</dl>
<dlcompact><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>
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>
<tr><tdvalign="top"></td><tdvalign="top"><em>DOMException</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>
<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>
<dlcompact><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>
<dlcompact><dt><b>Exceptions:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>DOMException</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>
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>
<dlcompact><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>DOMException</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>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>
<dlcompact><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>DOMException</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>