XML DOM NamedNodeMap Object - XML DOM

What is the NamedNodeMap object of XML DOM?

The collection of nodes which are accessible by the name is represented by NamedNodeMap object.

What are the attributes of the NamedNodeMap object of XML DOM?

The attributes of the NamedNodeMap object are as follows:

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.

What are the different NamedNodeMap object methods offered by XML DOM?

The methods of the NamedNodeMap object are as follows:

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 theindexth 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 itsnodeNameattribute. 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 itsnamespaceURIandlocalName. 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.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

XML DOM Topics