Help Center

Local Navigation

Object: NamedNodeMap

Availability

BlackBerry® Device Software version 4.6 or later

The NamedNodeMap object represents collections of nodes that can be accessed by name.

You can access an individual node within a collection by its index position using NamedNodeMap.item(), by its name or id attribute using NamedNodeMap.getNamedItem(), or you can index the object directly. For example, if you create an instance of a NamedNodeMap object called myNamedNodeMap, then specifying

myNamedNodeMap.item(2)

myNamedNodeMap.getNamedItem(“item”)

is equivalent to specifying

myNamedNodeMap[2]

myNamedNodeMap[“item”]

NamedNodeMap properties

Property name

Type

Description

Status

Support level

Availability

length

unsigned long

Returns the number of nodes in the map.

read only

DOM 2 Core

4.6 or later

NamedNodeMap methods

Method name

Description

Support level

Availability

getNamedItem()

Retrieves the node with the given name.

DOM 2 Core

4.6 or later

getNamedItemNS()

Retrieves the node with the given name and namespace URI.

DOM 2 Core

4.6 or later

item()

Returns the node at the given index in the map.

DOM 2 Core

4.6 or later

removeNamedItem()

Removes the node with the given name from the map.

DOM 2 Core

4.6 or later

removeNamedItemNS()

Removes the node with the given name and namespace URI from the map.

DOM 2 Core

4.6 or later

setNamedItem()

Adds a node using the Node.nodeName attribute.

DOM 2 Core

4.6 or later

setNamedItemNS()

Adds a node using the Node.nodeName attribute and the namespace URI.

DOM 2 Core

4.6 or later

Next topic: Object: Node
Previous topic: Object: EntityReference

Was this information helpful? Send us your comments.