<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/xml/qxml.cpp:2329 --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>QXmlSimpleReader Class</title> <style type="text/css"><!-- h3.fn,span.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>QXmlSimpleReader Class Reference<br><small>[<a href="xml.html">XML module</a>]</small></h1> <p>The QXmlSimpleReader class provides an implementation of a simple XML reader (parser). <a href="#details">More...</a> <p><tt>#include <<a href="qxml-h.html">qxml.h</a>></tt> <p>Inherits <a href="qxmlreader.html">QXmlReader</a>. <p><a href="qxmlsimplereader-members.html">List of all member functions.</a> <h2>Public Members</h2> <ul> <li><div class=fn><a href="#QXmlSimpleReader"><b>QXmlSimpleReader</b></a> ()</div></li> <li><div class=fn>virtual <a href="#~QXmlSimpleReader"><b>~QXmlSimpleReader</b></a> ()</div></li> <li><div class=fn>virtual bool <a href="#parse"><b>parse</b></a> ( const QXmlInputSource * input, bool incremental )</div></li> <li><div class=fn>virtual bool <a href="#parseContinue"><b>parseContinue</b></a> ()</div></li> </ul> <hr><a name="details"></a><h2>Detailed Description</h2> The QXmlSimpleReader class provides an implementation of a simple XML reader (parser). <p> <p> This XML reader is sufficient for simple parsing tasks. The reader: <ul> <li> provides a well-formed parser; <li> does not parse any external entities; <li> can do namespace processing. </ul> <p> Documents are parsed with a call to <a href="#parse">parse</a>(). <p> See the <a href="xml-sax-walkthrough.html">tiny SAX2 parser walkthrough.</a> <p>See also <a href="xml-tools.html">XML</a>. <hr><h2>Member Function Documentation</h2> <h3 class=fn><a name="QXmlSimpleReader"></a>QXmlSimpleReader::QXmlSimpleReader () </h3> Constructs a simple XML reader with the following feature settings: <ul> <li> <em>http://xml.org/sax/features/namespaces</em> TRUE <li> <em>http://xml.org/sax/features/namespace-prefixes</em> FALSE <li> <em>http://trolltech.com/xml/features/report-whitespace-only-CharData</em> TRUE <li> <em>http://trolltech.com/xml/features/report-start-end-entity</em> FALSE </ul> <p> More information about features can be found in the <a href="xml.html#sax2Features">Qt SAX2 overview.</a> <p> <p>See also <a href="qxmlreader.html#setFeature">setFeature</a>(). <h3 class=fn><a name="~QXmlSimpleReader"></a>QXmlSimpleReader::~QXmlSimpleReader ()<tt> [virtual]</tt> </h3> Destroys the simple XML reader. <h3 class=fn>bool <a name="parse"></a>QXmlSimpleReader::parse ( const <a href="qxmlinputsource.html">QXmlInputSource</a> * input, bool incremental )<tt> [virtual]</tt> </h3> Reads an XML document from <em>input</em> and parses it. Returns FALSE if the parsing detects an error; otherwise returns TRUE. <p> If <em>incremental</em> is TRUE, the parser does not return FALSE when it reaches the end of the <em>input</em> without reaching the end of the XML file. Instead it stores the state of the parser so that parsing can be continued at a later stage when more data is available. You can use the function <a href="#parseContinue">parseContinue</a>() to continue with parsing. This class stores a pointer to the input source <em>input</em> and the parseContinue() tries to read from that input souce. This means you should not delete the input source <em>input</em> until you've finished your calls to parseContinue(). If you call this function with <em>incremental</em> TRUE whilst an incremental parse is in progress a new parsing session will be started and the previous session lost. <p> If <em>incremental</em> is FALSE, this function behaves like the normal parse function, i.e. it returns FALSE when the end of input is reached without reaching the end of the XML file and the parsing can't be continued. <p> <p>See also <a href="#parseContinue">parseContinue</a>() and <a href="qsocket.html">QSocket</a>. <h3 class=fn>bool <a name="parseContinue"></a>QXmlSimpleReader::parseContinue ()<tt> [virtual]</tt> </h3> Continues incremental parsing; this function reads the input from the <a href="qxmlinputsource.html">QXmlInputSource</a> that was specified with the last <a href="#parse">parse</a>() command. To use this function, you <em>must</em> have called parse() with the incremental argument set to TRUE. <p> Returns FALSE if a parsing error occurs; otherwise returns TRUE. <p> If the input source returns an empty string for the function <a href="qxmlinputsource.html#data">QXmlInputSource::data</a>(), then this means that the end of the XML file is reached; this is quite important, especially if you want to use the reader to parse more than one XML file. <p> The case that the end of the XML file is reached without having finished the parsing is not considered as an error -- you can continue parsing at a later stage by calling this function again when there is more data available to parse. <p> This function assumes that the end of the XML document is reached if the <a href="qxmlinputsource.html#next">QXmlInputSource::next</a>() function returns QXmlInputSource::EndOfDocument. If the parser has not finished parsing when it encounters this symbol, it is an error and FALSE is returned. <p> <p>See also <a href="#parse">parse</a>() and <a href="qxmlinputsource.html#next">QXmlInputSource::next</a>(). <!-- eof --> <hr><p> This file is part of the <a href="index.html">Qt toolkit</a>. Copyright © 1995-2001 <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 © 2001 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a> <td align=right><div align=right>Qt version 3.0.2</div> </table></div></address></body> </html>