summaryrefslogtreecommitdiffstats
path: root/doc/html/qxmlreader.html
blob: 16a2ee49cd279bc5660938feb92b2d971f9d9987 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<!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/qxml.cpp:2348 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQXmlReader 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&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;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>TQXmlReader Class Reference<br><small>[<a href="xml.html">XML module</a>]</small></h1>

<p>The TQXmlReader class provides an interface for XML readers (i.e.
parsers).
<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 &lt;<a href="qxml-h.html">qxml.h</a>&gt;</tt>
<p>Inherited by <a href="qxmlsimplereader.html">TQXmlSimpleReader</a>.
<p><a href="qxmlreader-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn>virtual bool <a href="#feature"><b>feature</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;name, bool&nbsp;*&nbsp;ok = 0 ) const = 0</li>
<li class=fn>virtual void <a href="#setFeature"><b>setFeature</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;name, bool&nbsp;value ) = 0</li>
<li class=fn>virtual bool <a href="#hasFeature"><b>hasFeature</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;name ) const = 0</li>
<li class=fn>virtual void * <a href="#property"><b>property</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;name, bool&nbsp;*&nbsp;ok = 0 ) const = 0</li>
<li class=fn>virtual void <a href="#setProperty"><b>setProperty</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;name, void&nbsp;*&nbsp;value ) = 0</li>
<li class=fn>virtual bool <a href="#hasProperty"><b>hasProperty</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;name ) const = 0</li>
<li class=fn>virtual void <a href="#setEntityResolver"><b>setEntityResolver</b></a> ( TQXmlEntityResolver&nbsp;*&nbsp;handler ) = 0</li>
<li class=fn>virtual TQXmlEntityResolver * <a href="#entityResolver"><b>entityResolver</b></a> () const = 0</li>
<li class=fn>virtual void <a href="#setDTDHandler"><b>setDTDHandler</b></a> ( TQXmlDTDHandler&nbsp;*&nbsp;handler ) = 0</li>
<li class=fn>virtual TQXmlDTDHandler * <a href="#DTDHandler"><b>DTDHandler</b></a> () const = 0</li>
<li class=fn>virtual void <a href="#setContentHandler"><b>setContentHandler</b></a> ( TQXmlContentHandler&nbsp;*&nbsp;handler ) = 0</li>
<li class=fn>virtual TQXmlContentHandler * <a href="#contentHandler"><b>contentHandler</b></a> () const = 0</li>
<li class=fn>virtual void <a href="#setErrorHandler"><b>setErrorHandler</b></a> ( TQXmlErrorHandler&nbsp;*&nbsp;handler ) = 0</li>
<li class=fn>virtual TQXmlErrorHandler * <a href="#errorHandler"><b>errorHandler</b></a> () const = 0</li>
<li class=fn>virtual void <a href="#setLexicalHandler"><b>setLexicalHandler</b></a> ( TQXmlLexicalHandler&nbsp;*&nbsp;handler ) = 0</li>
<li class=fn>virtual TQXmlLexicalHandler * <a href="#lexicalHandler"><b>lexicalHandler</b></a> () const = 0</li>
<li class=fn>virtual void <a href="#setDeclHandler"><b>setDeclHandler</b></a> ( TQXmlDeclHandler&nbsp;*&nbsp;handler ) = 0</li>
<li class=fn>virtual TQXmlDeclHandler * <a href="#declHandler"><b>declHandler</b></a> () const = 0</li>
<li class=fn>virtual bool parse ( const&nbsp;TQXmlInputSource&nbsp;&amp;&nbsp;input ) = 0 &nbsp;<em>(obsolete)</em></li>
<li class=fn>virtual bool <a href="#parse"><b>parse</b></a> ( const&nbsp;TQXmlInputSource&nbsp;*&nbsp;input ) = 0</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>



The TQXmlReader class provides an interface for XML readers (i.e.
parsers).

<p> 

<p> This abstract class provides an interface for all of TQt's XML
readers. Currently there is only one implementation of a reader
included in TQt's XML module: <a href="qxmlsimplereader.html">TQXmlSimpleReader</a>. In future releases
there might be more readers with different properties available
(e.g. a validating parser).
<p> The design of the XML classes follows the <a href="http://www.saxproject.org/">SAX2 Java interface</a>, with
the names adapted to fit TQt naming conventions. It should be very
easy for anybody who has worked with SAX2 to get started with the
TQt XML classes.
<p> All readers use the class <a href="qxmlinputsource.html">TQXmlInputSource</a> to read the input
document. Since you are normally interested in particular content
in the XML document, the reader reports the content through
special handler classes (<a href="qxmldtdhandler.html">TQXmlDTDHandler</a>, <a href="qxmldeclhandler.html">TQXmlDeclHandler</a>,
<a href="qxmlcontenthandler.html">TQXmlContentHandler</a>, <a href="qxmlentityresolver.html">TQXmlEntityResolver</a>, <a href="qxmlerrorhandler.html">TQXmlErrorHandler</a> and
<a href="qxmllexicalhandler.html">TQXmlLexicalHandler</a>), which you must subclass, if you want to
process the contents.
<p> Since the handler classes only describe interfaces you must
implement all the functions. We provide the <a href="qxmldefaulthandler.html">TQXmlDefaultHandler</a>
class to make this easier: it implements a default behaviour (do
nothing) for all functions, so you can subclass it and just
implement the functions you are interested in.
<p> Features and properties of the reader can be set with <a href="#setFeature">setFeature</a>()
and <a href="#setProperty">setProperty</a>() respectively. You can set the reader to use your
own subclasses with <a href="#setEntityResolver">setEntityResolver</a>(), <a href="#setDTDHandler">setDTDHandler</a>(),
<a href="#setContentHandler">setContentHandler</a>(), <a href="#setErrorHandler">setErrorHandler</a>(), <a href="#setLexicalHandler">setLexicalHandler</a>() and
<a href="#setDeclHandler">setDeclHandler</a>(). The parse itself is started with a call to
<a href="#parse">parse</a>().
<p> <p>See also <a href="qxmlsimplereader.html">TQXmlSimpleReader</a> and <a href="xml-tools.html">XML</a>.

<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a href="qxmldtdhandler.html">TQXmlDTDHandler</a>&nbsp;* <a name="DTDHandler"></a>TQXmlReader::DTDHandler () const<tt> [pure virtual]</tt>
</h3>

<p> Returns the DTD handler or 0 if none was set.
<p> <p>See also <a href="#setDTDHandler">setDTDHandler</a>().

<h3 class=fn><a href="qxmlcontenthandler.html">TQXmlContentHandler</a>&nbsp;* <a name="contentHandler"></a>TQXmlReader::contentHandler () const<tt> [pure virtual]</tt>
</h3>

<p> Returns the content handler or 0 if none was set.
<p> <p>See also <a href="#setContentHandler">setContentHandler</a>().

<h3 class=fn><a href="qxmldeclhandler.html">TQXmlDeclHandler</a>&nbsp;* <a name="declHandler"></a>TQXmlReader::declHandler () const<tt> [pure virtual]</tt>
</h3>

<p> Returns the declaration handler or 0 if none was set.
<p> <p>See also <a href="#setDeclHandler">setDeclHandler</a>().

<h3 class=fn><a href="qxmlentityresolver.html">TQXmlEntityResolver</a>&nbsp;* <a name="entityResolver"></a>TQXmlReader::entityResolver () const<tt> [pure virtual]</tt>
</h3>

<p> Returns the entity resolver or 0 if none was set.
<p> <p>See also <a href="#setEntityResolver">setEntityResolver</a>().

<h3 class=fn><a href="qxmlerrorhandler.html">TQXmlErrorHandler</a>&nbsp;* <a name="errorHandler"></a>TQXmlReader::errorHandler () const<tt> [pure virtual]</tt>
</h3>

<p> Returns the error handler or 0 if none is set.
<p> <p>See also <a href="#setErrorHandler">setErrorHandler</a>().

<h3 class=fn>bool <a name="feature"></a>TQXmlReader::feature ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;name, bool&nbsp;*&nbsp;ok = 0 ) const<tt> [pure virtual]</tt>
</h3>

<p> If the reader has the feature called <em>name</em>, the feature's value
is returned. If no such feature exists the return value is
undefined.
<p> If <em>ok</em> is not 0: <em>*ok</em>  is set to TRUE if the reader has the
feature called <em>name</em>; otherwise <em>*ok</em> is set to FALSE.
<p> <p>See also <a href="#setFeature">setFeature</a>() and <a href="#hasFeature">hasFeature</a>().

<h3 class=fn>bool <a name="hasFeature"></a>TQXmlReader::hasFeature ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;name ) const<tt> [pure virtual]</tt>
</h3>

<p> Returns <tt>TRUE</tt> if the reader has the feature called <em>name</em>;
otherwise returns FALSE.
<p> <p>See also <a href="#feature">feature</a>() and <a href="#setFeature">setFeature</a>().

<h3 class=fn>bool <a name="hasProperty"></a>TQXmlReader::hasProperty ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;name ) const<tt> [pure virtual]</tt>
</h3>

<p> Returns TRUE if the reader has the property <em>name</em>; otherwise
returns FALSE.
<p> <p>See also <a href="#property">property</a>() and <a href="#setProperty">setProperty</a>().

<h3 class=fn><a href="qxmllexicalhandler.html">TQXmlLexicalHandler</a>&nbsp;* <a name="lexicalHandler"></a>TQXmlReader::lexicalHandler () const<tt> [pure virtual]</tt>
</h3>

<p> Returns the lexical handler or 0 if none was set.
<p> <p>See also <a href="#setLexicalHandler">setLexicalHandler</a>().

<h3 class=fn>bool <a name="parse"></a>TQXmlReader::parse ( const&nbsp;<a href="qxmlinputsource.html">TQXmlInputSource</a>&nbsp;*&nbsp;input )<tt> [pure virtual]</tt>
</h3>

<p> Reads an XML document from <em>input</em> and parses it. Returns TRUE if
the parsing was successful; otherwise returns FALSE.

<p>Example: <a href="xml-sax-walkthrough.html#x2139">xml/tagreader/tagreader.cpp</a>.
<h3 class=fn>bool <a name="parse-2"></a>TQXmlReader::parse ( const&nbsp;<a href="qxmlinputsource.html">TQXmlInputSource</a>&nbsp;&amp;&nbsp;input )<tt> [pure virtual]</tt>
</h3>

<p> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> 
<h3 class=fn>void * <a name="property"></a>TQXmlReader::property ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;name, bool&nbsp;*&nbsp;ok = 0 ) const<tt> [pure virtual]</tt>
</h3>

<p> If the reader has the property <em>name</em>, this function returns the
value of the property; otherwise the return value is undefined.
<p> If <em>ok</em> is not 0: if the reader has the <em>name</em> property <em>*ok</em>
is set to TRUE; otherwise <em>*ok</em> is set to FALSE.
<p> <p>See also <a href="#setProperty">setProperty</a>() and <a href="#hasProperty">hasProperty</a>().

<h3 class=fn>void <a name="setContentHandler"></a>TQXmlReader::setContentHandler ( <a href="qxmlcontenthandler.html">TQXmlContentHandler</a>&nbsp;*&nbsp;handler )<tt> [pure virtual]</tt>
</h3>

<p> Sets the content handler to <em>handler</em>.
<p> <p>See also <a href="#contentHandler">contentHandler</a>().

<p>Example: <a href="xml-sax-walkthrough.html#x2140">xml/tagreader/tagreader.cpp</a>.
<h3 class=fn>void <a name="setDTDHandler"></a>TQXmlReader::setDTDHandler ( <a href="qxmldtdhandler.html">TQXmlDTDHandler</a>&nbsp;*&nbsp;handler )<tt> [pure virtual]</tt>
</h3>

<p> Sets the DTD handler to <em>handler</em>.
<p> <p>See also <a href="#DTDHandler">DTDHandler</a>().

<h3 class=fn>void <a name="setDeclHandler"></a>TQXmlReader::setDeclHandler ( <a href="qxmldeclhandler.html">TQXmlDeclHandler</a>&nbsp;*&nbsp;handler )<tt> [pure virtual]</tt>
</h3>

<p> Sets the declaration handler to <em>handler</em>.
<p> <p>See also <a href="#declHandler">declHandler</a>().

<h3 class=fn>void <a name="setEntityResolver"></a>TQXmlReader::setEntityResolver ( <a href="qxmlentityresolver.html">TQXmlEntityResolver</a>&nbsp;*&nbsp;handler )<tt> [pure virtual]</tt>
</h3>

<p> Sets the entity resolver to <em>handler</em>.
<p> <p>See also <a href="#entityResolver">entityResolver</a>().

<h3 class=fn>void <a name="setErrorHandler"></a>TQXmlReader::setErrorHandler ( <a href="qxmlerrorhandler.html">TQXmlErrorHandler</a>&nbsp;*&nbsp;handler )<tt> [pure virtual]</tt>
</h3>

<p> Sets the error handler to <em>handler</em>. Clears the error handler if
<em>handler</em> is 0.
<p> <p>See also <a href="#errorHandler">errorHandler</a>().

<h3 class=fn>void <a name="setFeature"></a>TQXmlReader::setFeature ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;name, bool&nbsp;value )<tt> [pure virtual]</tt>
</h3>

<p> Sets the feature called <em>name</em> to the given <em>value</em>. If the
reader doesn't have the feature nothing happens.
<p> <p>See also <a href="#feature">feature</a>() and <a href="#hasFeature">hasFeature</a>().

<p>Reimplemented in <a href="qxmlsimplereader.html#setFeature">TQXmlSimpleReader</a>.
<h3 class=fn>void <a name="setLexicalHandler"></a>TQXmlReader::setLexicalHandler ( <a href="qxmllexicalhandler.html">TQXmlLexicalHandler</a>&nbsp;*&nbsp;handler )<tt> [pure virtual]</tt>
</h3>

<p> Sets the lexical handler to <em>handler</em>.
<p> <p>See also <a href="#lexicalHandler">lexicalHandler</a>().

<h3 class=fn>void <a name="setProperty"></a>TQXmlReader::setProperty ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;name, void&nbsp;*&nbsp;value )<tt> [pure virtual]</tt>
</h3>

<p> Sets the property <em>name</em> to <em>value</em>. If the reader doesn't have
the property nothing happens.
<p> <p>See also <a href="#property">property</a>() and <a href="#hasProperty">hasProperty</a>().

<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt toolkit</a>.
Copyright &copy; 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 &copy; 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>