XML DOM tutoria...login
XML DOM tutorial
author:php.cn  update time:2022-04-13 15:27:56

DOM NamedNodeMap


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.

NamedNodeMap will update itself. If an element is deleted or added to the node list or XML document, the list is automatically updated.

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

NamedNodeMap object properties

PropertiesDescription
lengthReturn the number of nodes in the list.

NamedNodeMap Object Methods

##MethodDescriptiongetNamedItem()Returns the specified node (by name). getNamedItemNS()Returns the specified node (by name and namespace). item()Returns the node with the specified index number. removeNamedItem()Removes the specified node (by name). removeNamedItemNS()Removes the specified node (by name and namespace). setNamedItem()Set the specified node (by name). setNamedItemNS()Set the specified node (by name and namespace).