Named Node Map

A named node map represents unordered collections of nodes that can be accessed by name. The attributes of an element is an example of a named node map.

Get Named Item

get-named-item node-map name

The get-named-item method retrieves a node specified by name. It takes two arguments: The map, and the name of the node to retrieve. It returns NIL if no match was found.

Get Named Item NS

get-named-item-ns node-map name

Retrieves a node specified by local name and namespace URI.

Item

item node-map index

The item method returns the nth item in the map, or NIL if the index is greater or equal to the number of nodes in the map. The method takes two arguments: A node map, and a numerical index into the map.

Length

length node-map

The length attribute returns the number of nodes in the map.

Remove Named Item

remove-named-item node-map name

The remove-named-item method removes a node specified by name. The method takes two arguments: the map, and the name of the node to remove.

Remove Named Item NS

remove-named-item-ns node-map namespace-uri local-name

Removes a node specified by local name and namespace.

Set Named Item

set-named-item node-map node

The set-named-item method adds a node using its nodename attribute. It takes two arguments: The map, and the node to store in the map. If the new node replaces an existing node with the same name, the previously existing node is returned.

Set Named Item NS

set-named-item-ns node-map node

Adds a node using its nodename attribute. It takes two arguments: The map, and the node to store in the map. If the new node replaces an existing node with the same name, the previously existing node is returned.