int | The number of nodes in this map. |
getNamedItem(java.lang.String name) Retrieves a node specified by name. | |
getNamedItemNS(java.lang.String namespaceURI, java.lang.String localName) Retrieves a node specified by local name and namespace URI. | |
item(int index) Returns the indexth item in the map. | |
removeNamedItem(java.lang.String name) Removes a node specified by name. | |
removeNamedItemNS(java.lang.String namespaceURI, java.lang.String localName) Removes a node specified by local name and namespace URI. | |
setNamedItem(Node arg) Adds a node using its nodeName attribute. | |
setNamedItemNS(Node arg) Adds a node using its namespaceURI and localName. |
public int getLength()
0
to length-1
inclusive.
public Node getNamedItem(java.lang.String name)
public Node getNamedItemNS(java.lang.String namespaceURI, java.lang.String localName)
public Node item(int index)
index
th item in the map. If index
is greater than or equal to the number of nodes in this map, this
returns null
.
public Node removeNamedItem(java.lang.String name)
DOMException
- NOT_FOUND_ERR: Raised if there is no node named name in
this map.public Node removeNamedItemNS(java.lang.String namespaceURI, java.lang.String localName)
Node
interface. If so, an attribute
immediately appears containing the default value as well as the
corresponding namespace URI, local name, and prefix when applicable.
DOMException
- NOT_FOUND_ERR: Raised if there is no node with the specified
namespaceURI and localName in this map.public Node setNamedItem(Node arg)
nodeName
attribute. If a node with
that name is already present in this map, it is replaced by the new
one.
nodeName
attribute is used to derive the name
which the node must be stored under, multiple nodes of certain types
(those that have a "special" string value) cannot be stored as the
names would clash. This is seen as preferable to allowing nodes to be
aliased.
DOMException
- WRONG_DOCUMENT_ERR: Raised if arg was created from a
different document than the one that created this map.public Node setNamedItemNS(Node arg)
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.
DOMException
- WRONG_DOCUMENT_ERR: Raised if arg was created from a
different document than the one that created this map.
NamedNodeMap
interface are used to represent collections of nodes that can be accessed by name. Note thatNamedNodeMap
does not inherit fromNodeList
;NamedNodeMaps
are not maintained in any particular order. Objects contained in an object implementingNamedNodeMap
may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of aNamedNodeMap
, 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 2 Core Specification.