Latest web development tutorials
 

XML DOM - The NamedNodeMap Object


The NamedNodeMap object represents an unordered list of nodes.


The NamedNodeMap object

The nodes in the NamedNodeMap can be accessed through their name.

The NamedNodeMap keeps itself up-to-date. If an element is deleted or added, in the node list or the XML document, the list is automatically updated.

Note: In a named node map, the nodes are not returned in any particular order.

NamedNodeMap Object Properties

Property Description
length Returns the number of nodes in the list

NamedNodeMap Object Methods

Method Description
getNamedItem() Returns the node with the specific name
getNamedItemNS() Returns the node with the specific name and namespace
item() Returns the node at the specified index
removeNamedItem() Removes the node with the specific name
removeNamedItemNS() Removes the node with the specific name and namespace
setNamedItem() Sets the specified node (by name)
setNamedItemNS() Sets the specified node (by name and namespace)