<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt - 3.3.8 - espenr - 2499/qt - x11 - free - 3.3.8/src/xml/qdom.cpp:1528 -->
< html >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=ISO-8859-1" >
< title > TQDomNode Class< / title >
< style type = "text/css" > < ! - -
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
-->< / style >
< / head >
< body >
< table border = "0" cellpadding = "0" cellspacing = "0" width = "100%" >
< tr bgcolor = "#E5E5E5" >
< td valign = center >
< a href = "index.html" >
< font color = "#004faf" > Home< / font > < / a >
| < a href = "classes.html" >
< font color = "#004faf" > All Classes< / font > < / a >
| < a href = "mainclasses.html" >
< font color = "#004faf" > Main Classes< / font > < / a >
| < a href = "annotated.html" >
< font color = "#004faf" > Annotated< / font > < / a >
| < a href = "groups.html" >
< font color = "#004faf" > Grouped Classes< / font > < / a >
| < a href = "functions.html" >
< font color = "#004faf" > Functions< / font > < / a >
< / td >
< td align = "right" valign = "center" > < img src = "logo32.png" align = "right" width = "64" height = "32" border = "0" > < / td > < / tr > < / table > < h1 align = center > TQDomNode Class Reference< br > < small > [< a href = "xml.html" > XML module< / a > ]< / small > < / h1 >
< p > The TQDomNode class is the base class for all the nodes in a DOM tree.
< a href = "#details" > More...< / a >
< p > All the functions in this class are < a href = "threads.html#reentrant" > reentrant< / a > when TQt is built with thread support.< / p >
< p > < tt > #include < < a href = "qdom-h.html" > ntqdom.h< / a > > < / tt >
< p > Inherited by < a href = "qdomdocumenttype.html" > TQDomDocumentType< / a > , < a href = "qdomdocument.html" > TQDomDocument< / a > , < a href = "qdomdocumentfragment.html" > TQDomDocumentFragment< / a > , < a href = "qdomcharacterdata.html" > TQDomCharacterData< / a > , < a href = "qdomattr.html" > TQDomAttr< / a > , < a href = "qdomelement.html" > TQDomElement< / a > , < a href = "qdomnotation.html" > TQDomNotation< / a > , < a href = "qdomentity.html" > TQDomEntity< / a > , < a href = "qdomentityreference.html" > TQDomEntityReference< / a > , and < a href = "qdomprocessinginstruction.html" > TQDomProcessingInstruction< / a > .
< p > < a href = "qdomnode-members.html" > List of all member functions.< / a >
< h2 > Public Members< / h2 >
< ul >
< li class = fn > enum < a href = "#NodeType-enum" > < b > NodeType< / b > < / a > { ElementNode = 1, AttributeNode = 2, TextNode = 3, CDATASectionNode = 4, EntityReferenceNode = 5, EntityNode = 6, ProcessingInstructionNode = 7, CommentNode = 8, DocumentNode = 9, DocumentTypeNode = 10, DocumentFragmentNode = 11, NotationNode = 12, BaseNode = 21, CharacterDataNode = 22 }< / li >
< li class = fn > < a href = "#TQDomNode" > < b > TQDomNode< / b > < / a > ()< / li >
< li class = fn > < a href = "#TQDomNode-2" > < b > TQDomNode< / b > < / a > ( const TQDomNode & n )< / li >
< li class = fn > TQDomNode & < a href = "#operator-eq" > < b > operator=< / b > < / a > ( const TQDomNode & n )< / li >
< li class = fn > bool < a href = "#operator-eq-eq" > < b > operator==< / b > < / a > ( const TQDomNode & n ) const< / li >
< li class = fn > bool < a href = "#operator!-eq" > < b > operator!=< / b > < / a > ( const TQDomNode & n ) const< / li >
< li class = fn > virtual < a href = "#~TQDomNode" > < b > ~TQDomNode< / b > < / a > ()< / li >
< li class = fn > virtual TQDomNode < a href = "#insertBefore" > < b > insertBefore< / b > < / a > ( const TQDomNode & newChild, const TQDomNode & refChild )< / li >
< li class = fn > virtual TQDomNode < a href = "#insertAfter" > < b > insertAfter< / b > < / a > ( const TQDomNode & newChild, const TQDomNode & refChild )< / li >
< li class = fn > virtual TQDomNode < a href = "#replaceChild" > < b > replaceChild< / b > < / a > ( const TQDomNode & newChild, const TQDomNode & oldChild )< / li >
< li class = fn > virtual TQDomNode < a href = "#removeChild" > < b > removeChild< / b > < / a > ( const TQDomNode & oldChild )< / li >
< li class = fn > virtual TQDomNode < a href = "#appendChild" > < b > appendChild< / b > < / a > ( const TQDomNode & newChild )< / li >
< li class = fn > virtual bool < a href = "#hasChildNodes" > < b > hasChildNodes< / b > < / a > () const< / li >
< li class = fn > virtual TQDomNode < a href = "#cloneNode" > < b > cloneNode< / b > < / a > ( bool deep = TRUE ) const< / li >
< li class = fn > virtual void < a href = "#normalize" > < b > normalize< / b > < / a > ()< / li >
< li class = fn > virtual bool < a href = "#isSupported" > < b > isSupported< / b > < / a > ( const TQString & feature, const TQString & version ) const< / li >
< li class = fn > virtual TQString < a href = "#nodeName" > < b > nodeName< / b > < / a > () const< / li >
< li class = fn > virtual TQDomNode::NodeType < a href = "#nodeType" > < b > nodeType< / b > < / a > () const< / li >
< li class = fn > virtual TQDomNode < a href = "#parentNode" > < b > parentNode< / b > < / a > () const< / li >
< li class = fn > virtual TQDomNodeList < a href = "#childNodes" > < b > childNodes< / b > < / a > () const< / li >
< li class = fn > virtual TQDomNode < a href = "#firstChild" > < b > firstChild< / b > < / a > () const< / li >
< li class = fn > virtual TQDomNode < a href = "#lastChild" > < b > lastChild< / b > < / a > () const< / li >
< li class = fn > virtual TQDomNode < a href = "#previousSibling" > < b > previousSibling< / b > < / a > () const< / li >
< li class = fn > virtual TQDomNode < a href = "#nextSibling" > < b > nextSibling< / b > < / a > () const< / li >
< li class = fn > virtual TQDomNamedNodeMap < a href = "#attributes" > < b > attributes< / b > < / a > () const< / li >
< li class = fn > virtual TQDomDocument < a href = "#ownerDocument" > < b > ownerDocument< / b > < / a > () const< / li >
< li class = fn > virtual TQString < a href = "#namespaceURI" > < b > namespaceURI< / b > < / a > () const< / li >
< li class = fn > virtual TQString < a href = "#localName" > < b > localName< / b > < / a > () const< / li >
< li class = fn > virtual bool < a href = "#hasAttributes" > < b > hasAttributes< / b > < / a > () const< / li >
< li class = fn > virtual TQString < a href = "#nodeValue" > < b > nodeValue< / b > < / a > () const< / li >
< li class = fn > virtual void < a href = "#setNodeValue" > < b > setNodeValue< / b > < / a > ( const TQString & v )< / li >
< li class = fn > virtual TQString < a href = "#prefix" > < b > prefix< / b > < / a > () const< / li >
< li class = fn > virtual void < a href = "#setPrefix" > < b > setPrefix< / b > < / a > ( const TQString & pre )< / li >
< li class = fn > virtual bool < a href = "#isAttr" > < b > isAttr< / b > < / a > () const< / li >
< li class = fn > virtual bool < a href = "#isCDATASection" > < b > isCDATASection< / b > < / a > () const< / li >
< li class = fn > virtual bool < a href = "#isDocumentFragment" > < b > isDocumentFragment< / b > < / a > () const< / li >
< li class = fn > virtual bool < a href = "#isDocument" > < b > isDocument< / b > < / a > () const< / li >
< li class = fn > virtual bool < a href = "#isDocumentType" > < b > isDocumentType< / b > < / a > () const< / li >
< li class = fn > virtual bool < a href = "#isElement" > < b > isElement< / b > < / a > () const< / li >
< li class = fn > virtual bool < a href = "#isEntityReference" > < b > isEntityReference< / b > < / a > () const< / li >
< li class = fn > virtual bool < a href = "#isText" > < b > isText< / b > < / a > () const< / li >
< li class = fn > virtual bool < a href = "#isEntity" > < b > isEntity< / b > < / a > () const< / li >
< li class = fn > virtual bool < a href = "#isNotation" > < b > isNotation< / b > < / a > () const< / li >
< li class = fn > virtual bool < a href = "#isProcessingInstruction" > < b > isProcessingInstruction< / b > < / a > () const< / li >
< li class = fn > virtual bool < a href = "#isCharacterData" > < b > isCharacterData< / b > < / a > () const< / li >
< li class = fn > virtual bool < a href = "#isComment" > < b > isComment< / b > < / a > () const< / li >
< li class = fn > TQDomNode < a href = "#namedItem" > < b > namedItem< / b > < / a > ( const TQString & name ) const< / li >
< li class = fn > bool < a href = "#isNull" > < b > isNull< / b > < / a > () const< / li >
< li class = fn > void < a href = "#clear" > < b > clear< / b > < / a > ()< / li >
< li class = fn > TQDomAttr < a href = "#toAttr" > < b > toAttr< / b > < / a > ()< / li >
< li class = fn > TQDomCDATASection < a href = "#toCDATASection" > < b > toCDATASection< / b > < / a > ()< / li >
< li class = fn > TQDomDocumentFragment < a href = "#toDocumentFragment" > < b > toDocumentFragment< / b > < / a > ()< / li >
< li class = fn > TQDomDocument < a href = "#toDocument" > < b > toDocument< / b > < / a > ()< / li >
< li class = fn > TQDomDocumentType < a href = "#toDocumentType" > < b > toDocumentType< / b > < / a > ()< / li >
< li class = fn > TQDomElement < a href = "#toElement" > < b > toElement< / b > < / a > ()< / li >
< li class = fn > TQDomEntityReference < a href = "#toEntityReference" > < b > toEntityReference< / b > < / a > ()< / li >
< li class = fn > TQDomText < a href = "#toText" > < b > toText< / b > < / a > ()< / li >
< li class = fn > TQDomEntity < a href = "#toEntity" > < b > toEntity< / b > < / a > ()< / li >
< li class = fn > TQDomNotation < a href = "#toNotation" > < b > toNotation< / b > < / a > ()< / li >
< li class = fn > TQDomProcessingInstruction < a href = "#toProcessingInstruction" > < b > toProcessingInstruction< / b > < / a > ()< / li >
< li class = fn > TQDomCharacterData < a href = "#toCharacterData" > < b > toCharacterData< / b > < / a > ()< / li >
< li class = fn > TQDomComment < a href = "#toComment" > < b > toComment< / b > < / a > ()< / li >
< li class = fn > void < a href = "#save" > < b > save< / b > < / a > ( TQTextStream & str, int indent ) const< / li >
< / ul >
< h2 > Related Functions< / h2 >
< ul >
< li class = fn > TQTextStream & < a href = "#operator-lt-lt" > < b > operator< < < / b > < / a > ( TQTextStream & str, const TQDomNode & node )< / li >
< / ul >
< hr > < a name = "details" > < / a > < h2 > Detailed Description< / h2 >
The TQDomNode class is the base class for all the nodes in a DOM tree.
< p >
< p > Many functions in the DOM return a TQDomNode.
< p > You can find out the type of a node using < a href = "#isAttr" > isAttr< / a > (),
< a href = "#isCDATASection" > isCDATASection< / a > (), < a href = "#isDocumentFragment" > isDocumentFragment< / a > (), < a href = "#isDocument" > isDocument< / a > (),
< a href = "#isDocumentType" > isDocumentType< / a > (), < a href = "#isElement" > isElement< / a > (), < a href = "#isEntityReference" > isEntityReference< / a > (), < a href = "#isText" > isText< / a > (),
< a href = "#isEntity" > isEntity< / a > (), < a href = "#isNotation" > isNotation< / a > (), < a href = "#isProcessingInstruction" > isProcessingInstruction< / a > (),
< a href = "#isCharacterData" > isCharacterData< / a > () and < a href = "#isComment" > isComment< / a > ().
< p > A TQDomNode can be converted into one of its subclasses using
< a href = "#toAttr" > toAttr< / a > (), < a href = "#toCDATASection" > toCDATASection< / a > (), < a href = "#toDocumentFragment" > toDocumentFragment< / a > (), < a href = "#toDocument" > toDocument< / a > (),
< a href = "#toDocumentType" > toDocumentType< / a > (), < a href = "#toElement" > toElement< / a > (), < a href = "#toEntityReference" > toEntityReference< / a > (), < a href = "#toText" > toText< / a > (),
< a href = "#toEntity" > toEntity< / a > (), < a href = "#toNotation" > toNotation< / a > (), < a href = "#toProcessingInstruction" > toProcessingInstruction< / a > (),
< a href = "#toCharacterData" > toCharacterData< / a > () or < a href = "#toComment" > toComment< / a > (). You can convert a node to a null
node with < a href = "#clear" > clear< / a > ().
< p > Copies of the TQDomNode class share their data using < a href = "shclass.html#explicit-sharing" > explicit sharing< / a > . This means that modifying one node will change all
copies. This is especially useful in combination with functions
which return a TQDomNode, e.g. < a href = "#firstChild" > firstChild< / a > (). You can make an
independent (deep) copy of the node with < a href = "#cloneNode" > cloneNode< / a > ().
< p > Nodes are inserted with < a href = "#insertBefore" > insertBefore< / a > (), < a href = "#insertAfter" > insertAfter< / a > () or
< a href = "#appendChild" > appendChild< / a > (). You can replace one node with another using
< a href = "#replaceChild" > replaceChild< / a > () and remove a node with < a href = "#removeChild" > removeChild< / a > ().
< p > To traverse nodes use firstChild() to get a node's first child (if
any), and < a href = "#nextSibling" > nextSibling< / a > () to traverse. TQDomNode also provides
< a href = "#lastChild" > lastChild< / a > (), < a href = "#previousSibling" > previousSibling< / a > () and < a href = "#parentNode" > parentNode< / a > (). To find the first
child node with a particular node name use < a href = "#namedItem" > namedItem< / a > ().
< p > To find out if a node has children use < a href = "#hasChildNodes" > hasChildNodes< / a > () and to get
a list of all of a node's children use < a href = "#childNodes" > childNodes< / a > ().
< p > The node's name and value (the meaning of which varies depending
on its type) is returned by < a href = "#nodeName" > nodeName< / a > () and < a href = "#nodeValue" > nodeValue< / a > ()
respectively. The node's type is returned by < a href = "#nodeType" > nodeType< / a > (). The
node's value can be set with < a href = "#setNodeValue" > setNodeValue< / a > ().
< p > The document to which the node belongs is returned by
< a href = "#ownerDocument" > ownerDocument< / a > ().
< p > Adjacent < a href = "qdomtext.html" > TQDomText< / a > nodes can be merged into a single node with
< a href = "#normalize" > normalize< / a > ().
< p > < a href = "qdomelement.html" > TQDomElement< / a > nodes have attributes which can be retrieved with
< a href = "#attributes" > attributes< / a > ().
< p > < a href = "qdomelement.html" > TQDomElement< / a > and < a href = "qdomattr.html" > TQDomAttr< / a > nodes can have namespaces which can be
retrieved with < a href = "#namespaceURI" > namespaceURI< / a > (). Their local name is retrieved with
< a href = "#localName" > localName< / a > (), and their prefix with < a href = "#prefix" > prefix< / a > (). The prefix can be set
with < a href = "#setPrefix" > setPrefix< / a > ().
< p > You can write the XML representation of the node to a text stream
with < a href = "#save" > save< / a > ().
< p > The following example looks for the first element in an XML document and
prints the names of all the elements that are its direct children.
< pre >
< a href = "qdomdocument.html" > TQDomDocument< / a > d;
d.< a href = "qdomdocument.html#setContent" > setContent< / a > ( someXML );
TQDomNode n = d.< a href = "#firstChild" > firstChild< / a > ();
while ( !n.< a href = "#isNull" > isNull< / a > () ) {
if ( n.< a href = "#isElement" > isElement< / a > () ) {
< a href = "qdomelement.html" > TQDomElement< / a > e = n.< a href = "#toElement" > toElement< / a > ();
cout < < "Element name: " < < e.< a href = "qdomelement.html#tagName" > tagName< / a > () < < endl;
break;
}
n = n.< a href = "#nextSibling" > nextSibling< / a > ();
}
< / pre >
< p > For further information about the Document Object Model see < a href = "http://www.w3.org/TR/REC-DOM-Level-1/" > http://www.w3.org/TR/REC-DOM-Level-1/< / a > and < a href = "http://www.w3.org/TR/DOM-Level-2-Core/" > http://www.w3.org/TR/DOM-Level-2-Core/< / a > . For a more general
introduction of the DOM implementation see the < a href = "qdomdocument.html" > TQDomDocument< / a >
documentation.
< p > See also < a href = "xml-tools.html" > XML< / a > .
< hr > < h2 > Member Type Documentation< / h2 >
< h3 class = fn > < a name = "NodeType-enum" > < / a > TQDomNode::NodeType< / h3 >
< p > This enum defines the type of the node:
< ul >
< li > < tt > TQDomNode::ElementNode< / tt >
< li > < tt > TQDomNode::AttributeNode< / tt >
< li > < tt > TQDomNode::TextNode< / tt >
< li > < tt > TQDomNode::CDATASectionNode< / tt >
< li > < tt > TQDomNode::EntityReferenceNode< / tt >
< li > < tt > TQDomNode::EntityNode< / tt >
< li > < tt > TQDomNode::ProcessingInstructionNode< / tt >
< li > < tt > TQDomNode::CommentNode< / tt >
< li > < tt > TQDomNode::DocumentNode< / tt >
< li > < tt > TQDomNode::DocumentTypeNode< / tt >
< li > < tt > TQDomNode::DocumentFragmentNode< / tt >
< li > < tt > TQDomNode::NotationNode< / tt >
< li > < tt > TQDomNode::BaseNode< / tt > - A TQDomNode object, i.e. not a TQDomNode subclass.
< li > < tt > TQDomNode::CharacterDataNode< / tt >
< / ul >
< hr > < h2 > Member Function Documentation< / h2 >
< h3 class = fn > < a name = "TQDomNode" > < / a > TQDomNode::TQDomNode ()
< / h3 >
Constructs a < a href = "#isNull" > null< / a > node.
< h3 class = fn > < a name = "TQDomNode-2" > < / a > TQDomNode::TQDomNode ( const < a href = "qdomnode.html" > TQDomNode< / a > & n )
< / h3 >
Constructs a copy of < em > n< / em > .
< p > The data of the copy is shared (shallow copy): modifying one node
will also change the other. If you want to make a < a href = "shclass.html#deep-copy" > deep copy< / a > , use
< a href = "#cloneNode" > cloneNode< / a > ().
< h3 class = fn > < a name = "~TQDomNode" > < / a > TQDomNode::~TQDomNode ()< tt > [virtual]< / tt >
< / h3 >
Destroys the object and frees its resources.
< h3 class = fn > < a href = "qdomnode.html" > TQDomNode< / a > < a name = "appendChild" > < / a > TQDomNode::appendChild ( const < a href = "qdomnode.html" > TQDomNode< / a > & newChild )< tt > [virtual]< / tt >
< / h3 >
Appends < em > newChild< / em > as the node's last child.
< p > If < em > newChild< / em > is the child of another node, it is reparented to
this node. If < em > newChild< / em > is a child of this node, then its
position in the list of children is changed.
< p > If < em > newChild< / em > is a < a href = "qdomdocumentfragment.html" > TQDomDocumentFragment< / a > , then the children of the
fragment are removed from the fragment and appended.
< p > Returns a new reference to < em > newChild< / em > .
< p > < p > See also < a href = "#insertBefore" > insertBefore< / a > (), < a href = "#insertAfter" > insertAfter< / a > (), < a href = "#replaceChild" > replaceChild< / a > (), and < a href = "#removeChild" > removeChild< / a > ().
< h3 class = fn > < a href = "qdomnamednodemap.html" > TQDomNamedNodeMap< / a > < a name = "attributes" > < / a > TQDomNode::attributes () const< tt > [virtual]< / tt >
< / h3 >
Returns a named node map of all attributes. Attributes are only
provided for < a href = "qdomelement.html" > TQDomElement< / a > s.
< p > Changing the attributes in the map will also change the attributes
of this TQDomNode.
< p > Reimplemented in < a href = "qdomelement.html#attributes" > TQDomElement< / a > .
< h3 class = fn > < a href = "qdomnodelist.html" > TQDomNodeList< / a > < a name = "childNodes" > < / a > TQDomNode::childNodes () const< tt > [virtual]< / tt >
< / h3 >
Returns a list of all direct child nodes.
< p > Most often you will call this function on a < a href = "qdomelement.html" > TQDomElement< / a > object.
< p > For example, if the XML document looks like this:
< pre >
< body>
< h1> Heading< /h1>
< p> Hello < b> you< /b> < /p>
< /body>
< / pre >
Then the list of child nodes for the "body"-element will contain
the node created by the < h1> tag and the node created by the
< p> tag.
< p > The nodes in the list are not copied; so changing the nodes in the
list will also change the children of this node.
< p > < p > See also < a href = "#firstChild" > firstChild< / a > () and < a href = "#lastChild" > lastChild< / a > ().
< h3 class = fn > void < a name = "clear" > < / a > TQDomNode::clear ()
< / h3 >
Converts the node into a null node; if it was not a null node
before, its type and contents are deleted.
< p > < p > See also < a href = "#isNull" > isNull< / a > ().
< h3 class = fn > < a href = "qdomnode.html" > TQDomNode< / a > < a name = "cloneNode" > < / a > TQDomNode::cloneNode ( bool deep = TRUE ) const< tt > [virtual]< / tt >
< / h3 >
Creates a deep (not shallow) copy of the TQDomNode.
< p > If < em > deep< / em > is TRUE, then the cloning is done recursively which
means that all the node's children are deep copied too. If < em > deep< / em >
is FALSE only the node itself is copied and the copy will have no
child nodes.
< h3 class = fn > < a href = "qdomnode.html" > TQDomNode< / a > < a name = "firstChild" > < / a > TQDomNode::firstChild () const< tt > [virtual]< / tt >
< / h3 >
Returns the first child of the node. If there is no child node, a
< a href = "#isNull" > null node< / a > is returned. Changing the
returned node will also change the node in the document tree.
< p > < p > See also < a href = "#lastChild" > lastChild< / a > () and < a href = "#childNodes" > childNodes< / a > ().
< p > Example: < a href = "outliner-example.html#x1907" > xml/outliner/outlinetree.cpp< / a > .
< h3 class = fn > bool < a name = "hasAttributes" > < / a > TQDomNode::hasAttributes () const< tt > [virtual]< / tt >
< / h3 >
Returns TRUE if the node has attributes; otherwise returns FALSE.
< p > < p > See also < a href = "#attributes" > attributes< / a > ().
< h3 class = fn > bool < a name = "hasChildNodes" > < / a > TQDomNode::hasChildNodes () const< tt > [virtual]< / tt >
< / h3 >
Returns TRUE if the node has one or more children; otherwise
returns FALSE.
< h3 class = fn > < a href = "qdomnode.html" > TQDomNode< / a > < a name = "insertAfter" > < / a > TQDomNode::insertAfter ( const < a href = "qdomnode.html" > TQDomNode< / a > & newChild, const < a href = "qdomnode.html" > TQDomNode< / a > & refChild )< tt > [virtual]< / tt >
< / h3 >
Inserts the node < em > newChild< / em > after the child node < em > refChild< / em > . < em > refChild< / em > must be a direct child of this node. If < em > refChild< / em > is
< a href = "#isNull" > null< / a > then < em > newChild< / em > is appended as this
node's last child.
< p > If < em > newChild< / em > is the child of another node, it is reparented to
this node. If < em > newChild< / em > is a child of this node, then its
position in the list of children is changed.
< p > If < em > newChild< / em > is a < a href = "qdomdocumentfragment.html" > TQDomDocumentFragment< / a > , then the children of the
fragment are removed from the fragment and inserted after < em > refChild< / em > .
< p > Returns a new reference to < em > newChild< / em > on success or a < a href = "#isNull" > null node< / a > on failure.
< p > < p > See also < a href = "#insertBefore" > insertBefore< / a > (), < a href = "#replaceChild" > replaceChild< / a > (), < a href = "#removeChild" > removeChild< / a > (), and < a href = "#appendChild" > appendChild< / a > ().
< h3 class = fn > < a href = "qdomnode.html" > TQDomNode< / a > < a name = "insertBefore" > < / a > TQDomNode::insertBefore ( const < a href = "qdomnode.html" > TQDomNode< / a > & newChild, const < a href = "qdomnode.html" > TQDomNode< / a > & refChild )< tt > [virtual]< / tt >
< / h3 >
Inserts the node < em > newChild< / em > before the child node < em > refChild< / em > .
< em > refChild< / em > must be a direct child of this node. If < em > refChild< / em > is
< a href = "#isNull" > null< / a > then < em > newChild< / em > is inserted as the
node's first child.
< p > If < em > newChild< / em > is the child of another node, it is reparented to
this node. If < em > newChild< / em > is a child of this node, then its
position in the list of children is changed.
< p > If < em > newChild< / em > is a < a href = "qdomdocumentfragment.html" > TQDomDocumentFragment< / a > , then the children of the
fragment are removed from the fragment and inserted before < em > refChild< / em > .
< p > Returns a new reference to < em > newChild< / em > on success or a < a href = "#isNull" > null node< / a > on failure.
< p > < p > See also < a href = "#insertAfter" > insertAfter< / a > (), < a href = "#replaceChild" > replaceChild< / a > (), < a href = "#removeChild" > removeChild< / a > (), and < a href = "#appendChild" > appendChild< / a > ().
< h3 class = fn > bool < a name = "isAttr" > < / a > TQDomNode::isAttr () const< tt > [virtual]< / tt >
< / h3 >
Returns TRUE if the node is an attribute; otherwise returns FALSE.
< p > If this function returns TRUE, it does not imply that this object
is a TQDomAttribute; you can get the TQDomAttribute with
toAttribute().
< p > < p > See also < a href = "#toAttr" > toAttr< / a > ().
< p > Reimplemented in < a href = "qdomattr.html#isAttr" > TQDomAttr< / a > .
< h3 class = fn > bool < a name = "isCDATASection" > < / a > TQDomNode::isCDATASection () const< tt > [virtual]< / tt >
< / h3 >
Returns TRUE if the node is a CDATA section; otherwise returns
FALSE.
< p > If this function returns TRUE, it does not imply that this object
is a < a href = "qdomcdatasection.html" > TQDomCDATASection< / a > ; you can get the TQDomCDATASection with
< a href = "#toCDATASection" > toCDATASection< / a > ().
< p > < p > See also < a href = "#toCDATASection" > toCDATASection< / a > ().
< p > Reimplemented in < a href = "qdomcdatasection.html#isCDATASection" > TQDomCDATASection< / a > .
< h3 class = fn > bool < a name = "isCharacterData" > < / a > TQDomNode::isCharacterData () const< tt > [virtual]< / tt >
< / h3 >
Returns TRUE if the node is a character data node; otherwise
returns FALSE.
< p > If this function returns TRUE, it does not imply that this object
is a < a href = "qdomcharacterdata.html" > TQDomCharacterData< / a > ; you can get the TQDomCharacterData with
< a href = "#toCharacterData" > toCharacterData< / a > ().
< p > < p > See also < a href = "#toCharacterData" > toCharacterData< / a > ().
< p > Reimplemented in < a href = "qdomcharacterdata.html#isCharacterData" > TQDomCharacterData< / a > .
< h3 class = fn > bool < a name = "isComment" > < / a > TQDomNode::isComment () const< tt > [virtual]< / tt >
< / h3 >
Returns TRUE if the node is a comment; otherwise returns FALSE.
< p > If this function returns TRUE, it does not imply that this object
is a < a href = "qdomcomment.html" > TQDomComment< / a > ; you can get the TQDomComment with < a href = "#toComment" > toComment< / a > ().
< p > < p > See also < a href = "#toComment" > toComment< / a > ().
< p > Reimplemented in < a href = "qdomcomment.html#isComment" > TQDomComment< / a > .
< h3 class = fn > bool < a name = "isDocument" > < / a > TQDomNode::isDocument () const< tt > [virtual]< / tt >
< / h3 >
Returns TRUE if the node is a document; otherwise returns FALSE.
< p > If this function returns TRUE, it does not imply that this object
is a < a href = "qdomdocument.html" > TQDomDocument< / a > ; you can get the TQDomDocument with < a href = "#toDocument" > toDocument< / a > ().
< p > < p > See also < a href = "#toDocument" > toDocument< / a > ().
< p > Reimplemented in < a href = "qdomdocument.html#isDocument" > TQDomDocument< / a > .
< h3 class = fn > bool < a name = "isDocumentFragment" > < / a > TQDomNode::isDocumentFragment () const< tt > [virtual]< / tt >
< / h3 >
Returns TRUE if the node is a document fragment; otherwise returns
FALSE.
< p > If this function returns TRUE, it does not imply that this object
is a < a href = "qdomdocumentfragment.html" > TQDomDocumentFragment< / a > ; you can get the TQDomDocumentFragment
with < a href = "#toDocumentFragment" > toDocumentFragment< / a > ().
< p > < p > See also < a href = "#toDocumentFragment" > toDocumentFragment< / a > ().
< p > Reimplemented in < a href = "qdomdocumentfragment.html#isDocumentFragment" > TQDomDocumentFragment< / a > .
< h3 class = fn > bool < a name = "isDocumentType" > < / a > TQDomNode::isDocumentType () const< tt > [virtual]< / tt >
< / h3 >
Returns TRUE if the node is a document type; otherwise returns
FALSE.
< p > If this function returns TRUE, it does not imply that this object
is a < a href = "qdomdocumenttype.html" > TQDomDocumentType< / a > ; you can get the TQDomDocumentType with
< a href = "#toDocumentType" > toDocumentType< / a > ().
< p > < p > See also < a href = "#toDocumentType" > toDocumentType< / a > ().
< p > Reimplemented in < a href = "qdomdocumenttype.html#isDocumentType" > TQDomDocumentType< / a > .
< h3 class = fn > bool < a name = "isElement" > < / a > TQDomNode::isElement () const< tt > [virtual]< / tt >
< / h3 >
Returns TRUE if the node is an element; otherwise returns FALSE.
< p > If this function returns TRUE, it does not imply that this object
is a < a href = "qdomelement.html" > TQDomElement< / a > ; you can get the TQDomElement with < a href = "#toElement" > toElement< / a > ().
< p > < p > See also < a href = "#toElement" > toElement< / a > ().
< p > Example: < a href = "outliner-example.html#x1908" > xml/outliner/outlinetree.cpp< / a > .
< p > Reimplemented in < a href = "qdomelement.html#isElement" > TQDomElement< / a > .
< h3 class = fn > bool < a name = "isEntity" > < / a > TQDomNode::isEntity () const< tt > [virtual]< / tt >
< / h3 >
Returns TRUE if the node is an entity; otherwise returns FALSE.
< p > If this function returns TRUE, it does not imply that this object
is a < a href = "qdomentity.html" > TQDomEntity< / a > ; you can get the TQDomEntity with < a href = "#toEntity" > toEntity< / a > ().
< p > < p > See also < a href = "#toEntity" > toEntity< / a > ().
< p > Reimplemented in < a href = "qdomentity.html#isEntity" > TQDomEntity< / a > .
< h3 class = fn > bool < a name = "isEntityReference" > < / a > TQDomNode::isEntityReference () const< tt > [virtual]< / tt >
< / h3 >
Returns TRUE if the node is an entity reference; otherwise returns
FALSE.
< p > If this function returns TRUE, it does not imply that this object
is a < a href = "qdomentityreference.html" > TQDomEntityReference< / a > ; you can get the TQDomEntityReference with
< a href = "#toEntityReference" > toEntityReference< / a > ().
< p > < p > See also < a href = "#toEntityReference" > toEntityReference< / a > ().
< p > Reimplemented in < a href = "qdomentityreference.html#isEntityReference" > TQDomEntityReference< / a > .
< h3 class = fn > bool < a name = "isNotation" > < / a > TQDomNode::isNotation () const< tt > [virtual]< / tt >
< / h3 >
Returns TRUE if the node is a notation; otherwise returns FALSE.
< p > If this function returns TRUE, it does not imply that this object
is a < a href = "qdomnotation.html" > TQDomNotation< / a > ; you can get the TQDomNotation with < a href = "#toNotation" > toNotation< / a > ().
< p > < p > See also < a href = "#toNotation" > toNotation< / a > ().
< p > Reimplemented in < a href = "qdomnotation.html#isNotation" > TQDomNotation< / a > .
< h3 class = fn > bool < a name = "isNull" > < / a > TQDomNode::isNull () const
< / h3 >
Returns TRUE if this node is null (i.e. if it has no type or
contents); otherwise returns FALSE.
< p > Example: < a href = "outliner-example.html#x1909" > xml/outliner/outlinetree.cpp< / a > .
< h3 class = fn > bool < a name = "isProcessingInstruction" > < / a > TQDomNode::isProcessingInstruction () const< tt > [virtual]< / tt >
< / h3 >
Returns TRUE if the node is a processing instruction; otherwise
returns FALSE.
< p > If this function returns TRUE, it does not imply that this object
is a < a href = "qdomprocessinginstruction.html" > TQDomProcessingInstruction< / a > ; you can get the
TQProcessingInstruction with < a href = "#toProcessingInstruction" > toProcessingInstruction< / a > ().
< p > < p > See also < a href = "#toProcessingInstruction" > toProcessingInstruction< / a > ().
< p > Reimplemented in < a href = "qdomprocessinginstruction.html#isProcessingInstruction" > TQDomProcessingInstruction< / a > .
< h3 class = fn > bool < a name = "isSupported" > < / a > TQDomNode::isSupported ( const < a href = "ntqstring.html" > TQString< / a > & feature, const < a href = "ntqstring.html" > TQString< / a > & version ) const< tt > [virtual]< / tt >
< / h3 >
Returns TRUE if the DOM implementation implements the feature < em > feature< / em > and this feature is supported by this node in the version
< em > version< / em > ; otherwise returns FALSE.
< p > < p > See also < a href = "qdomimplementation.html#hasFeature" > TQDomImplementation::hasFeature< / a > ().
< h3 class = fn > bool < a name = "isText" > < / a > TQDomNode::isText () const< tt > [virtual]< / tt >
< / h3 >
Returns TRUE if the node is a text node; otherwise returns FALSE.
< p > If this function returns TRUE, it does not imply that this object
is a < a href = "qdomtext.html" > TQDomText< / a > ; you can get the TQDomText with < a href = "#toText" > toText< / a > ().
< p > < p > See also < a href = "#toText" > toText< / a > ().
< p > Reimplemented in < a href = "qdomtext.html#isText" > TQDomText< / a > .
< h3 class = fn > < a href = "qdomnode.html" > TQDomNode< / a > < a name = "lastChild" > < / a > TQDomNode::lastChild () const< tt > [virtual]< / tt >
< / h3 >
Returns the last child of the node. If there is no child node, a
< a href = "#isNull" > null node< / a > is returned. Changing the
returned node will also change the node in the document tree.
< p > < p > See also < a href = "#firstChild" > firstChild< / a > () and < a href = "#childNodes" > childNodes< / a > ().
< h3 class = fn > < a href = "ntqstring.html" > TQString< / a > < a name = "localName" > < / a > TQDomNode::localName () const< tt > [virtual]< / tt >
< / h3 >
If the node uses namespaces, this function returns the local name
of the node; otherwise it returns < a href = "ntqstring.html#TQString-null" > TQString::null< / a > .
< p > Only nodes of type < a href = "#NodeType-enum" > ElementNode< / a > or
< a href = "#NodeType-enum" > AttributeNode< / a > can have
namespaces. A namespace must have been specified at creation time;
it is not possible to add a namespace afterwards.
< p > < p > See also < a href = "#prefix" > prefix< / a > (), < a href = "#namespaceURI" > namespaceURI< / a > (), < a href = "qdomdocument.html#createElementNS" > TQDomDocument::createElementNS< / a > (), and < a href = "qdomdocument.html#createAttributeNS" > TQDomDocument::createAttributeNS< / a > ().
< h3 class = fn > < a href = "qdomnode.html" > TQDomNode< / a > < a name = "namedItem" > < / a > TQDomNode::namedItem ( const < a href = "ntqstring.html" > TQString< / a > & name ) const
< / h3 >
Returns the first direct child node for which < a href = "#nodeName" > nodeName< / a > () equals < em > name< / em > .
< p > If no such direct child exists, a < a href = "#isNull" > null node< / a >
is returned.
< p > < p > See also < a href = "#nodeName" > nodeName< / a > ().
< h3 class = fn > < a href = "ntqstring.html" > TQString< / a > < a name = "namespaceURI" > < / a > TQDomNode::namespaceURI () const< tt > [virtual]< / tt >
< / h3 >
Returns the namespace URI of this node or < a href = "ntqstring.html#TQString-null" > TQString::null< / a > if the
node has no namespace URI.
< p > Only nodes of type < a href = "#NodeType-enum" > ElementNode< / a > or
< a href = "#NodeType-enum" > AttributeNode< / a > can have
namespaces. A namespace URI must be specified at creation time and
cannot be changed later.
< p > < p > See also < a href = "#prefix" > prefix< / a > (), < a href = "#localName" > localName< / a > (), < a href = "qdomdocument.html#createElementNS" > TQDomDocument::createElementNS< / a > (), and < a href = "qdomdocument.html#createAttributeNS" > TQDomDocument::createAttributeNS< / a > ().
< h3 class = fn > < a href = "qdomnode.html" > TQDomNode< / a > < a name = "nextSibling" > < / a > TQDomNode::nextSibling () const< tt > [virtual]< / tt >
< / h3 >
Returns the next sibling in the document tree. Changing the
returned node will also change the node in the document tree.
< p > If you have XML like this:
< pre >
< h1> Heading< /h1>
< p> The text...< /p>
< h2> Next heading< /h2>
< / pre >
and this TQDomNode represents the < p> tag, < a href = "#nextSibling" > nextSibling< / a > () will
return the node representing the < h2> tag.
< p > < p > See also < a href = "#previousSibling" > previousSibling< / a > ().
< p > Example: < a href = "outliner-example.html#x1910" > xml/outliner/outlinetree.cpp< / a > .
< h3 class = fn > < a href = "ntqstring.html" > TQString< / a > < a name = "nodeName" > < / a > TQDomNode::nodeName () const< tt > [virtual]< / tt >
< / h3 >
Returns the name of the node.
< p > The meaning of the name depends on the subclass:
< center > < table cellpadding = "4" cellspacing = "2" border = "0" >
< tr bgcolor = "#a2c511" > < th valign = "top" > Name < th valign = "top" > Meaning
< tr bgcolor = "#f0f0f0" > < td valign = "top" > TQDomAttr < td valign = "top" > The name of the attribute
< tr bgcolor = "#d0d0d0" > < td valign = "top" > TQDomCDATASection < td valign = "top" > The string "#cdata-section"
< tr bgcolor = "#f0f0f0" > < td valign = "top" > TQDomComment < td valign = "top" > The string "#comment"
< tr bgcolor = "#d0d0d0" > < td valign = "top" > TQDomDocument < td valign = "top" > The string "#document"
< tr bgcolor = "#f0f0f0" > < td valign = "top" > TQDomDocumentFragment < td valign = "top" > The string "#document-fragment"
< tr bgcolor = "#d0d0d0" > < td valign = "top" > TQDomDocumentType < td valign = "top" > The name of the document type
< tr bgcolor = "#f0f0f0" > < td valign = "top" > TQDomElement < td valign = "top" > The tag name
< tr bgcolor = "#d0d0d0" > < td valign = "top" > TQDomEntity < td valign = "top" > The name of the entity
< tr bgcolor = "#f0f0f0" > < td valign = "top" > TQDomEntityReference < td valign = "top" > The name of the referenced entity
< tr bgcolor = "#d0d0d0" > < td valign = "top" > TQDomNotation < td valign = "top" > The name of the notation
< tr bgcolor = "#f0f0f0" > < td valign = "top" > TQDomProcessingInstruction < td valign = "top" > The target of the processing instruction
< tr bgcolor = "#d0d0d0" > < td valign = "top" > TQDomText < td valign = "top" > The string "#text"
< / table > < / center >
< p > < p > See also < a href = "#nodeValue" > nodeValue< / a > ().
< p > Example: < a href = "outliner-example.html#x1911" > xml/outliner/outlinetree.cpp< / a > .
< h3 class = fn > < a href = "qdomnode.html#NodeType-enum" > TQDomNode::NodeType< / a > < a name = "nodeType" > < / a > TQDomNode::nodeType () const< tt > [virtual]< / tt >
< / h3 >
Returns the type of the node.
< p > < p > See also < a href = "#toAttr" > toAttr< / a > (), < a href = "#toCDATASection" > toCDATASection< / a > (), < a href = "#toDocumentFragment" > toDocumentFragment< / a > (), < a href = "#toDocument" > toDocument< / a > (), < a href = "#toDocumentType" > toDocumentType< / a > (), < a href = "#toElement" > toElement< / a > (), < a href = "#toEntityReference" > toEntityReference< / a > (), < a href = "#toText" > toText< / a > (), < a href = "#toEntity" > toEntity< / a > (), < a href = "#toNotation" > toNotation< / a > (), < a href = "#toProcessingInstruction" > toProcessingInstruction< / a > (), < a href = "#toCharacterData" > toCharacterData< / a > (), and < a href = "#toComment" > toComment< / a > ().
< p > Reimplemented in < a href = "qdomdocumenttype.html#nodeType" > TQDomDocumentType< / a > , < a href = "qdomdocument.html#nodeType" > TQDomDocument< / a > , < a href = "qdomdocumentfragment.html#nodeType" > TQDomDocumentFragment< / a > , < a href = "qdomcharacterdata.html#nodeType" > TQDomCharacterData< / a > , < a href = "qdomattr.html#nodeType" > TQDomAttr< / a > , < a href = "qdomelement.html#nodeType" > TQDomElement< / a > , < a href = "qdomnotation.html#nodeType" > TQDomNotation< / a > , < a href = "qdomentity.html#nodeType" > TQDomEntity< / a > , < a href = "qdomentityreference.html#nodeType" > TQDomEntityReference< / a > , and < a href = "qdomprocessinginstruction.html#nodeType" > TQDomProcessingInstruction< / a > .
< h3 class = fn > < a href = "ntqstring.html" > TQString< / a > < a name = "nodeValue" > < / a > TQDomNode::nodeValue () const< tt > [virtual]< / tt >
< / h3 >
Returns the value of the node.
< p > The meaning of the value depends on the subclass:
< center > < table cellpadding = "4" cellspacing = "2" border = "0" >
< tr bgcolor = "#a2c511" > < th valign = "top" > Name < th valign = "top" > Meaning
< tr bgcolor = "#f0f0f0" > < td valign = "top" > TQDomAttr < td valign = "top" > The attribute value
< tr bgcolor = "#d0d0d0" > < td valign = "top" > TQDomCDATASection < td valign = "top" > The content of the CDATA section
< tr bgcolor = "#f0f0f0" > < td valign = "top" > TQDomComment < td valign = "top" > The comment
< tr bgcolor = "#d0d0d0" > < td valign = "top" > TQDomProcessingInstruction < td valign = "top" > The data of the processing intruction
< tr bgcolor = "#f0f0f0" > < td valign = "top" > TQDomText < td valign = "top" > The text
< / table > < / center >
< p > All the other subclasses do not have a node value and will return
< a href = "ntqstring.html#TQString-null" > TQString::null< / a > .
< p > < p > See also < a href = "#setNodeValue" > setNodeValue< / a > () and < a href = "#nodeName" > nodeName< / a > ().
< p > Example: < a href = "outliner-example.html#x1912" > xml/outliner/outlinetree.cpp< / a > .
< h3 class = fn > void < a name = "normalize" > < / a > TQDomNode::normalize ()< tt > [virtual]< / tt >
< / h3 >
Calling < a href = "#normalize" > normalize< / a > () on an element converts all its children into a
standard form. This means that adjacent < a href = "qdomtext.html" > TQDomText< / a > objects will be
merged into a single text object (< a href = "qdomcdatasection.html" > TQDomCDATASection< / a > nodes are not
merged).
< h3 class = fn > bool < a name = "operator!-eq" > < / a > TQDomNode::operator!= ( const < a href = "qdomnode.html" > TQDomNode< / a > & n ) const
< / h3 >
Returns TRUE if < em > n< / em > and this DOM node are not equal; otherwise
returns FALSE.
< h3 class = fn > < a href = "qdomnode.html" > TQDomNode< / a > & < a name = "operator-eq" > < / a > TQDomNode::operator= ( const < a href = "qdomnode.html" > TQDomNode< / a > & n )
< / h3 >
Assigns a copy of < em > n< / em > to this DOM node.
< p > The data of the copy is shared (shallow copy): modifying one node
will also change the other. If you want to make a < a href = "shclass.html#deep-copy" > deep copy< / a > , use
< a href = "#cloneNode" > cloneNode< / a > ().
< h3 class = fn > bool < a name = "operator-eq-eq" > < / a > TQDomNode::operator== ( const < a href = "qdomnode.html" > TQDomNode< / a > & n ) const
< / h3 >
Returns TRUE if < em > n< / em > and this DOM node are equal; otherwise
returns FALSE.
< h3 class = fn > < a href = "qdomdocument.html" > TQDomDocument< / a > < a name = "ownerDocument" > < / a > TQDomNode::ownerDocument () const< tt > [virtual]< / tt >
< / h3 >
Returns the document to which this node belongs.
< h3 class = fn > < a href = "qdomnode.html" > TQDomNode< / a > < a name = "parentNode" > < / a > TQDomNode::parentNode () const< tt > [virtual]< / tt >
< / h3 >
Returns the parent node. If this node has no parent, a null node
is returned (i.e. a node for which < a href = "#isNull" > isNull< / a > () returns TRUE).
< h3 class = fn > < a href = "ntqstring.html" > TQString< / a > < a name = "prefix" > < / a > TQDomNode::prefix () const< tt > [virtual]< / tt >
< / h3 >
Returns the namespace prefix of the node or < a href = "ntqstring.html#TQString-null" > TQString::null< / a > if the
node has no namespace prefix.
< p > Only nodes of type < a href = "#NodeType-enum" > ElementNode< / a > or
< a href = "#NodeType-enum" > AttributeNode< / a > can have
namespaces. A namespace prefix must be specified at creation time.
If a node was created with a namespace prefix, you can change it
later with < a href = "#setPrefix" > setPrefix< / a > ().
< p > If you create an element or attribute with
< a href = "qdomdocument.html#createElement" > TQDomDocument::createElement< / a > () or < a href = "qdomdocument.html#createAttribute" > TQDomDocument::createAttribute< / a > (),
the prefix will be TQString::null. If you use
< a href = "qdomdocument.html#createElementNS" > TQDomDocument::createElementNS< / a > () or
< a href = "qdomdocument.html#createAttributeNS" > TQDomDocument::createAttributeNS< / a > () instead, the prefix will not be
TQString::null; but it might be an empty string if the name does
not have a prefix.
< p > < p > See also < a href = "#setPrefix" > setPrefix< / a > (), < a href = "#localName" > localName< / a > (), < a href = "#namespaceURI" > namespaceURI< / a > (), < a href = "qdomdocument.html#createElementNS" > TQDomDocument::createElementNS< / a > (), and < a href = "qdomdocument.html#createAttributeNS" > TQDomDocument::createAttributeNS< / a > ().
< h3 class = fn > < a href = "qdomnode.html" > TQDomNode< / a > < a name = "previousSibling" > < / a > TQDomNode::previousSibling () const< tt > [virtual]< / tt >
< / h3 >
Returns the previous sibling in the document tree. Changing the
returned node will also change the node in the document tree.
< p > For example, if you have XML like this:
< pre >
< h1> Heading< /h1>
< p> The text...< /p>
< h2> Next heading< /h2>
< / pre >
and this TQDomNode represents the < p> tag, < a href = "#previousSibling" > previousSibling< / a > ()
will return the node representing the < h1> tag.
< p > < p > See also < a href = "#nextSibling" > nextSibling< / a > ().
< h3 class = fn > < a href = "qdomnode.html" > TQDomNode< / a > < a name = "removeChild" > < / a > TQDomNode::removeChild ( const < a href = "qdomnode.html" > TQDomNode< / a > & oldChild )< tt > [virtual]< / tt >
< / h3 >
Removes < em > oldChild< / em > from the list of children. < em > oldChild< / em > must be
a direct child of this node.
< p > Returns a new reference to < em > oldChild< / em > on success or a < a href = "#isNull" > null node< / a > on failure.
< p > < p > See also < a href = "#insertBefore" > insertBefore< / a > (), < a href = "#insertAfter" > insertAfter< / a > (), < a href = "#replaceChild" > replaceChild< / a > (), and < a href = "#appendChild" > appendChild< / a > ().
< h3 class = fn > < a href = "qdomnode.html" > TQDomNode< / a > < a name = "replaceChild" > < / a > TQDomNode::replaceChild ( const < a href = "qdomnode.html" > TQDomNode< / a > & newChild, const < a href = "qdomnode.html" > TQDomNode< / a > & oldChild )< tt > [virtual]< / tt >
< / h3 >
Replaces < em > oldChild< / em > with < em > newChild< / em > . < em > oldChild< / em > must be a
direct child of this node.
< p > If < em > newChild< / em > is the child of another node, it is reparented to
this node. If < em > newChild< / em > is a child of this node, then its
position in the list of children is changed.
< p > If < em > newChild< / em > is a < a href = "qdomdocumentfragment.html" > TQDomDocumentFragment< / a > , then < em > oldChild< / em > is
replaced by all of the children of the fragment.
< p > Returns a new reference to < em > oldChild< / em > on success or a < a href = "#isNull" > null node< / a > an failure.
< p > < p > See also < a href = "#insertBefore" > insertBefore< / a > (), < a href = "#insertAfter" > insertAfter< / a > (), < a href = "#removeChild" > removeChild< / a > (), and < a href = "#appendChild" > appendChild< / a > ().
< h3 class = fn > void < a name = "save" > < / a > TQDomNode::save ( < a href = "ntqtextstream.html" > TQTextStream< / a > & str, int indent ) const
< / h3 >
Writes the XML representation of the node and all its children to
the stream < em > str< / em > . This function uses < em > indent< / em > as the amount of
space to indent the node.
< h3 class = fn > void < a name = "setNodeValue" > < / a > TQDomNode::setNodeValue ( const < a href = "ntqstring.html" > TQString< / a > & v )< tt > [virtual]< / tt >
< / h3 >
Sets the node's value to < em > v< / em > .
< p > < p > See also < a href = "#nodeValue" > nodeValue< / a > ().
< h3 class = fn > void < a name = "setPrefix" > < / a > TQDomNode::setPrefix ( const < a href = "ntqstring.html" > TQString< / a > & pre )< tt > [virtual]< / tt >
< / h3 >
If the node has a namespace prefix, this function changes the
namespace prefix of the node to < em > pre< / em > . Otherwise this function
does nothing.
< p > Only nodes of type < a href = "#NodeType-enum" > ElementNode< / a > or
< a href = "#NodeType-enum" > AttributeNode< / a > can have
namespaces. A namespace prefix must have be specified at creation
time; it is not possible to add a namespace prefix afterwards.
< p > < p > See also < a href = "#prefix" > prefix< / a > (), < a href = "#localName" > localName< / a > (), < a href = "#namespaceURI" > namespaceURI< / a > (), < a href = "qdomdocument.html#createElementNS" > TQDomDocument::createElementNS< / a > (), and < a href = "qdomdocument.html#createAttributeNS" > TQDomDocument::createAttributeNS< / a > ().
< h3 class = fn > < a href = "qdomattr.html" > TQDomAttr< / a > < a name = "toAttr" > < / a > TQDomNode::toAttr ()
< / h3 >
Converts a TQDomNode into a < a href = "qdomattr.html" > TQDomAttr< / a > . If the node is not an
attribute, the returned object will be < a href = "#isNull" > null< / a > .
< p > < p > See also < a href = "#isAttr" > isAttr< / a > ().
< h3 class = fn > < a href = "qdomcdatasection.html" > TQDomCDATASection< / a > < a name = "toCDATASection" > < / a > TQDomNode::toCDATASection ()
< / h3 >
Converts a TQDomNode into a < a href = "qdomcdatasection.html" > TQDomCDATASection< / a > . If the node is not a
CDATA section, the returned object will be < a href = "#isNull" > null< / a > .
< p > < p > See also < a href = "#isCDATASection" > isCDATASection< / a > ().
< h3 class = fn > < a href = "qdomcharacterdata.html" > TQDomCharacterData< / a > < a name = "toCharacterData" > < / a > TQDomNode::toCharacterData ()
< / h3 >
Converts a TQDomNode into a < a href = "qdomcharacterdata.html" > TQDomCharacterData< / a > . If the node is not a
character data node the returned object will be < a href = "#isNull" > null< / a > .
< p > < p > See also < a href = "#isCharacterData" > isCharacterData< / a > ().
< h3 class = fn > < a href = "qdomcomment.html" > TQDomComment< / a > < a name = "toComment" > < / a > TQDomNode::toComment ()
< / h3 >
Converts a TQDomNode into a < a href = "qdomcomment.html" > TQDomComment< / a > . If the node is not a
comment the returned object will be < a href = "#isNull" > null< / a > .
< p > < p > See also < a href = "#isComment" > isComment< / a > ().
< h3 class = fn > < a href = "qdomdocument.html" > TQDomDocument< / a > < a name = "toDocument" > < / a > TQDomNode::toDocument ()
< / h3 >
Converts a TQDomNode into a < a href = "qdomdocument.html" > TQDomDocument< / a > . If the node is not a
document the returned object will be < a href = "#isNull" > null< / a > .
< p > < p > See also < a href = "#isDocument" > isDocument< / a > ().
< h3 class = fn > < a href = "qdomdocumentfragment.html" > TQDomDocumentFragment< / a > < a name = "toDocumentFragment" > < / a > TQDomNode::toDocumentFragment ()
< / h3 >
Converts a TQDomNode into a < a href = "qdomdocumentfragment.html" > TQDomDocumentFragment< / a > . If the node is
not a document fragment the returned object will be < a href = "#isNull" > null< / a > .
< p > < p > See also < a href = "#isDocumentFragment" > isDocumentFragment< / a > ().
< h3 class = fn > < a href = "qdomdocumenttype.html" > TQDomDocumentType< / a > < a name = "toDocumentType" > < / a > TQDomNode::toDocumentType ()
< / h3 >
Converts a TQDomNode into a < a href = "qdomdocumenttype.html" > TQDomDocumentType< / a > . If the node is not a
document type the returned object will be < a href = "#isNull" > null< / a > .
< p > < p > See also < a href = "#isDocumentType" > isDocumentType< / a > ().
< h3 class = fn > < a href = "qdomelement.html" > TQDomElement< / a > < a name = "toElement" > < / a > TQDomNode::toElement ()
< / h3 >
Converts a TQDomNode into a < a href = "qdomelement.html" > TQDomElement< / a > . If the node is not an
element the returned object will be < a href = "#isNull" > null< / a > .
< p > < p > See also < a href = "#isElement" > isElement< / a > ().
< p > Example: < a href = "outliner-example.html#x1913" > xml/outliner/outlinetree.cpp< / a > .
< h3 class = fn > < a href = "qdomentity.html" > TQDomEntity< / a > < a name = "toEntity" > < / a > TQDomNode::toEntity ()
< / h3 >
Converts a TQDomNode into a < a href = "qdomentity.html" > TQDomEntity< / a > . If the node is not an
entity the returned object will be < a href = "#isNull" > null< / a > .
< p > < p > See also < a href = "#isEntity" > isEntity< / a > ().
< h3 class = fn > < a href = "qdomentityreference.html" > TQDomEntityReference< / a > < a name = "toEntityReference" > < / a > TQDomNode::toEntityReference ()
< / h3 >
Converts a TQDomNode into a < a href = "qdomentityreference.html" > TQDomEntityReference< / a > . If the node is not
an entity reference, the returned object will be < a href = "#isNull" > null< / a > .
< p > < p > See also < a href = "#isEntityReference" > isEntityReference< / a > ().
< h3 class = fn > < a href = "qdomnotation.html" > TQDomNotation< / a > < a name = "toNotation" > < / a > TQDomNode::toNotation ()
< / h3 >
Converts a TQDomNode into a < a href = "qdomnotation.html" > TQDomNotation< / a > . If the node is not a
notation the returned object will be < a href = "#isNull" > null< / a > .
< p > < p > See also < a href = "#isNotation" > isNotation< / a > ().
< h3 class = fn > < a href = "qdomprocessinginstruction.html" > TQDomProcessingInstruction< / a > < a name = "toProcessingInstruction" > < / a > TQDomNode::toProcessingInstruction ()
< / h3 >
Converts a TQDomNode into a < a href = "qdomprocessinginstruction.html" > TQDomProcessingInstruction< / a > . If the node
is not a processing instruction the returned object will be < a href = "#isNull" > null< / a > .
< p > < p > See also < a href = "#isProcessingInstruction" > isProcessingInstruction< / a > ().
< h3 class = fn > < a href = "qdomtext.html" > TQDomText< / a > < a name = "toText" > < / a > TQDomNode::toText ()
< / h3 >
Converts a TQDomNode into a < a href = "qdomtext.html" > TQDomText< / a > . If the node is not a text,
the returned object will be < a href = "#isNull" > null< / a > .
< p > < p > See also < a href = "#isText" > isText< / a > ().
< hr > < h2 > Related Functions< / h2 >
< h3 class = fn > < a href = "ntqtextstream.html" > TQTextStream< / a > & < a name = "operator-lt-lt" > < / a > operator< < ( < a href = "ntqtextstream.html" > TQTextStream< / a > & str, const < a href = "qdomnode.html" > TQDomNode< / a > & node )
< / h3 >
< p > Writes the XML representation of the node < em > node< / em > and all its
children to the stream < em > str< / em > .
<!-- eof -->
< hr > < p >
This file is part of the < a href = "index.html" > TQt toolkit< / a > .
Copyright © 1995-2007
< a href = "http://www.trolltech.com/" > Trolltech< / a > . All Rights Reserved.< p > < address > < hr > < div align = center >
< table width = 100% cellspacing = 0 border = 0 > < tr >
< td > Copyright © 2007
< a href = "troll.html" > Trolltech< / a > < td align = center > < a href = "trademarks.html" > Trademarks< / a >
< td align = right > < div align = right > TQt 3.3.8< / div >
< / table > < / div > < / address > < / body >
< / html >