'\" t .TH TQXmlSimpleReader 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. .\" .ad l .nh .SH NAME TQXmlSimpleReader \- Implementation of a simple XML reader (parser) .SH SYNOPSIS All the functions in this class are reentrant when TQt is built with thread support.

.PP \fC#include \fR .PP Inherits TQXmlReader. .PP .SS "Public Members" .in +1c .ti -1c .BI "\fBTQXmlSimpleReader\fR ()" .br .ti -1c .BI "virtual \fB~TQXmlSimpleReader\fR ()" .br .ti -1c .BI "virtual void \fBsetFeature\fR ( const TQString & name, bool value )" .br .ti -1c .BI "virtual bool \fBparse\fR ( const TQXmlInputSource * input, bool incremental )" .br .ti -1c .BI "virtual bool \fBparseContinue\fR ()" .br .in -1c .SH DESCRIPTION The TQXmlSimpleReader class provides an implementation of a simple XML reader (parser). .PP This XML reader is sufficient for simple parsing tasks. The reader: .TP provides a well-formed parser; .TP does not parse any external entities; .TP can do namespace processing. .PP Documents are parsed with a call to parse(). .PP See also XML. .SH MEMBER FUNCTION DOCUMENTATION .SH "TQXmlSimpleReader::TQXmlSimpleReader ()" Constructs a simple XML reader with the following feature settings:
.nf .TS l - l. Feature Setting \fIhttp://xml.org/sax/features/namespaces\fR TRUE \fIhttp://xml.org/sax/features/namespace-prefixes\fR FALSE \fIhttp://trolltech.com/xml/features/report-whitespace-only-CharData\fR TRUE \fIhttp://trolltech.com/xml/features/report-start-end-entity\fR .TE .fi
.PP More information about features can be found in the TQt SAX2 overview. .PP See also setFeature(). .SH "TQXmlSimpleReader::~TQXmlSimpleReader ()\fC [virtual]\fR" Destroys the simple XML reader. .SH "bool TQXmlSimpleReader::parse ( const TQXmlInputSource * input, bool incremental )\fC [virtual]\fR" Reads an XML document from \fIinput\fR and parses it. Returns FALSE if the parsing detects an error; otherwise returns TRUE. .PP If \fIincremental\fR is TRUE, the parser does not return FALSE when it reaches the end of the \fIinput\fR 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 parseContinue() to continue with parsing. This class stores a pointer to the input source \fIinput\fR and the parseContinue() function tries to read from that input souce. This means that you should not delete the input source \fIinput\fR until you've finished your calls to parseContinue(). If you call this function with \fIincremental\fR TRUE whilst an incremental parse is in progress a new parsing session will be started and the previous session lost. .PP If \fIincremental\fR 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 cannot be continued. .PP See also parseContinue() and TQSocket. .PP Examples: .)l xml/tagreader-with-features/tagreader.cpp and xml/tagreader/tagreader.cpp. .SH "bool TQXmlSimpleReader::parseContinue ()\fC [virtual]\fR" Continues incremental parsing; this function reads the input from the TQXmlInputSource that was specified with the last parse() command. To use this function, you \fImust\fR have called parse() with the incremental argument set to TRUE. .PP Returns FALSE if a parsing error occurs; otherwise returns TRUE. .PP If the input source returns an empty string for the function TQXmlInputSource::data(), then this means that the end of the XML file has been reached; this is quite important, especially if you want to use the reader to parse more than one XML file. .PP The case of the end of the XML file being reached without having finished parsing is not considered to be an error: you can continue parsing at a later stage by calling this function again when there is more data available to parse. .PP This function assumes that the end of the XML document is reached if the TQXmlInputSource::next() function returns TQXmlInputSource::EndOfDocument. If the parser has not finished parsing when it encounters this symbol, it is an error and FALSE is returned. .PP See also parse() and TQXmlInputSource::next(). .SH "void TQXmlSimpleReader::setFeature ( const TQString & name, bool value )\fC [virtual]\fR" Sets the state of the feature \fIname\fR to \fIvalue\fR: .PP If the feature is not recognized, it is ignored. .PP The following features are supported:
.nf .TS l - l. Feature Notes \fIhttp://xml.org/sax/features/namespaces\fR If this feature is TRUE, namespace processing is performed. \fIhttp://xml.org/sax/features/namespace-prefixes\fR If this feature is TRUE, the the original prefixed names and attributes used for namespace declarations are reported. \fIhttp://trolltech.com/xml/features/report-whitespace-only-CharData\fR If this feature is TRUE, CharData that only contain whitespace are not ignored, but are reported via TQXmlContentHandler::characters(). \fIhttp://trolltech.com/xml/features/report-start-end-entity\fR .TE .fi
.PP .nf .br ** $Id: qt/tagreader.cpp 3.3.8 edited Jan 11 14:46 $ .fi .PP .nf .br reader.setFeature( "http://xml.org/sax/features/namespace-prefixes", .br TRUE ); .fi .PP (Code taken from xml/tagreader-with-features/tagreader.cpp) .PP See also feature() and hasFeature(). .PP Example: xml/tagreader-with-features/tagreader.cpp. .PP Reimplemented from TQXmlReader. .SH "SEE ALSO" .BR http://doc.trolltech.com/tqxmlsimplereader.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. .SH AUTHOR Generated automatically from the source code. .SH BUGS If you find a bug in Qt, please report it as described in .BR http://doc.trolltech.com/bughowto.html . Good bug reports help us to help you. Thank you. .P The definitive TQt documentation is provided in HTML format; it is located at $TQTDIR/doc/html and can be read using TQt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. .P If you find errors in this manual page, please report them to .BR qt-bugs@trolltech.com . Please include the name of the manual page (tqxmlsimplereader.3qt) and the Qt version (3.3.8).