TQDomNamedNodeMap(3qt)

NAME
TQDomNamedNodeMap - Collection of nodes that can be accessed by name

SYNOPSIS
All the functions in this class are reentrant when TQt is built with thread support.</p>

#include <tqdom.h>

  Public Members
TQDomNamedNodeMap ()
TQDomNamedNodeMap ( const TQDomNamedNodeMap & n )
TQDomNamedNodeMap & operator= ( const TQDomNamedNodeMap & n )
bool operator== ( const TQDomNamedNodeMap & n ) const
bool operator!= ( const TQDomNamedNodeMap & n ) const
~TQDomNamedNodeMap ()
TQDomNode namedItem ( const TQString & name ) const
TQDomNode setNamedItem ( const TQDomNode & newNode )
TQDomNode removeNamedItem ( const TQString & name )
TQDomNode item ( int index ) const
TQDomNode namedItemNS ( const TQString & nsURI, const TQString & localName ) const
TQDomNode setNamedItemNS ( const TQDomNode & newNode )
TQDomNode removeNamedItemNS ( const TQString & nsURI, const TQString & localName )
uint length () const
uint count () const
bool contains ( const TQString & name ) const

DESCRIPTION
The TQDomNamedNodeMap class contains a collection of nodes that can be accessed by name.

Note that TQDomNamedNodeMap does not inherit from TQDomNodeList. TQDomNamedNodeMaps do not provide any specific node ordering. Although nodes in a TQDomNamedNodeMap may be accessed by an ordinal index, this is simply to allow a convenient enumeration of the contents of a TQDomNamedNodeMap, and does not imply that the DOM specifies an ordering of the nodes.

The TQDomNamedNodeMap is used in three places: <ol type=1>

1   TQDomDocumentType::entities() returns a map of all entities described in the DTD.

2   TQDomDocumentType::notations() returns a map of all notations described in the DTD.

3   TQDomNode::attributes() returns a map of all attributes of an element.

Items in the map are identified by the name which TQDomNode::name() returns. Nodes are retrieved using namedItem(), namedItemNS() or item(). New nodes are inserted with setNamedItem() or setNamedItemNS() and removed with removeNamedItem() or removeNamedItemNS(). Use contains() to see if an item with the given name is in the named node map. The number of items is returned by length().

Terminology: in this class we use "item" and "node" interchangeably.

See also XML.

MEMBER FUNCTION DOCUMENTATION

TQDomNamedNodeMap::TQDomNamedNodeMap ()
Constructs an empty named node map.

TQDomNamedNodeMap::TQDomNamedNodeMap ( const TQDomNamedNodeMap & n )
Constructs a copy of n.

TQDomNamedNodeMap::~TQDomNamedNodeMap ()
Destroys the object and frees its resources.

bool TQDomNamedNodeMap::contains ( const TQString & name ) const
Returns true if the map contains a node called name; otherwise returns false.

uint TQDomNamedNodeMap::count () const
Returns the number of nodes in the map.

This function is the same as length().

TQDomNode TQDomNamedNodeMap::item ( int index ) const
Retrieves the node at position index.

This can be used to iterate over the map. Note that the nodes in the map are ordered arbitrarily.

See also length().

uint TQDomNamedNodeMap::length () const
Returns the number of nodes in the map.

See also item().

TQDomNode TQDomNamedNodeMap::namedItem ( const TQString & name ) const
Returns the node called name.

If the named node map does not contain such a node, a null node is returned. A node's name is the name returned by TQDomNode::nodeName().

See also setNamedItem() and namedItemNS().

TQDomNode TQDomNamedNodeMap::namedItemNS ( const TQString & nsURI, const TQString & localName ) const
Returns the node associated with the local name localName and the namespace URI nsURI.

If the map does not contain such a node, a null node is returned.

See also setNamedItemNS() and namedItem().

bool TQDomNamedNodeMap::operator!= ( const TQDomNamedNodeMap & n ) const
Returns true if n and this named node map are not equal; otherwise returns false.

TQDomNamedNodeMap & TQDomNamedNodeMap::operator= ( const TQDomNamedNodeMap & n )
Assigns n to this named node map.

bool TQDomNamedNodeMap::operator== ( const TQDomNamedNodeMap & n ) const
Returns true if n and this named node map are equal; otherwise returns false.

TQDomNode TQDomNamedNodeMap::removeNamedItem ( const TQString & name )
Removes the node called name from the map.

The function returns the removed node or a null node if the map did not contain a node called name.

See also setNamedItem(), namedItem(), and removeNamedItemNS().

TQDomNode TQDomNamedNodeMap::removeNamedItemNS ( const TQString & nsURI, const TQString & localName )
Removes the node with the local name localName and the namespace URI nsURI from the map.

The function returns the removed node or a null node if the map did not contain a node with the local name localName and the namespace URI nsURI.

See also setNamedItemNS(), namedItemNS(), and removeNamedItem().

TQDomNode TQDomNamedNodeMap::setNamedItem ( const TQDomNode & newNode )
Inserts the node newNode into the named node map. The name used by the map is the node name of newNode as returned by TQDomNode::nodeName().

If the new node replaces an existing node, i.e. the map contains a node with the same name, the replaced node is returned.

See also namedItem(), removeNamedItem(), and setNamedItemNS().

TQDomNode TQDomNamedNodeMap::setNamedItemNS ( const TQDomNode & newNode )
Inserts the node newNode in the map. If a node with the same namespace URI and the same local name already exists in the map, it is replaced by newNode. If the new node replaces an existing node, the replaced node is returned.

See also namedItemNS(), removeNamedItemNS(), and setNamedItem().

SEE ALSO
http://doc.trolltech.com/tqdomnamednodemap.html http://www.trolltech.com/faq/tech.html

COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.

AUTHOR
Generated automatically from the source code.

BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you.

The definitive TQt documentation is provided in HTML format; it is located at $TQTDIR/doc/html and can be read using TQt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech.

If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (tqdomnamednodemap.3qt) and the Qt version (3.3.8).