Packagedom.core
Interfacepublic interface NamedNodeMap

Introduced in: DOM 1 Core 
Modified in: DOM 2 Core 

Objects implementing the NamedNodeMap interface are used to represent collections of nodes that can be accessed by name. Note that NamedNodeMap does not inherit from NodeList; NamedNodeMaps are not maintained in any particular order. Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a NamedNodeMap, and does not imply that the DOM specifies an order to these Nodes.

Note: NamedNodeMap objects in the DOM are live.

See also

MSDN - IXMLDOMNamedNodeMap
MDC - NamedNodeMap
W3C - NamedNodeMap


Public Properties
 PropertyDefined By
  DOM 1 Core length : Number
[read-only] The number of nodes in this map.
NamedNodeMap
Public Methods
 MethodDefined By
  
DOM 1 Core getNamedItem(name:DOMString):Node
Gets a node by name.
NamedNodeMap
  
DOM 2 Core getNamedItemNS(nameSpaceURI:DOMString, localName:DOMString):Node
Gets a node by namespace and localName.
NamedNodeMap
  
Non-Standard getQualifiedItem(baseName:DOMString, nameSpaceURI:DOMString):Node
Returns the attribute with the specified namespace and attribute name.
NamedNodeMap
  
DOM 1 Core item(index:Number):Node
Returns the item at the given index (or null if the index is higher or equal to the number of nodes).
NamedNodeMap
  
Non-Standard nextNode():Node
Returns the next node in the collection.
NamedNodeMap
  
DOM 1 Core removeNamedItem(name:DOMString):Node
Removes a node (or if an attribute, may reveal a default if present).
NamedNodeMap
  
DOM 2 Core removeNamedItemNS(nameSpaceURI:DOMString, localName:DOMString):Node
Removes a node (or if an attribute, may reveal a default if present).
NamedNodeMap
  
Non-Standard reset():void
Resets the iterator.
NamedNodeMap
  
DOM 1 Core setNamedItem(arg:Node):Node
Adds (or replaces) a node by its nodeName.
NamedNodeMap
  
DOM 2 Core setNamedItemNS(arg:Node):Node
Adds (or replaces) a node by its localName and namespaceURI.
NamedNodeMap
Property Detail
DOM 1 Core lengthproperty
length:Number  [read-only]

Introduced in: DOM 1 Core 

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


Implementation
    public function get length():Number

See also

Method Detail
DOM 1 Core getNamedItem()method
public function getNamedItem(name:DOMString):Node

Introduced in: DOM 1 Core 

Gets a node by name.

Parameters

name:DOMString — The nodeName of a node to retrieve.

Returns
Node — A Node (of any type) with the specified nodeName, or null if it does not identify any node in this map.

See also

DOM 2 Core getNamedItemNS()method 
public function getNamedItemNS(nameSpaceURI:DOMString, localName:DOMString):Node

Introduced in: DOM 2 Core 

Gets a node by namespace and localName.

Parameters

nameSpaceURI:DOMString — The namespace URI of the node to retrieve.
 
localName:DOMString — The local name of the node to retrieve.

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

Throws
DOMException — NOT_SUPPORTED_ERR: May be raised if the implementation does not support the feature "XML" and the language exposed through the Document does not support XML Namespaces.

See also

getQualifiedItem()method 
public function getQualifiedItem(baseName:DOMString, nameSpaceURI:DOMString):Node

Non-standard (Microsoft)

Returns the attribute with the specified namespace and attribute name.

Parameters

baseName:DOMString — The string specifying the base name of the attribute, without namespace qualification.
 
nameSpaceURI:DOMString — The string specifying the namespace prefix that qualifies the attribute name.

Returns
Node — An object. Returns the attribute node specified by the baseName and namespaceURI parameters. Returns Null if the attribute is not in the collection or if the item is not an attribute.

See also

DOM 1 Core item()method 
public function item(index:Number):Node

Introduced in: DOM 1 Core 

Returns the item at the given index (or null if the index is higher or equal to the number of nodes).

Parameters

index:Number — Index into this map.

Returns
Node — The node at the index position in the map, or null if that is not a valid index.

See also

nextNode()method 
public function nextNode():Node

Non-standard (Microsoft)

Returns the next node in the collection.

Note: The iterator initially points before the first node in the list so that the first call to the nextNode method returns the first node in the list.

Note: This method returns Null when the current node is the last node or there are no items in the list. When the current node is removed from the list, subsequent calls to nextNode return Null. The iterator must be reset by calling the reset method.

Returns
Node — An IXMLDOMNode, which refers to the next node in the collection. Returns Null if there is no next node.

See also

DOM 1 Core removeNamedItem()method 
public function removeNamedItem(name:DOMString):Node

Introduced in: DOM 1 Core 

Removes a node (or if an attribute, may reveal a default if present).

Parameters

name:DOMString — The nodeName of the node to remove.

Returns
Node — The node removed from this map if a node with such a name exists.

Throws
DOMException — NOT_FOUND_ERR: Raised if there is no node named name in this map.
 
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.

See also

DOM 2 Core removeNamedItemNS()method 
public function removeNamedItemNS(nameSpaceURI:DOMString, localName:DOMString):Node

Introduced in: DOM 2 Core 

Removes a node (or if an attribute, may reveal a default if present).

Parameters

nameSpaceURI:DOMString — The namespace URI of the node to remove.
 
localName:DOMString — The local name of the node to remove.

Returns
Node — The node removed from this map if a node with such a local name and namespace URI exists.

Throws
DOMException — NOT_FOUND_ERR: Raised if there is no node with the specified namespaceURI and localName in this map.
 
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
 
DOMException — NOT_SUPPORTED_ERR: May be raised if the implementation does not support the feature "XML" and the language exposed through the Document does not support XML Namespaces.

See also

reset()method 
public function reset():void

Non-standard (Microsoft)

Resets the iterator.

Note: Implemented in: MSXML 3.0 and later.

See also

DOM 1 Core setNamedItem()method 
public function setNamedItem(arg:Node):Node

Introduced in: DOM 1 Core 

Adds (or replaces) a node by its nodeName.

Parameters

arg:Node — A node to store in this map. The node will later be accessible using the value of its nodeName attribute.

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

Throws
DOMException — WRONG_DOCUMENT_ERR: Raised if arg was created from a different document than the one that created this map.
 
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
 
DOMException — 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.
 
DOMException — 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.

See also

DOM 2 Core setNamedItemNS()method 
public function setNamedItemNS(arg:Node):Node

Introduced in: DOM 2 Core 

Adds (or replaces) a node by its localName and namespaceURI.

Parameters

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

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

Throws
DOMException — WRONG_DOCUMENT_ERR: Raised if arg was created from a different document than the one that created this map.
 
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
 
DOMException — 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.
 
DOMException — 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.
 
DOMException — NOT_SUPPORTED_ERR: May be raised if the implementation does not support the feature "XML" and the language exposed through the Document does not support XML Namespaces.

See also