#include <DomNamedNodeMap.h>
DomNamedNodeMap
s are used to represent collections of nodes that can be accessed by name.
Note that DomNamedNodeMap
does not inherit from DomNodeList
. DomNamedNodeMap
s are not maintained in any particular order. Nodes contained in a DomNamedNodeMap
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.
Public Member Functions | |
DomNamedNodeMap () | |
ctor | |
DomNamedNodeMap (const DomNamedNodeMap ©) | |
copy ctor | |
virtual | ~DomNamedNodeMap () |
dtor | |
const DomNamedNodeMap & | operator= (const DomNamedNodeMap &assign) |
assign | |
DOM Level 1 | |
DomNode | setNamedItem (const DomNode &arg) |
Adds a node using its nodeName attribute. | |
DomNode | getItem (XmlSize index) const |
Returns the index'th item in the map. | |
DomNode | getNamedItem (const DomString &name) const |
Retrieves a node specified by name. | |
XmlSize | getLength () const |
The number of nodes in the map. | |
DomNode | removeNamedItem (const DomString &name) |
Removes a node specified by name. | |
DOM Level 2 | |
DomNode | getNamedItemNS (const DomString &namespaceURI, const DomString &localName) const |
Retrieves a node specified by local name and namespace URI. | |
DomNode | setNamedItemNS (const DomNode &arg) |
Adds a node using its namespaceURI and localName. | |
DomNode | removeNamedItemNS (const DomString &namespaceURI, const DomString &localName) |
Removes a node specified by local name and namespace URI. | |
Extensions | |
bool | isNull () const |
Check if this map is a "null" map. |
xmldom::DomNamedNodeMap::DomNamedNodeMap | ( | ) |
ctor
xmldom::DomNamedNodeMap::DomNamedNodeMap | ( | const DomNamedNodeMap & | copy | ) |
copy ctor
xmldom::DomNamedNodeMap::~DomNamedNodeMap | ( | ) | [virtual] |
dtor
const DomNamedNodeMap & xmldom::DomNamedNodeMap::operator= | ( | const DomNamedNodeMap & | assign | ) |
assign
Adds a node using its nodeName attribute.
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 | A node to store in a named node map. The node will later be accessible using the value of the nodeName attribute of the node. If a node with that name is already present in the map, it is replaced by the new one. |
DomNode xmldom::DomNamedNodeMap::getItem | ( | XmlSize | index | ) | const |
Returns the 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 | Index into the map. |
Retrieves a node specified by name.
name | The nodeName of a node to retrieve. |
XmlSize xmldom::DomNamedNodeMap::getLength | ( | ) | const |
The number of nodes in the map.
The range of valid child node indices is 0 to length-1 inclusive.
Removes a node specified by name.
If the removed node is an DomAttribute with a default value it is immediately replaced.
name | The nodeName of a node to remove. |
DomNode xmldom::DomNamedNodeMap::getNamedItemNS | ( | const DomString & | namespaceURI, | |
const DomString & | localName | |||
) | const |
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. |
Adds a node using its namespaceURI and localName.
arg | A node to store in a named node map. The node will later be accessible using the value of the namespaceURI and localName attribute of the node. If a node with those namespace URI and local name is already present in the map, it is replaced by the new one. |
DomNode xmldom::DomNamedNodeMap::removeNamedItemNS | ( | const DomString & | namespaceURI, | |
const DomString & | localName | |||
) |
Removes a node specified by local name and namespace URI.
namespaceURI | The namespace URI of the node to remove. | |
localName | The local name of the node to remove. When this DomNamedNodeMap contains the attributes attached to an element, as returned by the attributes attribute of the DomNode interface, 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. |
bool xmldom::DomNamedNodeMap::isNull | ( | ) | const |
Check if this map is a "null" map.