NAME

XML::GDOME::NamedNodeMap - Interface NamedNodeMap implementation.

SYNOPSIS

$int  = $nnm->getLength();
$node = $nnm->getNamedItem($name);
$node = $nnm->getNamedItemNS($namespaceURI,$localName);
$node = $nnm->item($index);
$node = $nnm->removeNamedItem($name);
$node = $nnm->removeNamedItemNS($namespaceURI,$localName);
$node = $nnm->setNamedItem($arg);
$node = $nnm->setNamedItemNS($arg);

METHODS

$int = $nnm->getLength();

Returns: the number of nodes in this map. The range of valid child node indices is 0 to length-1 inclusive.

$node = $nnm->getNamedItem($name);

Retrieves a node specified by name.

name: The nodeName of the node to retrieve.

Returns: a Node (of any type) with the specified nodeName, or undef if it does not identify any node in this map.

$node = $nnm->getNamedItemNS($namespaceURI,$localName);

Retrieves a node specified by local name and namespace URI.

namespaceURI: The namespace URI of the node to retrieve.

localName: The local name of the node to retrieve.

Returns: a Node (of any type) with the specified local name and namespace URI, or undef if they do not identify any node in this map.

$node = $nnm->item($index);

index: Index into this map.

Returns: the indexth item in the map. If index is greater than or equal to the number of nodes in this map, this returns undef.

$node = $nnm->removeNamedItem($name);

Removes a node specified by name. When this map contains the attributes attached to an element, if the removed attribute is known to have a default value, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix when applicable.

name: The nodeName of the node to remove.

Returns: the node removed from this map if a node with such a name exists.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.

GDOME_NOT_FOUND_ERR: Raised if there is no node named name in this map.

$node = $nnm->removeNamedItemNS($namespaceURI,$localName);

Removes a node specified by local name and namespace URI. When this map contains the attributes attached to an element, if the removed attribute is known to have a default value, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix when applicable.

namespaceURI: The namespace URI of the node to remove.

localName: The local name of the node to remove.

Returns: the node removed from this map if a node with such a local name and namespace URI exists.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.

GDOME_NOT_FOUND_ERR: Raised if there is no node named name in this map.

$node = $nnm->setNamedItem($arg);

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.

arg: a node to store in this map.

Returns: if the new Node replaces an existing node, the replaced Node is returned, otherwise undef is returned.

GDOME_INUSE_ATTRIBUTE_ERR: Raised if arg is an Attr that is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.

GDOME_HIERARCHY_REQUEST_ERR: Raised if an attempt is made to add a node doesn't belong in this NamedNodeMap. Examples would include trying to insert something other than an Attr node into an Element's map of attributes, or a non-Entity node into the DocumentType's map of Entities.

GDOME_WRONG_DOCUMENT_ERR: Raised if arg was created from a different document than the one that created this map.

$node = $nnm->setNamedItemNS($arg);

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

arg: a node to store in this map. The node will later be accessible using the value of its namespaceURI and localName attributes.

Returns: If the new Node replaces an existing node the replaced Node is returned, otherwise null is returned.

GDOME_INUSE_ATTRIBUTE_ERR: Raised if arg is an Attr that is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.

GDOME_HIERARCHY_REQUEST_ERR: Raised if an attempt is made to add a node doesn't belong in this NamedNodeMap. Examples would include trying to insert something other than an Attr node into an Element's map of attributes, or a non-Entity node into the DocumentType's map of Entities.

GDOME_WRONG_DOCUMENT_ERR: Raised if arg was created from a different document than the one that created this map.