Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The QXmlReader class provides an interface for XML readers (i.e. parsers). More...
#include <qxml.h>
Inherited by QXmlSimpleReader.
This abstract class provides an interface for all XML readers in Qt. At the moment there is only one implementation of a reader included in the XML module of Qt (QXmlSimpleReader). In future releases there might be more readers with different properties available (e.g. a validating parser).
The design of the XML classes follows the SAX2 java interface. It was adapted to fit the Qt naming conventions; so it should be very easy for anybody who has worked with SAX2 to get started with the Qt XML classes.
All readers use the class QXmlInputSource 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 (QXmlDTDHandler, QXmlDeclHandler, QXmlContentHandler, QXmlEntityResolver, QXmlErrorHandler and QXmlLexicalHandler), which you must subclass, if you want to process the contents..
Since the handler classes describe only interfaces you must implement all functions; there is a class (QXmlDefaultHandler) to make this easier; it implements a default behaviour (do nothing) for all functions.
Features and properties of the reader can be set with setFeature() and setProperty respectively. You can set the reader to use your own subclasses with setEntityResolver(), setDTDHandler(), setContentHandler(), setErrorHandler(), setLexicalHandler() and setDeclHandler(). The parse itself is started with a call to parse().
For getting started see also the tiny SAX2 parser walkthrough.
See also QXmlSimpleReader and XML.
Returns the DTD handler or 0 if none was set.
See also setDTDHandler().
Returns the content handler or 0 if none was set.
See also setContentHandler().
Returns the declaration handler or 0 if none was set.
See also setDeclHandler().
Returns the entity resolver or 0 if none was set.
See also setEntityResolver().
Returns the error handler or 0 if none was set.
See also setErrorHandler().
If the reader has the feature called name, the feature's value is returned. If no such feature exists the return value is undefined.
If ok is not 0, then *ok is set to TRUE if the reader has the feature called name; otherwise *ok is set to FALSE.
See also setFeature() and hasFeature().
Returns TRUE if the reader has the feature name; otherwise returns FALSE.
See also feature() and setFeature().
Returns TRUE if the reader has the property name; otherwise returns FALSE.
See also property() and setProperty().
Returns the lexical handler or 0 if none was set.
See also setLexicalHandler().
Reads an XML document from input and parses it. Returns TRUE if the parsing was successful; otherwise returns FALSE.
Examples: xml/tagreader-with-features/tagreader.cpp and xml/tagreader/tagreader.cpp.
This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code.
If the reader has the property name, this function returns the value of the property and sets *ok to TRUE; otherwise *ok is set to FALSE.
See also setProperty() and hasProperty().
Sets the content handler to handler.
See also contentHandler().
Examples: xml/tagreader-with-features/tagreader.cpp and xml/tagreader/tagreader.cpp.
Sets the DTD handler to handler.
See also DTDHandler().
Sets the declaration handler to handler.
See also declHandler().
Sets the entity resolver to handler.
See also entityResolver().
Sets the error handler to handler. Clears the error handler if handler is 0.
See also errorHandler().
Sets the feature called name to the given value. If the reader doesn't have the feature nothing happens.
See also feature() and hasFeature().
Example: xml/tagreader-with-features/tagreader.cpp.
Sets the lexical handler to handler.
See also lexicalHandler().
Sets the property name to value. If the reader doesn't have the property nothing happens.
See also property() and hasProperty().
This file is part of the Qt toolkit. Copyright © 1995-2002 Trolltech. All Rights Reserved.
Copyright © 2002 Trolltech | Trademarks | Qt version 3.0.4
|