3
3
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
<!-- /fasttmp/mkdist-qt-4.5.2-1245473805/qt-x11-opensource-src-4.5.2/src/xml/dom/qdom.cpp -->
7
<title>Qt 4.5: QDomElement Class Reference</title>
7
<title>Qt 4.6: QDomElement Class Reference</title>
8
8
<link href="classic.css" rel="stylesheet" type="text/css" />
11
<a name="//apple_ref/cpp/cl//QDomElement" />
11
12
<table border="0" cellpadding="0" cellspacing="0" width="100%">
13
<td align="left" valign="top" width="32"><a href="http://qtsoftware.com/products/qt"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
14
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="namespaces.html"><font color="#004faf">All Namespaces</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="groups.html"><font color="#004faf">Grouped Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a> · <a href="functions.html"><font color="#004faf">Functions</font></a></td>
15
<td align="right" valign="top" width="230"></td></tr></table><h1 class="title">QDomElement Class Reference<br /><span class="small-subtitle">[<a href="qtxml.html">QtXml</a> module]</span>
14
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
15
<td width="1"> </td><td class="postheader" 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="functions.html"><font color="#004faf">All Functions</font></a> · <a href="overviews.html"><font color="#004faf">Overviews</font></a></td><td class="searchBar" align="right" valign="center"><form action="http://www.google.com/cse" id="cse-search-box"><div><input type="hidden" name="cx" value="000136343326384750312:dhbxnqlakyu" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" size="31" /><input type="submit" name="sa" value="Search" /></div></form></td>
16
</tr></table><h1 class="title">QDomElement Class Reference<br /><span class="small-subtitle">[<a href="qtxml.html">QtXml</a> module]</span>
17
18
<p>The QDomElement class represents one element in the DOM tree. <a href="#details">More...</a></p>
18
<pre> #include <QDomElement></pre><p>Inherits <a href="qdomnode.html">QDomNode</a>.</p>
19
<p><b>Note:</b> All the functions in this class are <a href="threads.html#reentrant">reentrant</a>.</p>
19
<pre> #include <QDomElement></pre><p><b>This class is not part of the Qt GUI Framework Edition.</b></p>
20
<p>Inherits <a href="qdomnode.html">QDomNode</a>.</p>
21
<p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
21
23
<li><a href="qdomelement-members.html">List of all members, including inherited members</a></li>
23
26
<a name="public-functions"></a>
24
<h3>Public Functions</h3>
26
<li><div class="fn"></div><b><a href="qdomelement.html#QDomElement">QDomElement</a></b> ()</li>
27
<li><div class="fn"></div><b><a href="qdomelement.html#QDomElement-2">QDomElement</a></b> ( const QDomElement & <i>x</i> )</li>
28
<li><div class="fn"></div>QString <b><a href="qdomelement.html#attribute">attribute</a></b> ( const QString & <i>name</i>, const QString & <i>defValue</i> = QString() ) const</li>
29
<li><div class="fn"></div>QString <b><a href="qdomelement.html#attributeNS">attributeNS</a></b> ( const QString <i>nsURI</i>, const QString & <i>localName</i>, const QString & <i>defValue</i> = QString() ) const</li>
30
<li><div class="fn"></div>QDomAttr <b><a href="qdomelement.html#attributeNode">attributeNode</a></b> ( const QString & <i>name</i> )</li>
31
<li><div class="fn"></div>QDomAttr <b><a href="qdomelement.html#attributeNodeNS">attributeNodeNS</a></b> ( const QString & <i>nsURI</i>, const QString & <i>localName</i> )</li>
32
<li><div class="fn"></div>QDomNamedNodeMap <b><a href="qdomelement.html#attributes">attributes</a></b> () const</li>
33
<li><div class="fn"></div>QDomNodeList <b><a href="qdomelement.html#elementsByTagName">elementsByTagName</a></b> ( const QString & <i>tagname</i> ) const</li>
34
<li><div class="fn"></div>QDomNodeList <b><a href="qdomelement.html#elementsByTagNameNS">elementsByTagNameNS</a></b> ( const QString & <i>nsURI</i>, const QString & <i>localName</i> ) const</li>
35
<li><div class="fn"></div>bool <b><a href="qdomelement.html#hasAttribute">hasAttribute</a></b> ( const QString & <i>name</i> ) const</li>
36
<li><div class="fn"></div>bool <b><a href="qdomelement.html#hasAttributeNS">hasAttributeNS</a></b> ( const QString & <i>nsURI</i>, const QString & <i>localName</i> ) const</li>
37
<li><div class="fn"></div>QDomNode::NodeType <b><a href="qdomelement.html#nodeType">nodeType</a></b> () const</li>
38
<li><div class="fn"></div>void <b><a href="qdomelement.html#removeAttribute">removeAttribute</a></b> ( const QString & <i>name</i> )</li>
39
<li><div class="fn"></div>void <b><a href="qdomelement.html#removeAttributeNS">removeAttributeNS</a></b> ( const QString & <i>nsURI</i>, const QString & <i>localName</i> )</li>
40
<li><div class="fn"></div>QDomAttr <b><a href="qdomelement.html#removeAttributeNode">removeAttributeNode</a></b> ( const QDomAttr & <i>oldAttr</i> )</li>
41
<li><div class="fn"></div>void <b><a href="qdomelement.html#setAttribute">setAttribute</a></b> ( const QString & <i>name</i>, const QString & <i>value</i> )</li>
42
<li><div class="fn"></div>void <b><a href="qdomelement.html#setAttribute-2">setAttribute</a></b> ( const QString & <i>name</i>, int <i>value</i> )</li>
43
<li><div class="fn"></div>void <b><a href="qdomelement.html#setAttribute-3">setAttribute</a></b> ( const QString & <i>name</i>, uint <i>value</i> )</li>
44
<li><div class="fn"></div>void <b><a href="qdomelement.html#setAttribute-4">setAttribute</a></b> ( const QString & <i>name</i>, qlonglong <i>value</i> )</li>
45
<li><div class="fn"></div>void <b><a href="qdomelement.html#setAttribute-5">setAttribute</a></b> ( const QString & <i>name</i>, qulonglong <i>value</i> )</li>
46
<li><div class="fn"></div>void <b><a href="qdomelement.html#setAttribute-6">setAttribute</a></b> ( const QString & <i>name</i>, float <i>value</i> )</li>
47
<li><div class="fn"></div>void <b><a href="qdomelement.html#setAttribute-7">setAttribute</a></b> ( const QString & <i>name</i>, double <i>value</i> )</li>
48
<li><div class="fn"></div>void <b><a href="qdomelement.html#setAttributeNS">setAttributeNS</a></b> ( const QString <i>nsURI</i>, const QString & <i>qName</i>, const QString & <i>value</i> )</li>
49
<li><div class="fn"></div>void <b><a href="qdomelement.html#setAttributeNS-2">setAttributeNS</a></b> ( const QString <i>nsURI</i>, const QString & <i>qName</i>, int <i>value</i> )</li>
50
<li><div class="fn"></div>void <b><a href="qdomelement.html#setAttributeNS-3">setAttributeNS</a></b> ( const QString <i>nsURI</i>, const QString & <i>qName</i>, uint <i>value</i> )</li>
51
<li><div class="fn"></div>void <b><a href="qdomelement.html#setAttributeNS-4">setAttributeNS</a></b> ( const QString <i>nsURI</i>, const QString & <i>qName</i>, qlonglong <i>value</i> )</li>
52
<li><div class="fn"></div>void <b><a href="qdomelement.html#setAttributeNS-5">setAttributeNS</a></b> ( const QString <i>nsURI</i>, const QString & <i>qName</i>, qulonglong <i>value</i> )</li>
53
<li><div class="fn"></div>void <b><a href="qdomelement.html#setAttributeNS-6">setAttributeNS</a></b> ( const QString <i>nsURI</i>, const QString & <i>qName</i>, double <i>value</i> )</li>
54
<li><div class="fn"></div>QDomAttr <b><a href="qdomelement.html#setAttributeNode">setAttributeNode</a></b> ( const QDomAttr & <i>newAttr</i> )</li>
55
<li><div class="fn"></div>QDomAttr <b><a href="qdomelement.html#setAttributeNodeNS">setAttributeNodeNS</a></b> ( const QDomAttr & <i>newAttr</i> )</li>
56
<li><div class="fn"></div>void <b><a href="qdomelement.html#setTagName">setTagName</a></b> ( const QString & <i>name</i> )</li>
57
<li><div class="fn"></div>QString <b><a href="qdomelement.html#tagName">tagName</a></b> () const</li>
58
<li><div class="fn"></div>QString <b><a href="qdomelement.html#text">text</a></b> () const</li>
59
<li><div class="fn"></div>QDomElement & <b><a href="qdomelement.html#operator-eq">operator=</a></b> ( const QDomElement & <i>x</i> )</li>
62
<li><div class="fn"></div>66 public functions inherited from <a href="qdomnode.html#public-functions">QDomNode</a></li>
27
<h2>Public Functions</h2>
28
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
29
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#QDomElement">QDomElement</a></b> ()</td></tr>
30
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#QDomElement-2">QDomElement</a></b> ( const QDomElement & <i>x</i> )</td></tr>
31
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#attribute">attribute</a></b> ( const QString & <i>name</i>, const QString & <i>defValue</i> = QString() ) const</td></tr>
32
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#attributeNS">attributeNS</a></b> ( const QString <i>nsURI</i>, const QString & <i>localName</i>, const QString & <i>defValue</i> = QString() ) const</td></tr>
33
<tr><td class="memItemLeft" align="right" valign="top">QDomAttr </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#attributeNode">attributeNode</a></b> ( const QString & <i>name</i> )</td></tr>
34
<tr><td class="memItemLeft" align="right" valign="top">QDomAttr </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#attributeNodeNS">attributeNodeNS</a></b> ( const QString & <i>nsURI</i>, const QString & <i>localName</i> )</td></tr>
35
<tr><td class="memItemLeft" align="right" valign="top">QDomNamedNodeMap </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#attributes">attributes</a></b> () const</td></tr>
36
<tr><td class="memItemLeft" align="right" valign="top">QDomNodeList </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#elementsByTagName">elementsByTagName</a></b> ( const QString & <i>tagname</i> ) const</td></tr>
37
<tr><td class="memItemLeft" align="right" valign="top">QDomNodeList </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#elementsByTagNameNS">elementsByTagNameNS</a></b> ( const QString & <i>nsURI</i>, const QString & <i>localName</i> ) const</td></tr>
38
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#hasAttribute">hasAttribute</a></b> ( const QString & <i>name</i> ) const</td></tr>
39
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#hasAttributeNS">hasAttributeNS</a></b> ( const QString & <i>nsURI</i>, const QString & <i>localName</i> ) const</td></tr>
40
<tr><td class="memItemLeft" align="right" valign="top">QDomNode::NodeType </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#nodeType">nodeType</a></b> () const</td></tr>
41
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#removeAttribute">removeAttribute</a></b> ( const QString & <i>name</i> )</td></tr>
42
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#removeAttributeNS">removeAttributeNS</a></b> ( const QString & <i>nsURI</i>, const QString & <i>localName</i> )</td></tr>
43
<tr><td class="memItemLeft" align="right" valign="top">QDomAttr </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#removeAttributeNode">removeAttributeNode</a></b> ( const QDomAttr & <i>oldAttr</i> )</td></tr>
44
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#setAttribute">setAttribute</a></b> ( const QString & <i>name</i>, const QString & <i>value</i> )</td></tr>
45
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#setAttribute-2">setAttribute</a></b> ( const QString & <i>name</i>, int <i>value</i> )</td></tr>
46
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#setAttribute-3">setAttribute</a></b> ( const QString & <i>name</i>, uint <i>value</i> )</td></tr>
47
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#setAttribute-4">setAttribute</a></b> ( const QString & <i>name</i>, qlonglong <i>value</i> )</td></tr>
48
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#setAttribute-5">setAttribute</a></b> ( const QString & <i>name</i>, qulonglong <i>value</i> )</td></tr>
49
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#setAttribute-6">setAttribute</a></b> ( const QString & <i>name</i>, float <i>value</i> )</td></tr>
50
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#setAttribute-7">setAttribute</a></b> ( const QString & <i>name</i>, double <i>value</i> )</td></tr>
51
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#setAttributeNS">setAttributeNS</a></b> ( const QString <i>nsURI</i>, const QString & <i>qName</i>, const QString & <i>value</i> )</td></tr>
52
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#setAttributeNS-2">setAttributeNS</a></b> ( const QString <i>nsURI</i>, const QString & <i>qName</i>, int <i>value</i> )</td></tr>
53
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#setAttributeNS-3">setAttributeNS</a></b> ( const QString <i>nsURI</i>, const QString & <i>qName</i>, uint <i>value</i> )</td></tr>
54
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#setAttributeNS-4">setAttributeNS</a></b> ( const QString <i>nsURI</i>, const QString & <i>qName</i>, qlonglong <i>value</i> )</td></tr>
55
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#setAttributeNS-5">setAttributeNS</a></b> ( const QString <i>nsURI</i>, const QString & <i>qName</i>, qulonglong <i>value</i> )</td></tr>
56
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#setAttributeNS-6">setAttributeNS</a></b> ( const QString <i>nsURI</i>, const QString & <i>qName</i>, double <i>value</i> )</td></tr>
57
<tr><td class="memItemLeft" align="right" valign="top">QDomAttr </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#setAttributeNode">setAttributeNode</a></b> ( const QDomAttr & <i>newAttr</i> )</td></tr>
58
<tr><td class="memItemLeft" align="right" valign="top">QDomAttr </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#setAttributeNodeNS">setAttributeNodeNS</a></b> ( const QDomAttr & <i>newAttr</i> )</td></tr>
59
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#setTagName">setTagName</a></b> ( const QString & <i>name</i> )</td></tr>
60
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#tagName">tagName</a></b> () const</td></tr>
61
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#text">text</a></b> () const</td></tr>
62
<tr><td class="memItemLeft" align="right" valign="top">QDomElement & </td><td class="memItemRight" valign="bottom"><b><a href="qdomelement.html#operator-eq">operator=</a></b> ( const QDomElement & <i>x</i> )</td></tr>
65
<li><div bar="2" class="fn"></div>66 public functions inherited from <a href="qdomnode.html#public-functions">QDomNode</a></li>
64
67
<a name="details"></a>
92
95
<p>For further information about the Document Object Model see <a href="http://www.w3.org/TR/REC-DOM-Level-1/">Level 1</a> and <a href="http://www.w3.org/TR/DOM-Level-2-Core/">Level 2 Core</a>. For a more general introduction of the DOM implementation see the <a href="qdomdocument.html">QDomDocument</a> documentation.</p>
94
97
<h2>Member Function Documentation</h2>
98
<a name="//apple_ref/cpp/instm/QDomElement/QDomElement" />
95
99
<h3 class="fn"><a name="QDomElement"></a>QDomElement::QDomElement ()</h3>
96
100
<p>Constructs an empty element. Use the <a href="qdomdocument.html#createElement">QDomDocument::createElement</a>() function to construct elements with content.</p>
97
101
<h3 class="fn"><a name="QDomElement-2"></a>QDomElement::QDomElement ( const QDomElement & <i>x</i> )</h3>
98
102
<p>Constructs a copy of <i>x</i>.</p>
99
103
<p>The data of the copy is shared (shallow copy): modifying one node will also change the other. If you want to make a deep copy, use <a href="qdomnode.html#cloneNode">cloneNode</a>().</p>
104
<a name="//apple_ref/cpp/instm/QDomElement/attribute" />
100
105
<h3 class="fn"><a name="attribute"></a><a href="qstring.html">QString</a> QDomElement::attribute ( const <a href="qstring.html">QString</a> & <i>name</i>, const <a href="qstring.html">QString</a> & <i>defValue</i> = QString() ) const</h3>
101
106
<p>Returns the attribute called <i>name</i>. If the attribute does not exist <i>defValue</i> is returned.</p>
102
107
<p>See also <a href="qdomelement.html#setAttribute">setAttribute</a>(), <a href="qdomelement.html#attributeNode">attributeNode</a>(), <a href="qdomelement.html#setAttributeNode">setAttributeNode</a>(), and <a href="qdomelement.html#attributeNS">attributeNS</a>().</p>
108
<a name="//apple_ref/cpp/instm/QDomElement/attributeNS" />
103
109
<h3 class="fn"><a name="attributeNS"></a><a href="qstring.html">QString</a> QDomElement::attributeNS ( const <a href="qstring.html">QString</a> <i>nsURI</i>, const <a href="qstring.html">QString</a> & <i>localName</i>, const <a href="qstring.html">QString</a> & <i>defValue</i> = QString() ) const</h3>
104
110
<p>Returns the attribute with the local name <i>localName</i> and the namespace URI <i>nsURI</i>. If the attribute does not exist <i>defValue</i> is returned.</p>
105
111
<p>See also <a href="qdomelement.html#setAttributeNS">setAttributeNS</a>(), <a href="qdomelement.html#attributeNodeNS">attributeNodeNS</a>(), <a href="qdomelement.html#setAttributeNodeNS">setAttributeNodeNS</a>(), and <a href="qdomelement.html#attribute">attribute</a>().</p>
112
<a name="//apple_ref/cpp/instm/QDomElement/attributeNode" />
106
113
<h3 class="fn"><a name="attributeNode"></a><a href="qdomattr.html">QDomAttr</a> QDomElement::attributeNode ( const <a href="qstring.html">QString</a> & <i>name</i> )</h3>
107
114
<p>Returns the <a href="qdomattr.html">QDomAttr</a> object that corresponds to the attribute called <i>name</i>. If no such attribute exists a <a href="qdomnode.html#isNull">null attribute</a> is returned.</p>
108
115
<p>See also <a href="qdomelement.html#setAttributeNode">setAttributeNode</a>(), <a href="qdomelement.html#attribute">attribute</a>(), <a href="qdomelement.html#setAttribute">setAttribute</a>(), and <a href="qdomelement.html#attributeNodeNS">attributeNodeNS</a>().</p>
116
<a name="//apple_ref/cpp/instm/QDomElement/attributeNodeNS" />
109
117
<h3 class="fn"><a name="attributeNodeNS"></a><a href="qdomattr.html">QDomAttr</a> QDomElement::attributeNodeNS ( const <a href="qstring.html">QString</a> & <i>nsURI</i>, const <a href="qstring.html">QString</a> & <i>localName</i> )</h3>
110
118
<p>Returns the <a href="qdomattr.html">QDomAttr</a> object that corresponds to the attribute with the local name <i>localName</i> and the namespace URI <i>nsURI</i>. If no such attribute exists a <a href="qdomnode.html#isNull">null attribute</a> is returned.</p>
111
119
<p>See also <a href="qdomelement.html#setAttributeNodeNS">setAttributeNodeNS</a>(), <a href="qdomelement.html#setAttributeNode">setAttributeNode</a>(), <a href="qdomelement.html#attribute">attribute</a>(), and <a href="qdomelement.html#setAttribute">setAttribute</a>().</p>
120
<a name="//apple_ref/cpp/instm/QDomElement/attributes" />
112
121
<h3 class="fn"><a name="attributes"></a><a href="qdomnamednodemap.html">QDomNamedNodeMap</a> QDomElement::attributes () const</h3>
113
122
<p>Returns a <a href="qdomnamednodemap.html">QDomNamedNodeMap</a> containing all this element's attributes.</p>
114
123
<p>See also <a href="qdomelement.html#attribute">attribute</a>(), <a href="qdomelement.html#setAttribute">setAttribute</a>(), <a href="qdomelement.html#attributeNode">attributeNode</a>(), and <a href="qdomelement.html#setAttributeNode">setAttributeNode</a>().</p>
124
<a name="//apple_ref/cpp/instm/QDomElement/elementsByTagName" />
115
125
<h3 class="fn"><a name="elementsByTagName"></a><a href="qdomnodelist.html">QDomNodeList</a> QDomElement::elementsByTagName ( const <a href="qstring.html">QString</a> & <i>tagname</i> ) const</h3>
116
126
<p>Returns a <a href="qdomnodelist.html">QDomNodeList</a> containing all descendants of this element named <i>tagname</i> encountered during a preorder traversal of the element subtree with this element as its root. The order of the elements in the returned list is the order they are encountered during the preorder traversal.</p>
117
127
<p>See also <a href="qdomelement.html#elementsByTagNameNS">elementsByTagNameNS</a>() and <a href="qdomdocument.html#elementsByTagName">QDomDocument::elementsByTagName</a>().</p>
128
<a name="//apple_ref/cpp/instm/QDomElement/elementsByTagNameNS" />
118
129
<h3 class="fn"><a name="elementsByTagNameNS"></a><a href="qdomnodelist.html">QDomNodeList</a> QDomElement::elementsByTagNameNS ( const <a href="qstring.html">QString</a> & <i>nsURI</i>, const <a href="qstring.html">QString</a> & <i>localName</i> ) const</h3>
119
130
<p>Returns a <a href="qdomnodelist.html">QDomNodeList</a> containing all descendants of this element with local name <i>localName</i> and namespace URI <i>nsURI</i> encountered during a preorder traversal of the element subtree with this element as its root. The order of the elements in the returned list is the order they are encountered during the preorder traversal.</p>
120
131
<p>See also <a href="qdomelement.html#elementsByTagName">elementsByTagName</a>() and <a href="qdomdocument.html#elementsByTagNameNS">QDomDocument::elementsByTagNameNS</a>().</p>
132
<a name="//apple_ref/cpp/instm/QDomElement/hasAttribute" />
121
133
<h3 class="fn"><a name="hasAttribute"></a>bool QDomElement::hasAttribute ( const <a href="qstring.html">QString</a> & <i>name</i> ) const</h3>
122
134
<p>Returns true if this element has an attribute called <i>name</i>; otherwise returns false.</p>
123
135
<p><b>Note:</b> This function does not take the presence of namespaces into account. As a result, the specified name will be tested against fully-qualified attribute names that include any namespace prefixes that may be present.</p>
124
136
<p>Use <a href="qdomelement.html#hasAttributeNS">hasAttributeNS</a>() to explicitly test for attributes with specific namespaces and names.</p>
137
<a name="//apple_ref/cpp/instm/QDomElement/hasAttributeNS" />
125
138
<h3 class="fn"><a name="hasAttributeNS"></a>bool QDomElement::hasAttributeNS ( const <a href="qstring.html">QString</a> & <i>nsURI</i>, const <a href="qstring.html">QString</a> & <i>localName</i> ) const</h3>
126
139
<p>Returns true if this element has an attribute with the local name <i>localName</i> and the namespace URI <i>nsURI</i>; otherwise returns false.</p>
140
<a name="//apple_ref/cpp/instm/QDomElement/nodeType" />
127
141
<h3 class="fn"><a name="nodeType"></a><a href="qdomnode.html#NodeType-enum">QDomNode::NodeType</a> QDomElement::nodeType () const</h3>
128
142
<p>Returns <tt>ElementNode</tt>.</p>
143
<a name="//apple_ref/cpp/instm/QDomElement/removeAttribute" />
129
144
<h3 class="fn"><a name="removeAttribute"></a>void QDomElement::removeAttribute ( const <a href="qstring.html">QString</a> & <i>name</i> )</h3>
130
145
<p>Removes the attribute called name <i>name</i> from this element.</p>
131
146
<p>See also <a href="qdomelement.html#setAttribute">setAttribute</a>(), <a href="qdomelement.html#attribute">attribute</a>(), and <a href="qdomelement.html#removeAttributeNS">removeAttributeNS</a>().</p>
147
<a name="//apple_ref/cpp/instm/QDomElement/removeAttributeNS" />
132
148
<h3 class="fn"><a name="removeAttributeNS"></a>void QDomElement::removeAttributeNS ( const <a href="qstring.html">QString</a> & <i>nsURI</i>, const <a href="qstring.html">QString</a> & <i>localName</i> )</h3>
133
149
<p>Removes the attribute with the local name <i>localName</i> and the namespace URI <i>nsURI</i> from this element.</p>
134
150
<p>See also <a href="qdomelement.html#setAttributeNS">setAttributeNS</a>(), <a href="qdomelement.html#attributeNS">attributeNS</a>(), and <a href="qdomelement.html#removeAttribute">removeAttribute</a>().</p>
151
<a name="//apple_ref/cpp/instm/QDomElement/removeAttributeNode" />
135
152
<h3 class="fn"><a name="removeAttributeNode"></a><a href="qdomattr.html">QDomAttr</a> QDomElement::removeAttributeNode ( const <a href="qdomattr.html">QDomAttr</a> & <i>oldAttr</i> )</h3>
136
153
<p>Removes the attribute <i>oldAttr</i> from the element and returns it.</p>
137
154
<p>See also <a href="qdomelement.html#attributeNode">attributeNode</a>() and <a href="qdomelement.html#setAttributeNode">setAttributeNode</a>().</p>
155
<a name="//apple_ref/cpp/instm/QDomElement/setAttribute" />
138
156
<h3 class="fn"><a name="setAttribute"></a>void QDomElement::setAttribute ( const <a href="qstring.html">QString</a> & <i>name</i>, const <a href="qstring.html">QString</a> & <i>value</i> )</h3>
139
157
<p>Adds an attribute called <i>name</i> with value <i>value</i>. If an attribute with the same name exists, its value is replaced by <i>value</i>.</p>
140
158
<p>See also <a href="qdomelement.html#attribute">attribute</a>(), <a href="qdomelement.html#setAttributeNode">setAttributeNode</a>(), and <a href="qdomelement.html#setAttributeNS">setAttributeNS</a>().</p>
170
189
<p>This is an overloaded function.</p>
171
190
<h3 class="fn"><a name="setAttributeNS-6"></a>void QDomElement::setAttributeNS ( const <a href="qstring.html">QString</a> <i>nsURI</i>, const <a href="qstring.html">QString</a> & <i>qName</i>, double <i>value</i> )</h3>
172
191
<p>This is an overloaded function.</p>
192
<a name="//apple_ref/cpp/instm/QDomElement/setAttributeNode" />
173
193
<h3 class="fn"><a name="setAttributeNode"></a><a href="qdomattr.html">QDomAttr</a> QDomElement::setAttributeNode ( const <a href="qdomattr.html">QDomAttr</a> & <i>newAttr</i> )</h3>
174
194
<p>Adds the attribute <i>newAttr</i> to this element.</p>
175
195
<p>If the element has another attribute that has the same name as <i>newAttr</i>, this function replaces that attribute and returns it; otherwise the function returns a <a href="qdomnode.html#isNull">null attribute</a>.</p>
176
196
<p>See also <a href="qdomelement.html#attributeNode">attributeNode</a>(), <a href="qdomelement.html#setAttribute">setAttribute</a>(), and <a href="qdomelement.html#setAttributeNodeNS">setAttributeNodeNS</a>().</p>
197
<a name="//apple_ref/cpp/instm/QDomElement/setAttributeNodeNS" />
177
198
<h3 class="fn"><a name="setAttributeNodeNS"></a><a href="qdomattr.html">QDomAttr</a> QDomElement::setAttributeNodeNS ( const <a href="qdomattr.html">QDomAttr</a> & <i>newAttr</i> )</h3>
178
199
<p>Adds the attribute <i>newAttr</i> to this element.</p>
179
200
<p>If the element has another attribute that has the same local name and namespace URI as <i>newAttr</i>, this function replaces that attribute and returns it; otherwise the function returns a <a href="qdomnode.html#isNull">null attribute</a>.</p>
180
201
<p>See also <a href="qdomelement.html#attributeNodeNS">attributeNodeNS</a>(), <a href="qdomelement.html#setAttributeNS">setAttributeNS</a>(), and <a href="qdomelement.html#setAttributeNode">setAttributeNode</a>().</p>
202
<a name="//apple_ref/cpp/instm/QDomElement/setTagName" />
181
203
<h3 class="fn"><a name="setTagName"></a>void QDomElement::setTagName ( const <a href="qstring.html">QString</a> & <i>name</i> )</h3>
182
204
<p>Sets this element's tag name to <i>name</i>.</p>
183
205
<p>See also <a href="qdomelement.html#tagName">tagName</a>().</p>
206
<a name="//apple_ref/cpp/instm/QDomElement/tagName" />
184
207
<h3 class="fn"><a name="tagName"></a><a href="qstring.html">QString</a> QDomElement::tagName () const</h3>
185
208
<p>Returns the tag name of this element. For an XML element like this:</p>
186
209
<pre> <img src="myimg.png"></pre>
187
210
<p>the tagname would return "img".</p>
188
211
<p>See also <a href="qdomelement.html#setTagName">setTagName</a>().</p>
212
<a name="//apple_ref/cpp/instm/QDomElement/text" />
189
213
<h3 class="fn"><a name="text"></a><a href="qstring.html">QString</a> QDomElement::text () const</h3>
190
214
<p>Returns the element's text or an empty string.</p>