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.
NamedNodeMap
objects in the DOM are live.
See also the Document Object Model (DOM) Level 3 Core Specification.
Modifier and Type | Method and Description |
---|---|
public int | |
public Node | Returns: ANode (of any type) with the specified
nodeName , or null if it does not identify
any node in this map.The name)nodeName of a node to retrieve.Retrieves a node specified by name. |
public Node | Returns: ANode (of any type) with the specified local
name and namespace URI, or null if they do not
identify any node in this map.The namespace URI of the node to retrieve. namespaceURI, String The local name of the node to retrieve. localName)Retrieves a node specified by local name and namespace URI. |
public Node | Returns: The node at theindex th position in the map, or
null if that is not a valid index.Index into this map. index)Returns the |
public Node | Returns: The node removed from this map if a node with such a name exists.The name)nodeName of the node to remove.Removes a node specified by name. |
public Node | Returns: The node removed from this map if a node with such a local name and namespace URI exists.The namespace URI of the node to remove. namespaceURI, String The local name of the node to remove. localName)Removes a node specified by local name and namespace URI. |
public Node | Returns: If the newNode replaces an existing node the
replaced Node is returned, otherwise null
is returned.A node to store in this map. The node will later be
accessible using the value of its arg)nodeName attribute.Adds a node using its |
public Node | Returns: If the newNode replaces an existing node the
replaced Node is returned, otherwise null
is returned.A node to store in this map. The node will later be
accessible using the value of its arg)namespaceURI and
localName attributes.Adds a node using its |
getLength | back to summary |
---|---|
public int getLength() The number of nodes in this map. The range of valid child node indices
is |
getNamedItem | back to summary |
---|---|
public Node getNamedItem(String name) Retrieves a node specified by name. |
getNamedItemNS | back to summary |
---|---|
public Node getNamedItemNS(String namespaceURI, String localName) throws DOMException Retrieves a node specified by local name and namespace URI.
|
item | back to summary |
---|---|
public Node item(int index) Returns the
|
removeNamedItem | back to summary |
---|---|
public Node removeNamedItem(String name) throws DOMException 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.
|
removeNamedItemNS | back to summary |
---|---|
public Node removeNamedItemNS(String namespaceURI, String localName) throws DOMException Removes a node specified by local name and namespace URI. A removed
attribute may be known to have a default value when this map contains
the attributes attached to an element, as returned by the attributes
attribute of the
|
setNamedItem | back to summary |
---|---|
public Node setNamedItem(Node arg) throws DOMException Adds a node using its
|
setNamedItemNS | back to summary |
---|---|
public Node setNamedItemNS(Node arg) throws DOMException Adds a node using its
|