NamedNodeMap
s are used to
represent collections of nodes that can be accessed by name
![]() | @Comparisons | ||||||
![]() | Constructors and assignment operator
| ||||||
![]() | Destructor.
| ||||||
![]() | Functions to change the node collection.
| ||||||
![]() | Get functions.
| ||||||
![]() | Set functions.
|
NamedNodeMap
s are used to represent collections of nodes that can be accessed by name. Note thatNamedNodeMap
does not inherit fromNodeList
;NamedNodeMap
s are not maintained in any particular order. Nodes contained in aNamedNodeMap
may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents, and does not imply that the DOM specifies an order to these Nodes.
DOM_NamedNodeMap(const DOM_NamedNodeMap &other)
DOM_NamedNodeMap
reference object
that refers to the same underlying NamedNodeMap as the original.
DOM_NamedNodeMap& operator = (const DOM_NamedNodeMap &other)
Like most other DOM types in this implementation, memory management of named node maps is automatic. Instances of DOM_NamedNodeMap function as references to an underlying heap based implementation object, and should never be explicitly new-ed or deleted in application code, but should appear only as local variables or function parameters.
Set functions.
DOM_Node setNamedItem(DOM_Node arg)
nodeName
.
As the 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.
arg
was created from a
different document than the one that created the
NamedNodeMap
.
NO_MODIFICATION_ALLOWED_ERR: Raised if this
NamedNodeMap
is readonly.
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.Node
replaces an existing node with the
same name the previously existing Node
is returned,
otherwise null
is returned.
nodeName
attribute of
the node. If a node with that name is already present in the map, it
is replaced by the new one.
DOM_Node item(int index)
index
th item in the map.
If index
is greater than or equal to the number of nodes in the map, this returns
null
.
index
th position in the
NamedNodeMap
, or null
if that is not a valid
index.
Get functions.
DOM_Node getNamedItem(const DOMString &name)
Node
(of any type) with the specified name, or
null DOM_Node
if the specified name did not identify any node in
the map.
int getLength()
length-1
inclusive.
Functions to change the node collection.
DOM_Node removeNamedItem(const DOMString &name)
Attr
with a default value it is immediately replaced.
name
in
the map.null
if no node
with such a name exists.
alphabetic index hierarchy of classes
XML Parser for C++ 2.0 Copyright © IBM Corp, 1999 Center for Java Technology 10275 N. De Anza Blvd. Cupertino CA 95014 USA Email: xml4c@us.ibm.com |
|