the namednodemap object is used to represent collections of nodes that can be accessed by name.
attributes
the following table lists the property 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. |
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. |