Hello folks! welcome back to a new section of our tutorial on XML DOM. In this tutorial post, we are going to be studying about the XML DOM NamedNodeMap Object.
The NamedNodeMap object represents the collection of nodes that can be accessed by name.
The NamedNodeMap object represents the collection of nodes that can be accessed by name.
NamedNodeMap Object Attributes
The following table lists the attributes of the NamedNodeMap object -
Attribute | Type | Description |
---|---|---|
length | unsigned long | It gives the number of nodes in this map. The range of valid child node indices is 0 to length-1 inclusive. |
NamedNodeMap Object Methods
The following table lists the methods of the NamedNodeMap object -
S.No. | Methods & Description |
---|---|
1 | getNamedItem () Retrieves the node specified by name. |
2 | getNamedItemNS () Retrieves a node specified by local name and namespace URI. |
3 | item () Returns the indexth item in the map. If index is greater than or equal to the number of nodes in this map, this returns null. |
4 | removeNamedItem () Removes a node specified by name. |
5 | removeNamedItemNS () Removes a node specified by local name and namespace URI. |
6 | setNamedItem () Adds a node using its nodeName attribute. If a node with that name is already present in this map, it is replaced by the new one. |
7 | setNamedItemNS () Adds a node using its namespaceURI and localName. If a node with that namespace URI and that local name is already present in this map, it is replaced by the new one. Replacing a node by itself has no effect. |
READ: XML DOM | item Method
Alright guys! This is where we are going to be rounding up for this tutorial post. In our next tutorial, we will be studying about XML DOM NamedNodeMap length Property.
Feel free to ask your questions where necessary and we will attend to them as soon as possible. If this tutorial was helpful to you, you can use the share button to share this tutorial.
Follow us on our various social media platforms to stay updated with our latest tutorials. You can also subscribe to our newsletter in order to get our tutorials delivered directly to your emails.
Thanks for reading and bye for now.
Feel free to ask your questions where necessary and we will attend to them as soon as possible. If this tutorial was helpful to you, you can use the share button to share this tutorial.
Follow us on our various social media platforms to stay updated with our latest tutorials. You can also subscribe to our newsletter in order to get our tutorials delivered directly to your emails.
Thanks for reading and bye for now.