Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

XML DOM - NamedNodeMap object


May 27, 2021 XML DOM


Table of contents


XML DOM - NamedNodeMap object


The NamedNodeMap object represents a sequenceless table of nodes.

This section describes the properties and methods of the NamedNodeMap object.


NamedNodeMap object

Nodes in NamedNodeMap can be accessed by their names.

NamedNodeMap will update itself. If you delete or add an element to a node list or XML document, the list updates automatically.

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

NamedNodeMap object properties

Attributes describe
length Returns the number of nodes in the list.

NamedNodeMap object method

method describe
getNamedItem() Returns the specified node (by name).
getNamedItemNS() Returns the specified node (via name and namespace).
item() Returns the node that specifies the index number.
removeNamedItem() Delete the specified node (by name).
removeNamedItemNS() Delete the specified node (via name and namespace).
setNamedItem() Set the specified node (by name).
setNamedItemNS() Set the specified node (via name and namespace).
In the next section, you'll learn about the XML DOM Document object!