You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
350 lines
25 KiB
350 lines
25 KiB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
<title>TQDomElement 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>TQDomElement Class Reference<br><small>[<a href="xml.html">XML module</a>]</small></h1>
|
|
|
|
<p>The TQDomElement class represents one element in the 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="tqdom-h.html">tqdom.h</a>></tt>
|
|
<p>Inherits <a href="tqdomnode.html">TQDomNode</a>.
|
|
<p><a href="tqdomelement-members.html">List of all member functions.</a>
|
|
<h2>Public Members</h2>
|
|
<ul>
|
|
<li class=fn><a href="#TQDomElement"><b>TQDomElement</b></a> ()</li>
|
|
<li class=fn><a href="#TQDomElement-2"><b>TQDomElement</b></a> ( const TQDomElement & x )</li>
|
|
<li class=fn>TQDomElement & <a href="#operator-eq"><b>operator=</b></a> ( const TQDomElement & x )</li>
|
|
<li class=fn><a href="#~TQDomElement"><b>~TQDomElement</b></a> ()</li>
|
|
<li class=fn>TQString <a href="#attribute"><b>attribute</b></a> ( const TQString & name, const TQString & defValue = TQString::null ) const</li>
|
|
<li class=fn>void <a href="#setAttribute"><b>setAttribute</b></a> ( const TQString & name, const TQString & value )</li>
|
|
<li class=fn>void <a href="#setAttribute-2"><b>setAttribute</b></a> ( const TQString & name, int value )</li>
|
|
<li class=fn>void <a href="#setAttribute-3"><b>setAttribute</b></a> ( const TQString & name, uint value )</li>
|
|
<li class=fn>void <a href="#setAttribute-4"><b>setAttribute</b></a> ( const TQString & name, long value )</li>
|
|
<li class=fn>void <a href="#setAttribute-5"><b>setAttribute</b></a> ( const TQString & name, ulong value )</li>
|
|
<li class=fn>void <a href="#setAttribute-6"><b>setAttribute</b></a> ( const TQString & name, double value )</li>
|
|
<li class=fn>void <a href="#removeAttribute"><b>removeAttribute</b></a> ( const TQString & name )</li>
|
|
<li class=fn>TQDomAttr <a href="#attributeNode"><b>attributeNode</b></a> ( const TQString & name )</li>
|
|
<li class=fn>TQDomAttr <a href="#setAttributeNode"><b>setAttributeNode</b></a> ( const TQDomAttr & newAttr )</li>
|
|
<li class=fn>TQDomAttr <a href="#removeAttributeNode"><b>removeAttributeNode</b></a> ( const TQDomAttr & oldAttr )</li>
|
|
<li class=fn>virtual TQDomNodeList <a href="#elementsByTagName"><b>elementsByTagName</b></a> ( const TQString & tagname ) const</li>
|
|
<li class=fn>bool <a href="#hasAttribute"><b>hasAttribute</b></a> ( const TQString & name ) const</li>
|
|
<li class=fn>TQString <a href="#attributeNS"><b>attributeNS</b></a> ( const TQString nsURI, const TQString & localName, const TQString & defValue ) const</li>
|
|
<li class=fn>void <a href="#setAttributeNS"><b>setAttributeNS</b></a> ( const TQString nsURI, const TQString & qName, const TQString & value )</li>
|
|
<li class=fn>void <a href="#setAttributeNS-2"><b>setAttributeNS</b></a> ( const TQString nsURI, const TQString & qName, int value )</li>
|
|
<li class=fn>void <a href="#setAttributeNS-3"><b>setAttributeNS</b></a> ( const TQString nsURI, const TQString & qName, uint value )</li>
|
|
<li class=fn>void <a href="#setAttributeNS-4"><b>setAttributeNS</b></a> ( const TQString nsURI, const TQString & qName, long value )</li>
|
|
<li class=fn>void <a href="#setAttributeNS-5"><b>setAttributeNS</b></a> ( const TQString nsURI, const TQString & qName, ulong value )</li>
|
|
<li class=fn>void <a href="#setAttributeNS-6"><b>setAttributeNS</b></a> ( const TQString nsURI, const TQString & qName, double value )</li>
|
|
<li class=fn>void <a href="#removeAttributeNS"><b>removeAttributeNS</b></a> ( const TQString & nsURI, const TQString & localName )</li>
|
|
<li class=fn>TQDomAttr <a href="#attributeNodeNS"><b>attributeNodeNS</b></a> ( const TQString & nsURI, const TQString & localName )</li>
|
|
<li class=fn>TQDomAttr <a href="#setAttributeNodeNS"><b>setAttributeNodeNS</b></a> ( const TQDomAttr & newAttr )</li>
|
|
<li class=fn>virtual TQDomNodeList <a href="#elementsByTagNameNS"><b>elementsByTagNameNS</b></a> ( const TQString & nsURI, const TQString & localName ) const</li>
|
|
<li class=fn>bool <a href="#hasAttributeNS"><b>hasAttributeNS</b></a> ( const TQString & nsURI, const TQString & localName ) const</li>
|
|
<li class=fn>TQString <a href="#tagName"><b>tagName</b></a> () const</li>
|
|
<li class=fn>void <a href="#setTagName"><b>setTagName</b></a> ( const TQString & name )</li>
|
|
<li class=fn>virtual TQDomNamedNodeMap <a href="#attributes"><b>attributes</b></a> () const</li>
|
|
<li class=fn>virtual TQDomNode::NodeType <a href="#nodeType"><b>nodeType</b></a> () const</li>
|
|
<li class=fn>virtual bool <a href="#isElement"><b>isElement</b></a> () const</li>
|
|
<li class=fn>TQString <a href="#text"><b>text</b></a> () const</li>
|
|
</ul>
|
|
<hr><a name="details"></a><h2>Detailed Description</h2>
|
|
|
|
|
|
|
|
The TQDomElement class represents one element in the DOM tree.
|
|
|
|
<p>
|
|
|
|
<p> Elements have a <a href="#tagName">tagName</a>() and zero or more attributes associated
|
|
with them. The tag name can be changed with <a href="#setTagName">setTagName</a>().
|
|
<p> Element attributes are represented by <a href="tqdomattr.html">TQDomAttr</a> objects that can
|
|
be queried using the <a href="#attribute">attribute</a>() and <a href="#attributeNode">attributeNode</a>() functions.
|
|
You can set attributes with the <a href="#setAttribute">setAttribute</a>() and
|
|
<a href="#setAttributeNode">setAttributeNode</a>() functions. Attributes can be removed with
|
|
<a href="#removeAttribute">removeAttribute</a>(). There are namespace-aware equivalents to these
|
|
functions, i.e. <a href="#setAttributeNS">setAttributeNS</a>(), <a href="#setAttributeNodeNS">setAttributeNodeNS</a>() and
|
|
<a href="#removeAttributeNS">removeAttributeNS</a>().
|
|
<p> If you want to access the text of a node use <a href="#text">text</a>(), e.g.
|
|
<pre>
|
|
TQDomElement e = //...
|
|
//...
|
|
<a href="tqstring.html">TQString</a> s = e.<a href="#text">text</a>()
|
|
</pre>
|
|
|
|
The text() function operates recursively to find the text (since
|
|
not all elements contain text). If you want to find all the text
|
|
in all of a node's children, iterate over the children looking for
|
|
<a href="tqdomtext.html">TQDomText</a> nodes, e.g.
|
|
<pre>
|
|
<a href="tqstring.html">TQString</a> text;
|
|
TQDomElement element = doc.documentElement();
|
|
for( <a href="tqdomnode.html">TQDomNode</a> n = element.<a href="tqdomnode.html#firstChild">firstChild</a>(); !n.<a href="tqdomnode.html#isNull">isNull</a>(); n = n.<a href="tqdomnode.html#nextSibling">nextSibling</a>() )
|
|
{
|
|
<a href="tqdomtext.html">TQDomText</a> t = n.<a href="tqdomnode.html#toText">toText</a>();
|
|
if ( !t.<a href="tqdomnode.html#isNull">isNull</a>() )
|
|
text += t.<a href="tqdomcharacterdata.html#data">data</a>();
|
|
}
|
|
</pre>
|
|
|
|
Note that we attempt to convert each node to a text node and use
|
|
<a href="#text">text</a>() rather than using <a href="tqdomnode.html#firstChild">firstChild</a>().<a href="tqdomnode.html#toText">toText</a>().data() or
|
|
n.toText().data() directly on the node, because the node may not
|
|
be a text element.
|
|
<p> You can get a list of all the decendents of an element which have
|
|
a specified tag name with <a href="#elementsByTagName">elementsByTagName</a>() or
|
|
<a href="#elementsByTagNameNS">elementsByTagNameNS</a>().
|
|
<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="tqdomdocument.html">TQDomDocument</a> documentation.
|
|
<p>See also <a href="xml-tools.html">XML</a>.
|
|
|
|
<hr><h2>Member Function Documentation</h2>
|
|
<h3 class=fn><a name="TQDomElement"></a>TQDomElement::TQDomElement ()
|
|
</h3>
|
|
Constructs an empty element. Use the <a href="tqdomdocument.html#createElement">TQDomDocument::createElement</a>()
|
|
function to construct elements with content.
|
|
|
|
<h3 class=fn><a name="TQDomElement-2"></a>TQDomElement::TQDomElement ( const <a href="tqdomelement.html">TQDomElement</a> & x )
|
|
</h3>
|
|
Constructs a copy of <em>x</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="tqdomnode.html#cloneNode">cloneNode</a>().
|
|
|
|
<h3 class=fn><a name="~TQDomElement"></a>TQDomElement::~TQDomElement ()
|
|
</h3>
|
|
Destroys the object and frees its resources.
|
|
|
|
<h3 class=fn><a href="tqstring.html">TQString</a> <a name="attribute"></a>TQDomElement::attribute ( const <a href="tqstring.html">TQString</a> & name, const <a href="tqstring.html">TQString</a> & defValue = TQString::null ) const
|
|
</h3>
|
|
Returns the attribute called <em>name</em>. If the attribute does not
|
|
exist <em>defValue</em> is returned.
|
|
<p> <p>See also <a href="#setAttribute">setAttribute</a>(), <a href="#attributeNode">attributeNode</a>(), <a href="#setAttributeNode">setAttributeNode</a>(), and <a href="#attributeNS">attributeNS</a>().
|
|
|
|
<h3 class=fn><a href="tqstring.html">TQString</a> <a name="attributeNS"></a>TQDomElement::attributeNS ( const <a href="tqstring.html">TQString</a> nsURI, const <a href="tqstring.html">TQString</a> & localName, const <a href="tqstring.html">TQString</a> & defValue ) const
|
|
</h3>
|
|
Returns the attribute with the local name <em>localName</em> and the
|
|
namespace URI <em>nsURI</em>. If the attribute does not exist <em>defValue</em> is returned.
|
|
<p> <p>See also <a href="#setAttributeNS">setAttributeNS</a>(), <a href="#attributeNodeNS">attributeNodeNS</a>(), <a href="#setAttributeNodeNS">setAttributeNodeNS</a>(), and <a href="#attribute">attribute</a>().
|
|
|
|
<h3 class=fn><a href="tqdomattr.html">TQDomAttr</a> <a name="attributeNode"></a>TQDomElement::attributeNode ( const <a href="tqstring.html">TQString</a> & name )
|
|
</h3>
|
|
Returns the <a href="tqdomattr.html">TQDomAttr</a> object that corresponds to the attribute
|
|
called <em>name</em>. If no such attribute exists a <a href="tqdomnode.html#isNull">null attribute</a> is returned.
|
|
<p> <p>See also <a href="#setAttributeNode">setAttributeNode</a>(), <a href="#attribute">attribute</a>(), <a href="#setAttribute">setAttribute</a>(), and <a href="#attributeNodeNS">attributeNodeNS</a>().
|
|
|
|
<h3 class=fn><a href="tqdomattr.html">TQDomAttr</a> <a name="attributeNodeNS"></a>TQDomElement::attributeNodeNS ( const <a href="tqstring.html">TQString</a> & nsURI, const <a href="tqstring.html">TQString</a> & localName )
|
|
</h3>
|
|
Returns the <a href="tqdomattr.html">TQDomAttr</a> object that corresponds to the attribute with
|
|
the local name <em>localName</em> and the namespace URI <em>nsURI</em>. If no
|
|
such attribute exists a <a href="tqdomnode.html#isNull">null
|
|
attribute</a> is returned.
|
|
<p> <p>See also <a href="#setAttributeNode">setAttributeNode</a>(), <a href="#attribute">attribute</a>(), and <a href="#setAttribute">setAttribute</a>().
|
|
|
|
<h3 class=fn><a href="tqdomnamednodemap.html">TQDomNamedNodeMap</a> <a name="attributes"></a>TQDomElement::attributes () const<tt> [virtual]</tt>
|
|
</h3>
|
|
Returns a <a href="tqdomnamednodemap.html">TQDomNamedNodeMap</a> containing all this element's attributes.
|
|
<p> <p>See also <a href="#attribute">attribute</a>(), <a href="#setAttribute">setAttribute</a>(), <a href="#attributeNode">attributeNode</a>(), and <a href="#setAttributeNode">setAttributeNode</a>().
|
|
|
|
<p>Reimplemented from <a href="tqdomnode.html#attributes">TQDomNode</a>.
|
|
<h3 class=fn><a href="tqdomnodelist.html">TQDomNodeList</a> <a name="elementsByTagName"></a>TQDomElement::elementsByTagName ( const <a href="tqstring.html">TQString</a> & tagname ) const<tt> [virtual]</tt>
|
|
</h3>
|
|
Returns a <a href="tqdomnodelist.html">TQDomNodeList</a> containing all descendent elements of this
|
|
element that are called <em>tagname</em>. The order they are in the node
|
|
list is the order they are encountered in a preorder traversal of
|
|
the element tree.
|
|
<p> <p>See also <a href="#elementsByTagNameNS">elementsByTagNameNS</a>() and <a href="tqdomdocument.html#elementsByTagName">TQDomDocument::elementsByTagName</a>().
|
|
|
|
<h3 class=fn><a href="tqdomnodelist.html">TQDomNodeList</a> <a name="elementsByTagNameNS"></a>TQDomElement::elementsByTagNameNS ( const <a href="tqstring.html">TQString</a> & nsURI, const <a href="tqstring.html">TQString</a> & localName ) const<tt> [virtual]</tt>
|
|
</h3>
|
|
Returns a <a href="tqdomnodelist.html">TQDomNodeList</a> containing all the descendent elements of
|
|
this element with the local name <em>localName</em> and the namespace
|
|
URI <em>nsURI</em>. The order they are in the node list is the order
|
|
they are encountered in a preorder traversal of the element tree.
|
|
<p> <p>See also <a href="#elementsByTagName">elementsByTagName</a>() and <a href="tqdomdocument.html#elementsByTagNameNS">TQDomDocument::elementsByTagNameNS</a>().
|
|
|
|
<h3 class=fn>bool <a name="hasAttribute"></a>TQDomElement::hasAttribute ( const <a href="tqstring.html">TQString</a> & name ) const
|
|
</h3>
|
|
Returns TRUE if this element has an attribute called <em>name</em>;
|
|
otherwise returns FALSE.
|
|
|
|
<h3 class=fn>bool <a name="hasAttributeNS"></a>TQDomElement::hasAttributeNS ( const <a href="tqstring.html">TQString</a> & nsURI, const <a href="tqstring.html">TQString</a> & localName ) const
|
|
</h3>
|
|
Returns TRUE if this element has an attribute with the local name
|
|
<em>localName</em> and the namespace URI <em>nsURI</em>; otherwise returns
|
|
FALSE.
|
|
|
|
<h3 class=fn>bool <a name="isElement"></a>TQDomElement::isElement () const<tt> [virtual]</tt>
|
|
</h3>
|
|
Returns TRUE.
|
|
|
|
<p>Reimplemented from <a href="tqdomnode.html#isElement">TQDomNode</a>.
|
|
<h3 class=fn><a href="tqdomnode.html#NodeType-enum">TQDomNode::NodeType</a> <a name="nodeType"></a>TQDomElement::nodeType () const<tt> [virtual]</tt>
|
|
</h3>
|
|
Returns <a href="tqdomnode.html#NodeType-enum">ElementNode</a>.
|
|
|
|
<p>Reimplemented from <a href="tqdomnode.html#nodeType">TQDomNode</a>.
|
|
<h3 class=fn><a href="tqdomelement.html">TQDomElement</a> & <a name="operator-eq"></a>TQDomElement::operator= ( const <a href="tqdomelement.html">TQDomElement</a> & x )
|
|
</h3>
|
|
Assigns <em>x</em> to this DOM element.
|
|
<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="tqdomnode.html#cloneNode">cloneNode</a>().
|
|
|
|
<h3 class=fn>void <a name="removeAttribute"></a>TQDomElement::removeAttribute ( const <a href="tqstring.html">TQString</a> & name )
|
|
</h3>
|
|
Removes the attribute called name <em>name</em> from this element.
|
|
<p> <p>See also <a href="#setAttribute">setAttribute</a>(), <a href="#attribute">attribute</a>(), and <a href="#removeAttributeNS">removeAttributeNS</a>().
|
|
|
|
<h3 class=fn>void <a name="removeAttributeNS"></a>TQDomElement::removeAttributeNS ( const <a href="tqstring.html">TQString</a> & nsURI, const <a href="tqstring.html">TQString</a> & localName )
|
|
</h3>
|
|
Removes the attribute with the local name <em>localName</em> and the
|
|
namespace URI <em>nsURI</em> from this element.
|
|
<p> <p>See also <a href="#setAttributeNS">setAttributeNS</a>(), <a href="#attributeNS">attributeNS</a>(), and <a href="#removeAttribute">removeAttribute</a>().
|
|
|
|
<h3 class=fn><a href="tqdomattr.html">TQDomAttr</a> <a name="removeAttributeNode"></a>TQDomElement::removeAttributeNode ( const <a href="tqdomattr.html">TQDomAttr</a> & oldAttr )
|
|
</h3>
|
|
Removes the attribute <em>oldAttr</em> from the element and returns it.
|
|
<p> <p>See also <a href="#attributeNode">attributeNode</a>() and <a href="#setAttributeNode">setAttributeNode</a>().
|
|
|
|
<h3 class=fn>void <a name="setAttribute"></a>TQDomElement::setAttribute ( const <a href="tqstring.html">TQString</a> & name, const <a href="tqstring.html">TQString</a> & value )
|
|
</h3>
|
|
Adds an attribute called <em>name</em> with value <em>value</em>. If an
|
|
attribute with the same name exists, its value is replaced by <em>value</em>.
|
|
<p> <p>See also <a href="#attribute">attribute</a>(), <a href="#setAttributeNode">setAttributeNode</a>(), and <a href="#setAttributeNS">setAttributeNS</a>().
|
|
|
|
<h3 class=fn>void <a name="setAttribute-2"></a>TQDomElement::setAttribute ( const <a href="tqstring.html">TQString</a> & name, int value )
|
|
</h3>
|
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p>
|
|
<h3 class=fn>void <a name="setAttribute-3"></a>TQDomElement::setAttribute ( const <a href="tqstring.html">TQString</a> & name, uint value )
|
|
</h3>
|
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p>
|
|
<h3 class=fn>void <a name="setAttribute-4"></a>TQDomElement::setAttribute ( const <a href="tqstring.html">TQString</a> & name, long value )
|
|
</h3>
|
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p>
|
|
<h3 class=fn>void <a name="setAttribute-5"></a>TQDomElement::setAttribute ( const <a href="tqstring.html">TQString</a> & name, ulong value )
|
|
</h3>
|
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p>
|
|
<h3 class=fn>void <a name="setAttribute-6"></a>TQDomElement::setAttribute ( const <a href="tqstring.html">TQString</a> & name, double value )
|
|
</h3>
|
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p>
|
|
<h3 class=fn>void <a name="setAttributeNS"></a>TQDomElement::setAttributeNS ( const <a href="tqstring.html">TQString</a> nsURI, const <a href="tqstring.html">TQString</a> & qName, const <a href="tqstring.html">TQString</a> & value )
|
|
</h3>
|
|
Adds an attribute with the qualified name <em>qName</em> and the
|
|
namespace URI <em>nsURI</em> with the value <em>value</em>. If an attribute
|
|
with the same local name and namespace URI exists, its prefix is
|
|
replaced by the prefix of <em>qName</em> and its value is repaced by <em>value</em>.
|
|
<p> Although <em>qName</em> is the qualified name, the local name is used to
|
|
decide if an existing attribute's value should be replaced.
|
|
<p> <p>See also <a href="#attributeNS">attributeNS</a>(), <a href="#setAttributeNodeNS">setAttributeNodeNS</a>(), and <a href="#setAttribute">setAttribute</a>().
|
|
|
|
<h3 class=fn>void <a name="setAttributeNS-2"></a>TQDomElement::setAttributeNS ( const <a href="tqstring.html">TQString</a> nsURI, const <a href="tqstring.html">TQString</a> & qName, int value )
|
|
</h3>
|
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p>
|
|
<h3 class=fn>void <a name="setAttributeNS-3"></a>TQDomElement::setAttributeNS ( const <a href="tqstring.html">TQString</a> nsURI, const <a href="tqstring.html">TQString</a> & qName, uint value )
|
|
</h3>
|
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p>
|
|
<h3 class=fn>void <a name="setAttributeNS-4"></a>TQDomElement::setAttributeNS ( const <a href="tqstring.html">TQString</a> nsURI, const <a href="tqstring.html">TQString</a> & qName, long value )
|
|
</h3>
|
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p>
|
|
<h3 class=fn>void <a name="setAttributeNS-5"></a>TQDomElement::setAttributeNS ( const <a href="tqstring.html">TQString</a> nsURI, const <a href="tqstring.html">TQString</a> & qName, ulong value )
|
|
</h3>
|
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p>
|
|
<h3 class=fn>void <a name="setAttributeNS-6"></a>TQDomElement::setAttributeNS ( const <a href="tqstring.html">TQString</a> nsURI, const <a href="tqstring.html">TQString</a> & qName, double value )
|
|
</h3>
|
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p>
|
|
<h3 class=fn><a href="tqdomattr.html">TQDomAttr</a> <a name="setAttributeNode"></a>TQDomElement::setAttributeNode ( const <a href="tqdomattr.html">TQDomAttr</a> & newAttr )
|
|
</h3>
|
|
Adds the attribute <em>newAttr</em> to this element.
|
|
<p> If the element has another attribute that has the same name as <em>newAttr</em>, this function replaces that attribute and returns it;
|
|
otherwise the function returns a <a href="tqdomnode.html#isNull">null
|
|
attribute</a>.
|
|
<p> <p>See also <a href="#attributeNode">attributeNode</a>(), <a href="#setAttribute">setAttribute</a>(), and <a href="#setAttributeNodeNS">setAttributeNodeNS</a>().
|
|
|
|
<h3 class=fn><a href="tqdomattr.html">TQDomAttr</a> <a name="setAttributeNodeNS"></a>TQDomElement::setAttributeNodeNS ( const <a href="tqdomattr.html">TQDomAttr</a> & newAttr )
|
|
</h3>
|
|
Adds the attribute <em>newAttr</em> to this element.
|
|
<p> If the element has another attribute that has the same local name
|
|
and namespace URI as <em>newAttr</em>, this function replaces that
|
|
attribute and returns it; otherwise the function returns a <a href="tqdomnode.html#isNull">null attribute</a>.
|
|
<p> <p>See also <a href="#attributeNodeNS">attributeNodeNS</a>(), <a href="#setAttributeNS">setAttributeNS</a>(), and <a href="#setAttributeNode">setAttributeNode</a>().
|
|
|
|
<h3 class=fn>void <a name="setTagName"></a>TQDomElement::setTagName ( const <a href="tqstring.html">TQString</a> & name )
|
|
</h3>
|
|
Sets this element's tag name to <em>name</em>.
|
|
<p> <p>See also <a href="#tagName">tagName</a>().
|
|
|
|
<h3 class=fn><a href="tqstring.html">TQString</a> <a name="tagName"></a>TQDomElement::tagName () const
|
|
</h3>
|
|
Returns the tag name of this element. For an XML element like this:
|
|
<pre>
|
|
<img src="myimg.png">
|
|
</pre>
|
|
|
|
the tagname would return "img".
|
|
<p> <p>See also <a href="#setTagName">setTagName</a>().
|
|
|
|
<h3 class=fn><a href="tqstring.html">TQString</a> <a name="text"></a>TQDomElement::text () const
|
|
</h3>
|
|
Returns the element's text or <a href="tqstring.html#TQString-null">TQString::null</a>.
|
|
<p> Example:
|
|
<pre>
|
|
<h1>Hello <b>TQt</b> <![CDATA[<xml is cool>]]></h1>
|
|
</pre>
|
|
|
|
<p> The function <a href="#text">text</a>() of the TQDomElement for the <h1> tag,
|
|
will return "Hello TQt <xml is cool>".
|
|
<p> Comments are ignored by this function. It only evaluates <a href="tqdomtext.html">TQDomText</a>
|
|
and <a href="tqdomcdatasection.html">TQDomCDATASection</a> objects.
|
|
|
|
<!-- 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>
|