Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XML DOM – NamedNodeMap Object

XML DOM - NamedNodeMap Object


The NamedNodeMap object represents an unordered list of nodes.


NamedNodeMap object

Nodes in a NamedNodeMap can be accessed by their names.

A NamedNodeMap updates itself. If an element is deleted from or added to the node list or XML document, the list is automatically updated.

**Note:** In a named node map, 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 specified node (by name).
getNamedItemNS() Returns the specified node (by name and namespace).
item() Returns the node with the specified index.
removeNamedItem() Deletes the specified node (by name).
removeNamedItemNS() Deletes the specified node (by name and namespace).
setNamedItem() Sets the specified node (by name).
setNamedItemNS() Sets the specified node (by name and namespace).