1
<?xml version="1.0" encoding="iso-8859-1"?>
3
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/xml/qxml.cpp -->
7
<title>Qt 4.0: QXmlAttributes Class Reference</title>
8
<style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
9
a:link { color: #004faf; text-decoration: none }
10
a:visited { color: #672967; text-decoration: none }
11
td.postheader { font-family: sans-serif }
12
tr.address { font-family: sans-serif }
13
body { background: #ffffff; color: black; }</style>
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
19
<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="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>
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">QXmlAttributes Class Reference</h1>
21
<p>The QXmlAttributes class provides XML attributes. <a href="#details">More...</a></p>
22
<pre>#include <QXmlAttributes></pre><p>Part of the <a href="qtxml.html">QtXml</a> module.</p>
23
<p><b>Note:</b> All the functions in this class are <a href="threads.html#reentrant">reentrant</a>.</p>
25
<li><a href="qxmlattributes-members.html">List of all members, including inherited members</a></li>
27
<a name="public-functions"></a>
28
<h3>Public Functions</h3>
30
<li><div class="fn"/><b><a href="qxmlattributes.html#QXmlAttributes">QXmlAttributes</a></b> ()</li>
31
<li><div class="fn"/>virtual <b><a href="qxmlattributes.html#dtor.QXmlAttributes">~QXmlAttributes</a></b> ()</li>
32
<li><div class="fn"/>void <b><a href="qxmlattributes.html#append">append</a></b> ( const QString & <i>qName</i>, const QString & <i>uri</i>, const QString & <i>localPart</i>, const QString & <i>value</i> )</li>
33
<li><div class="fn"/>void <b><a href="qxmlattributes.html#clear">clear</a></b> ()</li>
34
<li><div class="fn"/>int <b><a href="qxmlattributes.html#count">count</a></b> () const</li>
35
<li><div class="fn"/>int <b><a href="qxmlattributes.html#index">index</a></b> ( const QString & <i>qName</i> ) const</li>
36
<li><div class="fn"/>int <b><a href="qxmlattributes.html#index-2">index</a></b> ( const QString & <i>uri</i>, const QString & <i>localPart</i> ) const</li>
37
<li><div class="fn"/>int <b><a href="qxmlattributes.html#length">length</a></b> () const</li>
38
<li><div class="fn"/>QString <b><a href="qxmlattributes.html#localName">localName</a></b> ( int <i>index</i> ) const</li>
39
<li><div class="fn"/>QString <b><a href="qxmlattributes.html#qName">qName</a></b> ( int <i>index</i> ) const</li>
40
<li><div class="fn"/>QString <b><a href="qxmlattributes.html#type">type</a></b> ( int <i>index</i> ) const</li>
41
<li><div class="fn"/>QString <b><a href="qxmlattributes.html#type-2">type</a></b> ( const QString & <i>qName</i> ) const</li>
42
<li><div class="fn"/>QString <b><a href="qxmlattributes.html#type-3">type</a></b> ( const QString & <i>uri</i>, const QString & <i>localName</i> ) const</li>
43
<li><div class="fn"/>QString <b><a href="qxmlattributes.html#uri">uri</a></b> ( int <i>index</i> ) const</li>
44
<li><div class="fn"/>QString <b><a href="qxmlattributes.html#value">value</a></b> ( int <i>index</i> ) const</li>
45
<li><div class="fn"/>QString <b><a href="qxmlattributes.html#value-2">value</a></b> ( const QString & <i>qName</i> ) const</li>
46
<li><div class="fn"/>QString <b><a href="qxmlattributes.html#value-3">value</a></b> ( const QString & <i>uri</i>, const QString & <i>localName</i> ) const</li>
48
<a name="details"></a>
50
<h2>Detailed Description</h2>
51
<p>The QXmlAttributes class provides XML attributes.</p>
52
<p>If attributes are reported by <a href="qxmlcontenthandler.html#startElement">QXmlContentHandler::startElement</a>() this class is used to pass the attribute values.</p>
53
<p>Use <a href="qxmlattributes.html#index">index</a>() to locate the position of an attribute in the list, <a href="qxmlattributes.html#count">count</a>() to retrieve the number of attributes, and <a href="qxmlattributes.html#clear">clear</a>() to remove the attributes. New attributes can be added with <a href="qxmlattributes.html#append">append</a>(). Use <a href="qxmlattributes.html#type">type</a>() to get an attribute's type and <a href="qxmlattributes.html#value">value</a>() to get its value. The attribute's name is available from <a href="qxmlattributes.html#localName">localName</a>() or <a href="qxmlattributes.html#qName">qName</a>(), and its namespace URI from <a href="qxmlattributes.html#uri">uri</a>().</p>
55
<h2>Member Function Documentation</h2>
56
<h3 class="fn"><a name="QXmlAttributes"></a>QXmlAttributes::QXmlAttributes ()</h3>
57
<p>Constructs an empty attribute list.</p>
58
<h3 class="fn"><a name="dtor.QXmlAttributes"></a>QXmlAttributes::~QXmlAttributes () <tt> [virtual]</tt></h3>
59
<p>Destroys the attributes object.</p>
60
<h3 class="fn"><a name="append"></a>void QXmlAttributes::append ( const <a href="qstring.html">QString</a> & <i>qName</i>, const <a href="qstring.html">QString</a> & <i>uri</i>, const <a href="qstring.html">QString</a> & <i>localPart</i>, const <a href="qstring.html">QString</a> & <i>value</i> )</h3>
61
<p>Appends a new attribute entry to the list of attributes. The qualified name of the attribute is <i>qName</i>, the namespace URI is <i>uri</i> and the local name is <i>localPart</i>. The value of the attribute is <i>value</i>.</p>
62
<p>See also <a href="qxmlattributes.html#qName">qName</a>(), <a href="qxmlattributes.html#uri">uri</a>(), <a href="qxmlattributes.html#localName">localName</a>(), and <a href="qxmlattributes.html#value">value</a>().</p>
63
<h3 class="fn"><a name="clear"></a>void QXmlAttributes::clear ()</h3>
64
<p>Clears the list of attributes.</p>
65
<p>See also <a href="qxmlattributes.html#append">append</a>().</p>
66
<h3 class="fn"><a name="count"></a>int QXmlAttributes::count () const</h3>
67
<p>Returns the number of attributes in the list. This function is equivalent to <a href="qxmlattributes.html#length">length</a>().</p>
68
<h3 class="fn"><a name="index"></a>int QXmlAttributes::index ( const <a href="qstring.html">QString</a> & <i>qName</i> ) const</h3>
69
<p>Looks up the index of an attribute by the qualified name <i>qName</i>.</p>
70
<p>Returns the index of the attribute or -1 if it wasn't found.</p>
71
<p>See also the <a href="xml.html#sax2namespaces">namespace description</a>.</p>
72
<h3 class="fn"><a name="index-2"></a>int QXmlAttributes::index ( const <a href="qstring.html">QString</a> & <i>uri</i>, const <a href="qstring.html">QString</a> & <i>localPart</i> ) const</h3>
73
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
74
<p>Looks up the index of an attribute by a namespace name.</p>
75
<p><i>uri</i> specifies the namespace URI, or an empty string if the name has no namespace URI. <i>localPart</i> specifies the attribute's local name.</p>
76
<p>Returns the index of the attribute, or -1 if it wasn't found.</p>
77
<p>See also the <a href="xml.html#sax2namespaces">namespace description</a>.</p>
78
<h3 class="fn"><a name="length"></a>int QXmlAttributes::length () const</h3>
79
<p>Returns the number of attributes in the list.</p>
80
<p>See also <a href="qxmlattributes.html#count">count</a>().</p>
81
<h3 class="fn"><a name="localName"></a><a href="qstring.html">QString</a> QXmlAttributes::localName ( int <i>index</i> ) const</h3>
82
<p>Looks up an attribute's local name for the attribute at position <i>index</i>. If no namespace processing is done, the local name is an empty string.</p>
83
<p>See also the <a href="xml.html#sax2namespaces">namespace description</a>.</p>
84
<h3 class="fn"><a name="qName"></a><a href="qstring.html">QString</a> QXmlAttributes::qName ( int <i>index</i> ) const</h3>
85
<p>Looks up an attribute's XML 1.0 qualified name for the attribute at position <i>index</i>.</p>
86
<p>See also the <a href="xml.html#sax2namespaces">namespace description</a>.</p>
87
<h3 class="fn"><a name="type"></a><a href="qstring.html">QString</a> QXmlAttributes::type ( int <i>index</i> ) const</h3>
88
<p>Looks up an attribute's type for the attribute at position <i>index</i>.</p>
89
<p>Currently only "CDATA" is returned.</p>
90
<h3 class="fn"><a name="type-2"></a><a href="qstring.html">QString</a> QXmlAttributes::type ( const <a href="qstring.html">QString</a> & <i>qName</i> ) const</h3>
91
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
92
<p>Looks up an attribute's type for the qualified name <i>qName</i>.</p>
93
<p>Currently only "CDATA" is returned.</p>
94
<h3 class="fn"><a name="type-3"></a><a href="qstring.html">QString</a> QXmlAttributes::type ( const <a href="qstring.html">QString</a> & <i>uri</i>, const <a href="qstring.html">QString</a> & <i>localName</i> ) const</h3>
95
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
96
<p>Looks up an attribute's type by namespace name.</p>
97
<p><i>uri</i> specifies the namespace URI and <i>localName</i> specifies the local name. If the name has no namespace URI, use an empty string for <i>uri</i>.</p>
98
<p>Currently only "CDATA" is returned.</p>
99
<h3 class="fn"><a name="uri"></a><a href="qstring.html">QString</a> QXmlAttributes::uri ( int <i>index</i> ) const</h3>
100
<p>Looks up an attribute's namespace URI for the attribute at position <i>index</i>. If no namespace processing is done or if the attribute has no namespace, the namespace URI is an empty string.</p>
101
<p>See also the <a href="xml.html#sax2namespaces">namespace description</a>.</p>
102
<h3 class="fn"><a name="value"></a><a href="qstring.html">QString</a> QXmlAttributes::value ( int <i>index</i> ) const</h3>
103
<p>Returns an attribute's value for the attribute at position <i>index</i>. The index must be a valid position (i.e., 0 <= <i>index</i> < <a href="qxmlattributes.html#count">count</a>()).</p>
104
<h3 class="fn"><a name="value-2"></a><a href="qstring.html">QString</a> QXmlAttributes::value ( const <a href="qstring.html">QString</a> & <i>qName</i> ) const</h3>
105
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
106
<p>Returns an attribute's value for the qualified name <i>qName</i>, or an empty string if no attribute exists for the name given.</p>
107
<p>See also the <a href="xml.html#sax2namespaces">namespace description</a>.</p>
108
<h3 class="fn"><a name="value-3"></a><a href="qstring.html">QString</a> QXmlAttributes::value ( const <a href="qstring.html">QString</a> & <i>uri</i>, const <a href="qstring.html">QString</a> & <i>localName</i> ) const</h3>
109
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
110
<p>Returns an attribute's value by namespace name.</p>
111
<p><i>uri</i> specifies the namespace URI, or an empty string if the name has no namespace URI. <i>localName</i> specifies the attribute's local name.</p>
112
<p>See also the <a href="xml.html#sax2namespaces">namespace description</a>.</p>
113
<p /><address><hr /><div align="center">
114
<table width="100%" cellspacing="0" border="0"><tr class="address">
115
<td width="30%">Copyright © 2005 <a href="trolltech.html">Trolltech</a></td>
116
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
117
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
118
</tr></table></div></address></body>