<?xml version="1.0" encoding="utf-8"?>
<interface name="DOM_NamedNodeMap" short="the Document Object Model (DOM) DOM_NamedNodeMap interface">

<comments>
	Copyright 2003 Michael B. Allen &lt;mballen@erols.com&gt;
	Generated by CStyleX 0.1.1
</comments>

<include>domc.h</include>

<title>DOM_NamedNodeMap</title>

<desc>
The <tt>DOM_NamedNodeMap</tt> type provides access to an unordered map that premits nodes to be retrieved and set by their <tt>nodeName</tt>. The <tt>attributes</tt> member of a <tt>DOM_Element</tt> node type is a <tt>DOM_NamedNodeMap</tt> as are the <tt>entities</tt> and <tt>notations</tt> members of the <tt>DOM_DocumentType</tt> interface.

<example id="enumattr">
<title>Enumerating the attributes of an Element</title>
<desc>
This example illustrates how to enumerate and print each attribute of a <tt>DOM_Element</tt> node.
<pre>
for (idx = 0; i &lt; elem-&gt;attributes-&gt;length; i++) {
	DOM_Attr *attr = DOM_NamedNodeMap_item(elem-&gt;attributes, idx);
	printf("%s='%s'\n", attr-&gt;nodeName, DOM_Node_getNodeValue(attr));
}
</pre>
</desc>
</example>

</desc>

<group>
<title>The DOM_NamedNodeMap type</title>

<code>
<desc>The <tt>DOM_NamedNodeMap</tt> structure provides a <tt>length</tt> member containing the number of elements in the map. This member must never be modified.</desc>
<pre>
typedef struct {
	int length; 
	/* other members */
} DOM_NamedNodeMap;
</pre>
</code>

<meth name="getNamedItem">
<pre>DOM_Node *DOM_NamedNodeMap_getNamedItem(DOM_NamedNodeMap *this, DOM_String *name);</pre>
<param name="this"/>
<param name="name"/>
<desc>
The <tt>DOM_NamedNodeMap_getNamedItem</tt> function returns the node associated with the <tt>name</tt> parameter or returnes NULL if there is no node by that name in the map.
</desc>
</meth>

<meth name="setNamedItem">
<pre>DOM_Node *DOM_NamedNodeMap_setNamedItem(DOM_NamedNodeMap *this, DOM_Node *arg);</pre>
<param name="this"/>
<param name="arg"/>
<desc>
The <tt>DOM_NamedNodeMap_setNamedItem</tt> function puts the node <tt>arg</tt> into <tt>this</tt> map using it's <tt>nodeName</tt> member as key key. If a node with the same name already exists in the map it will be replaced with the new node and returned. If the replaced node will no longer be used it must be freed with <tt>DOM_Document_destroyNode</tt>.
</desc>
<ret>
If the new <tt>DOM_Node</tt> replaces an existing node the replaced node is returned. Otherwise NULL is returned.
</ret>
</meth>

<meth name="removeNamedItem">
<pre>DOM_Node *DOM_NamedNodeMap_removeNamedItem(DOM_NamedNodeMap *this, DOM_String *name);</pre>
<param name="this"/>
<param name="name"/>
<desc>
The <tt>DOM_NamedNodeMap_removeNamedItem</tt> function removes and returns the named item from <tt>this</tt> map or returns NULL if there is no node by that name in the map.
<p/>
<i>The DOM specifications require that attributes with default DTD values should be replaced by their default value when the attribute is removed. Currently DOMC does not support default DTD values.</i>
</desc>
</meth>

<meth name="item">
<pre>DOM_Node *DOM_NamedNodeMap_item(DOM_NamedNodeMap *this, int index);</pre>
<param name="this"/>
<param name="index"/>
<desc>
The <tt>DOM_NamedNodeMap_item</tt> function returns the node in <tt>this</tt> list at <tt>index</tt> which starts from 0.
</desc>
<ret>
The node at the specified index or NULL if there is no such node.
</ret>
</meth>

</group>
</interface>

