[190] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
| 2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/xml/qxml.cpp:647 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QXmlAttributes Class</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { background: #ffffff; color: black; }
|
---|
| 12 | --></style>
|
---|
| 13 | </head>
|
---|
| 14 | <body>
|
---|
| 15 |
|
---|
| 16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
| 17 | <tr bgcolor="#E5E5E5">
|
---|
| 18 | <td valign=center>
|
---|
| 19 | <a href="index.html">
|
---|
| 20 | <font color="#004faf">Home</font></a>
|
---|
| 21 | | <a href="classes.html">
|
---|
| 22 | <font color="#004faf">All Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main Classes</font></a>
|
---|
| 25 | | <a href="annotated.html">
|
---|
| 26 | <font color="#004faf">Annotated</font></a>
|
---|
| 27 | | <a href="groups.html">
|
---|
| 28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
| 29 | | <a href="functions.html">
|
---|
| 30 | <font color="#004faf">Functions</font></a>
|
---|
| 31 | </td>
|
---|
| 32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QXmlAttributes Class Reference<br><small>[<a href="xml.html">XML module</a>]</small></h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QXmlAttributes class provides XML attributes.
|
---|
| 35 | <a href="#details">More...</a>
|
---|
| 36 | <p>All the functions in this class are <a href="threads.html#reentrant">reentrant</a> when Qt is built with thread support.</p>
|
---|
| 37 | <p><tt>#include <<a href="qxml-h.html">qxml.h</a>></tt>
|
---|
| 38 | <p><a href="qxmlattributes-members.html">List of all member functions.</a>
|
---|
| 39 | <h2>Public Members</h2>
|
---|
| 40 | <ul>
|
---|
| 41 | <li class=fn><a href="#QXmlAttributes"><b>QXmlAttributes</b></a> ()</li>
|
---|
| 42 | <li class=fn>virtual <a href="#~QXmlAttributes"><b>~QXmlAttributes</b></a> ()</li>
|
---|
| 43 | <li class=fn>int <a href="#index"><b>index</b></a> ( const QString & qName ) const</li>
|
---|
| 44 | <li class=fn>int <a href="#index-2"><b>index</b></a> ( const QString & uri, const QString & localPart ) const</li>
|
---|
| 45 | <li class=fn>int <a href="#length"><b>length</b></a> () const</li>
|
---|
| 46 | <li class=fn>int <a href="#count"><b>count</b></a> () const</li>
|
---|
| 47 | <li class=fn>QString <a href="#localName"><b>localName</b></a> ( int index ) const</li>
|
---|
| 48 | <li class=fn>QString <a href="#qName"><b>qName</b></a> ( int index ) const</li>
|
---|
| 49 | <li class=fn>QString <a href="#uri"><b>uri</b></a> ( int index ) const</li>
|
---|
| 50 | <li class=fn>QString <a href="#type"><b>type</b></a> ( int index ) const</li>
|
---|
| 51 | <li class=fn>QString <a href="#type-2"><b>type</b></a> ( const QString & qName ) const</li>
|
---|
| 52 | <li class=fn>QString <a href="#type-3"><b>type</b></a> ( const QString & uri, const QString & localName ) const</li>
|
---|
| 53 | <li class=fn>QString <a href="#value"><b>value</b></a> ( int index ) const</li>
|
---|
| 54 | <li class=fn>QString <a href="#value-2"><b>value</b></a> ( const QString & qName ) const</li>
|
---|
| 55 | <li class=fn>QString <a href="#value-3"><b>value</b></a> ( const QString & uri, const QString & localName ) const</li>
|
---|
| 56 | <li class=fn>void <a href="#clear"><b>clear</b></a> ()</li>
|
---|
| 57 | <li class=fn>void <a href="#append"><b>append</b></a> ( const QString & qName, const QString & uri, const QString & localPart, const QString & value )</li>
|
---|
| 58 | </ul>
|
---|
| 59 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 60 |
|
---|
| 61 |
|
---|
| 62 |
|
---|
| 63 | The QXmlAttributes class provides XML attributes.
|
---|
| 64 |
|
---|
| 65 | <p>
|
---|
| 66 |
|
---|
| 67 | <p> If attributes are reported by <a href="qxmlcontenthandler.html#startElement">QXmlContentHandler::startElement</a>()
|
---|
| 68 | this class is used to pass the attribute values.
|
---|
| 69 | <p> Use <a href="#index">index</a>() to locate the position of an attribute in the list,
|
---|
| 70 | <a href="#count">count</a>() to retrieve the number of attributes, and <a href="#clear">clear</a>() to
|
---|
| 71 | remove the attributes. New attributes can be added with <a href="#append">append</a>().
|
---|
| 72 | Use <a href="#type">type</a>() to get an attribute's type and <a href="#value">value</a>() to get its
|
---|
| 73 | value. The attribute's name is available from <a href="#localName">localName</a>() or
|
---|
| 74 | <a href="#qName">qName</a>(), and its namespace URI from <a href="#uri">uri</a>().
|
---|
| 75 | <p> <p>See also <a href="xml-tools.html">XML</a>.
|
---|
| 76 |
|
---|
| 77 | <hr><h2>Member Function Documentation</h2>
|
---|
| 78 | <h3 class=fn><a name="QXmlAttributes"></a>QXmlAttributes::QXmlAttributes ()
|
---|
| 79 | </h3>
|
---|
| 80 |
|
---|
| 81 | <p> Constructs an empty attribute list.
|
---|
| 82 |
|
---|
| 83 | <h3 class=fn><a name="~QXmlAttributes"></a>QXmlAttributes::~QXmlAttributes ()<tt> [virtual]</tt>
|
---|
| 84 | </h3>
|
---|
| 85 |
|
---|
| 86 | <p> Destroys the attributes object.
|
---|
| 87 |
|
---|
| 88 | <h3 class=fn>void <a name="append"></a>QXmlAttributes::append ( const <a href="qstring.html">QString</a> & qName, const <a href="qstring.html">QString</a> & uri, const <a href="qstring.html">QString</a> & localPart, const <a href="qstring.html">QString</a> & value )
|
---|
| 89 | </h3>
|
---|
| 90 | Appends a new attribute entry to the list of attributes. The
|
---|
| 91 | qualified name of the attribute is <em>qName</em>, the namespace URI is
|
---|
| 92 | <em>uri</em> and the local name is <em>localPart</em>. The value of the
|
---|
| 93 | attribute is <em>value</em>.
|
---|
| 94 | <p> <p>See also <a href="#qName">qName</a>(), <a href="#uri">uri</a>(), <a href="#localName">localName</a>(), and <a href="#value">value</a>().
|
---|
| 95 |
|
---|
| 96 | <h3 class=fn>void <a name="clear"></a>QXmlAttributes::clear ()
|
---|
| 97 | </h3>
|
---|
| 98 | Clears the list of attributes.
|
---|
| 99 | <p> <p>See also <a href="#append">append</a>().
|
---|
| 100 |
|
---|
| 101 | <h3 class=fn>int <a name="count"></a>QXmlAttributes::count () const
|
---|
| 102 | </h3>
|
---|
| 103 |
|
---|
| 104 | <p> Returns the number of attributes in the list. This function is
|
---|
| 105 | equivalent to <a href="#length">length</a>().
|
---|
| 106 |
|
---|
| 107 | <h3 class=fn>int <a name="index"></a>QXmlAttributes::index ( const <a href="qstring.html">QString</a> & qName ) const
|
---|
| 108 | </h3>
|
---|
| 109 | Looks up the index of an attribute by the qualified name <em>qName</em>.
|
---|
| 110 | <p> Returns the index of the attribute or -1 if it wasn't found.
|
---|
| 111 | <p> See also the <a href="xml.html#sax2Namespaces">namespace description</a>.
|
---|
| 112 |
|
---|
| 113 | <h3 class=fn>int <a name="index-2"></a>QXmlAttributes::index ( const <a href="qstring.html">QString</a> & uri, const <a href="qstring.html">QString</a> & localPart ) const
|
---|
| 114 | </h3>
|
---|
| 115 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 116 | <p> Looks up the index of an attribute by a namespace name.
|
---|
| 117 | <p> <em>uri</em> specifies the namespace URI, or an empty string if the name
|
---|
| 118 | has no namespace URI. <em>localPart</em> specifies the attribute's local
|
---|
| 119 | name.
|
---|
| 120 | <p> Returns the index of the attribute, or -1 if it wasn't found.
|
---|
| 121 | <p> See also the <a href="xml.html#sax2Namespaces">namespace description</a>.
|
---|
| 122 |
|
---|
| 123 | <h3 class=fn>int <a name="length"></a>QXmlAttributes::length () const
|
---|
| 124 | </h3>
|
---|
| 125 | Returns the number of attributes in the list.
|
---|
| 126 | <p> <p>See also <a href="#count">count</a>().
|
---|
| 127 |
|
---|
| 128 | <p>Example: <a href="tagreader-with-features-example.html#x1967">xml/tagreader-with-features/structureparser.cpp</a>.
|
---|
| 129 | <h3 class=fn><a href="qstring.html">QString</a> <a name="localName"></a>QXmlAttributes::localName ( int index ) const
|
---|
| 130 | </h3>
|
---|
| 131 | Looks up an attribute's local name for the attribute at position
|
---|
| 132 | <em>index</em>. If no namespace processing is done, the local name is
|
---|
| 133 | <a href="qstring.html#QString-null">QString::null</a>.
|
---|
| 134 | <p> See also the <a href="xml.html#sax2Namespaces">namespace description</a>.
|
---|
| 135 |
|
---|
| 136 | <h3 class=fn><a href="qstring.html">QString</a> <a name="qName"></a>QXmlAttributes::qName ( int index ) const
|
---|
| 137 | </h3>
|
---|
| 138 | Looks up an attribute's XML 1.0 qualified name for the attribute
|
---|
| 139 | at position <em>index</em>.
|
---|
| 140 | <p> See also the <a href="xml.html#sax2Namespaces">namespace description</a>.
|
---|
| 141 |
|
---|
| 142 | <p>Example: <a href="qlistview.html#x2106">xml/tagreader-with-features/structureparser.cpp</a>.
|
---|
| 143 | <h3 class=fn><a href="qstring.html">QString</a> <a name="type"></a>QXmlAttributes::type ( int index ) const
|
---|
| 144 | </h3>
|
---|
| 145 | Looks up an attribute's type for the attribute at position <em>index</em>.
|
---|
| 146 | <p> Currently only "CDATA" is returned.
|
---|
| 147 |
|
---|
| 148 | <h3 class=fn><a href="qstring.html">QString</a> <a name="type-2"></a>QXmlAttributes::type ( const <a href="qstring.html">QString</a> & qName ) const
|
---|
| 149 | </h3>
|
---|
| 150 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 151 | <p> Looks up an attribute's type for the qualified name <em>qName</em>.
|
---|
| 152 | <p> Currently only "CDATA" is returned.
|
---|
| 153 |
|
---|
| 154 | <h3 class=fn><a href="qstring.html">QString</a> <a name="type-3"></a>QXmlAttributes::type ( const <a href="qstring.html">QString</a> & uri, const <a href="qstring.html">QString</a> & localName ) const
|
---|
| 155 | </h3>
|
---|
| 156 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 157 | <p> Looks up an attribute's type by namespace name.
|
---|
| 158 | <p> <em>uri</em> specifies the namespace URI and <em>localName</em> specifies the
|
---|
| 159 | local name. If the name has no namespace URI, use an empty string
|
---|
| 160 | for <em>uri</em>.
|
---|
| 161 | <p> Currently only "CDATA" is returned.
|
---|
| 162 |
|
---|
| 163 | <h3 class=fn><a href="qstring.html">QString</a> <a name="uri"></a>QXmlAttributes::uri ( int index ) const
|
---|
| 164 | </h3>
|
---|
| 165 | Looks up an attribute's namespace URI for the attribute at
|
---|
| 166 | position <em>index</em>. If no namespace processing is done or if the
|
---|
| 167 | attribute has no namespace, the namespace URI is <a href="qstring.html#QString-null">QString::null</a>.
|
---|
| 168 | <p> See also the <a href="xml.html#sax2Namespaces">namespace description</a>.
|
---|
| 169 |
|
---|
| 170 | <p>Example: <a href="qlistview.html#x2107">xml/tagreader-with-features/structureparser.cpp</a>.
|
---|
| 171 | <h3 class=fn><a href="qstring.html">QString</a> <a name="value"></a>QXmlAttributes::value ( int index ) const
|
---|
| 172 | </h3>
|
---|
| 173 | Looks up an attribute's value for the attribute at position <em>index</em>.
|
---|
| 174 |
|
---|
| 175 | <h3 class=fn><a href="qstring.html">QString</a> <a name="value-2"></a>QXmlAttributes::value ( const <a href="qstring.html">QString</a> & qName ) const
|
---|
| 176 | </h3>
|
---|
| 177 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 178 | <p> Looks up an attribute's value for the qualified name <em>qName</em>.
|
---|
| 179 | <p> See also the <a href="xml.html#sax2Namespaces">namespace description</a>.
|
---|
| 180 |
|
---|
| 181 | <h3 class=fn><a href="qstring.html">QString</a> <a name="value-3"></a>QXmlAttributes::value ( const <a href="qstring.html">QString</a> & uri, const <a href="qstring.html">QString</a> & localName ) const
|
---|
| 182 | </h3>
|
---|
| 183 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 184 | <p> Looks up an attribute's value by namespace name.
|
---|
| 185 | <p> <em>uri</em> specifies the namespace URI, or an empty string if the name
|
---|
| 186 | has no namespace URI. <em>localName</em> specifies the attribute's local
|
---|
| 187 | name.
|
---|
| 188 | <p> See also the <a href="xml.html#sax2Namespaces">namespace description</a>.
|
---|
| 189 |
|
---|
| 190 | <!-- eof -->
|
---|
| 191 | <hr><p>
|
---|
| 192 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 193 | Copyright © 1995-2007
|
---|
| 194 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 195 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 196 | <td>Copyright © 2007
|
---|
| 197 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 198 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 199 | </table></div></address></body>
|
---|
| 200 | </html>
|
---|