Public Member Functions | List of all members
QXmlContentHandler Class Referenceabstract

The QXmlContentHandler class provides an interface to report logical content of XML data. More...

#include <qxml.h>

Inheritance diagram for QXmlContentHandler:
QXmlDefaultHandler BaseHandler< T > BaseHandler< AnchorHandler > BaseHandler< ChildNodeHandler > BaseHandler< CodeLineHandler > BaseHandler< CompoundHandler > BaseHandler< CopyHandler > BaseHandler< DocHandler > BaseHandler< DocInternalHandler > BaseHandler< DocSectionHandler > BaseHandler< DotFileHandler > BaseHandler< EdgeLabelHandler > BaseHandler< EMailHandler > BaseHandler< EntryHandler > BaseHandler< FormulaHandler > BaseHandler< GraphHandler > BaseHandler< HighlightHandler > BaseHandler< HRulerHandler > BaseHandler< ImageHandler > BaseHandler< IncludeHandler > BaseHandler< IndexEntryHandler > BaseHandler< ItemizedListHandler > BaseHandler< LineBreakHandler > BaseHandler< LinkedTextHandler > BaseHandler< LinkHandler > BaseHandler< ListItemHandler > BaseHandler< ListOfAllMembersHandler > BaseHandler< MainHandler > BaseHandler< MemberHandler > BaseHandler< NodeHandler > BaseHandler< OrderedListHandler > BaseHandler< ParagraphHandler > BaseHandler< ParameterHandler > BaseHandler< ParameterItemHandler > BaseHandler< ParameterListHandler > BaseHandler< ParamHandler > BaseHandler< ProgramListingHandler > BaseHandler< RefHandler > BaseHandler< RowHandler > BaseHandler< SectionHandler > BaseHandler< SimpleSectHandler > BaseHandler< SymbolHandler > BaseHandler< TableHandler > BaseHandler< TemplateParamListHandler > BaseHandler< TitleHandler > BaseHandler< TocItemHandler > BaseHandler< TocListHandler > BaseHandler< ULinkHandler > BaseHandler< VariableListEntryHandler > BaseHandler< VariableListHandler > BaseHandler< VerbatimHandler > LayoutParser TagFileParser XMLContentHandler

Public Member Functions

virtual ~QXmlContentHandler ()
 
virtual void setDocumentLocator (QXmlLocator *locator)=0
 
virtual bool startDocument ()=0
 
virtual bool endDocument ()=0
 
virtual bool startPrefixMapping (const QString &prefix, const QString &uri)=0
 
virtual bool endPrefixMapping (const QString &prefix)=0
 
virtual bool startElement (const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)=0
 
virtual bool endElement (const QString &namespaceURI, const QString &localName, const QString &qName)=0
 
virtual bool characters (const QString &ch)=0
 
virtual bool ignorableWhitespace (const QString &ch)=0
 
virtual bool processingInstruction (const QString &target, const QString &data)=0
 
virtual bool skippedEntity (const QString &name)=0
 
virtual QString errorString ()=0
 

Detailed Description

The QXmlContentHandler class provides an interface to report logical content of XML data.

XML

If the application needs to be informed of basic parsing events, it implements this interface and sets it with QXmlReader::setContentHandler(). The reader reports basic document-related events like the start and end of elements and character data through this interface.

The order of events in this interface is very important, and mirrors the order of information in the document itself. For example, all of an element's content (character data, processing instructions, and/or subelements) will appear, in order, between the startElement() event and the corresponding endElement() event.

The class QXmlDefaultHandler gives a default implementation for this interface; subclassing from this class is very convenient if you want only be informed of some parsing events.

See also the Introduction to SAX2.

See also
QXmlDTDHandler QXmlDeclHandler QXmlEntityResolver QXmlErrorHandler QXmlLexicalHandler

Definition at line 402 of file qxml.h.

Constructor & Destructor Documentation

virtual QXmlContentHandler::~QXmlContentHandler ( )
inlinevirtual

Definition at line 405 of file qxml.h.

405 {}

Member Function Documentation

bool QXmlContentHandler::characters ( const QString ch)
pure virtual

The reader calls this function when he has parsed a chunk of character data (either normal character data or character data inside a CDATA section; if you have to distinguish between those two types you have to use QXmlLexicalHandler::startCDATA() and QXmlLexicalHandler::endCDATA() in addition).

Some readers will report whitespace in element content using the ignorableWhitespace() function rather than this one (QXmlSimpleReader will do it not though).

A reader is allowed to report the character data of an element in more than one chunk; e.g. a reader might want to report "a &amp;lt; b" in three characters() events ("a ", "<" and " b").

If this function returns FALSE the reader will stop parsing and will report an error. The reader will use the function errorString() to get the error message that will be used for reporting the error.

Implemented in TagFileParser, QXmlDefaultHandler, XMLContentHandler, BaseHandler< T >, BaseHandler< ProgramListingHandler >, BaseHandler< DocInternalHandler >, BaseHandler< ListItemHandler >, BaseHandler< TocListHandler >, BaseHandler< HighlightHandler >, BaseHandler< TocItemHandler >, BaseHandler< SectionHandler >, BaseHandler< LinkHandler >, BaseHandler< VerbatimHandler >, BaseHandler< GraphHandler >, BaseHandler< FormulaHandler >, BaseHandler< EMailHandler >, BaseHandler< ULinkHandler >, BaseHandler< VariableListEntryHandler >, BaseHandler< NodeHandler >, BaseHandler< ParameterItemHandler >, BaseHandler< CompoundHandler >, BaseHandler< LinkedTextHandler >, BaseHandler< EntryHandler >, BaseHandler< ChildNodeHandler >, BaseHandler< TableHandler >, BaseHandler< ParamHandler >, BaseHandler< HRulerHandler >, BaseHandler< DocHandler >, BaseHandler< SimpleSectHandler >, BaseHandler< TemplateParamListHandler >, BaseHandler< ParagraphHandler >, BaseHandler< RowHandler >, BaseHandler< SymbolHandler >, BaseHandler< ListOfAllMembersHandler >, BaseHandler< TitleHandler >, BaseHandler< OrderedListHandler >, BaseHandler< IncludeHandler >, BaseHandler< IndexEntryHandler >, BaseHandler< MainHandler >, BaseHandler< VariableListHandler >, BaseHandler< ImageHandler >, BaseHandler< EdgeLabelHandler >, BaseHandler< CodeLineHandler >, BaseHandler< AnchorHandler >, BaseHandler< ParameterHandler >, BaseHandler< ItemizedListHandler >, BaseHandler< DocSectionHandler >, BaseHandler< ParameterListHandler >, BaseHandler< MemberHandler >, BaseHandler< RefHandler >, BaseHandler< CopyHandler >, BaseHandler< DotFileHandler >, and BaseHandler< LineBreakHandler >.

bool QXmlContentHandler::endDocument ( )
pure virtual

The reader calls this function after he has finished the parsing. It is only called once. It is the last function of all handler functions that is called. It is called after the reader has read all input or has abandoned parsing because of a fatal error.

If this function returns FALSE the reader will stop parsing and will report an error. The reader will use the function errorString() to get the error message that will be used for reporting the error.

See also
startDocument()

Implemented in QXmlDefaultHandler.

bool QXmlContentHandler::endElement ( const QString namespaceURI,
const QString localName,
const QString qName 
)
pure virtual

The reader calls this function when he has parsed an end element tag.

If this function returns FALSE the reader will stop parsing and will report an error. The reader will use the function errorString() to get the error message that will be used for reporting the error.

See also the namespace description.

See also
startElement()

Implemented in LayoutParser, TagFileParser, QXmlDefaultHandler, XMLContentHandler, BaseHandler< T >, BaseHandler< ProgramListingHandler >, BaseHandler< DocInternalHandler >, BaseHandler< ListItemHandler >, BaseHandler< TocListHandler >, BaseHandler< HighlightHandler >, BaseHandler< TocItemHandler >, BaseHandler< SectionHandler >, BaseHandler< LinkHandler >, BaseHandler< VerbatimHandler >, BaseHandler< GraphHandler >, BaseHandler< FormulaHandler >, BaseHandler< EMailHandler >, BaseHandler< ULinkHandler >, BaseHandler< VariableListEntryHandler >, BaseHandler< NodeHandler >, BaseHandler< ParameterItemHandler >, BaseHandler< CompoundHandler >, BaseHandler< LinkedTextHandler >, BaseHandler< EntryHandler >, BaseHandler< ChildNodeHandler >, BaseHandler< TableHandler >, BaseHandler< ParamHandler >, BaseHandler< HRulerHandler >, BaseHandler< DocHandler >, BaseHandler< SimpleSectHandler >, BaseHandler< TemplateParamListHandler >, BaseHandler< ParagraphHandler >, BaseHandler< RowHandler >, BaseHandler< SymbolHandler >, BaseHandler< ListOfAllMembersHandler >, BaseHandler< TitleHandler >, BaseHandler< OrderedListHandler >, BaseHandler< IncludeHandler >, BaseHandler< IndexEntryHandler >, BaseHandler< MainHandler >, BaseHandler< VariableListHandler >, BaseHandler< ImageHandler >, BaseHandler< EdgeLabelHandler >, BaseHandler< CodeLineHandler >, BaseHandler< AnchorHandler >, BaseHandler< ParameterHandler >, BaseHandler< ItemizedListHandler >, BaseHandler< DocSectionHandler >, BaseHandler< ParameterListHandler >, BaseHandler< MemberHandler >, BaseHandler< RefHandler >, BaseHandler< CopyHandler >, BaseHandler< DotFileHandler >, and BaseHandler< LineBreakHandler >.

bool QXmlContentHandler::endPrefixMapping ( const QString prefix)
pure virtual

The reader calls this function to signal the end of a prefix mapping.

If this function returns FALSE the reader will stop parsing and will report an error. The reader will use the function errorString() to get the error message that will be used for reporting the error.

See also the namespace description.

See also
startPrefixMapping()

Implemented in QXmlDefaultHandler.

QString QXmlContentHandler::errorString ( )
pure virtual

The reader calls this function to get an error string if any of the handler functions returns FALSE to him.

Implemented in QXmlDefaultHandler.

bool QXmlContentHandler::ignorableWhitespace ( const QString ch)
pure virtual

Some readers may use this function to report each chunk of whitespace in element content (QXmlSimpleReader does not though).

If this function returns FALSE the reader will stop parsing and will report an error. The reader will use the function errorString() to get the error message that will be used for reporting the error.

Implemented in QXmlDefaultHandler.

bool QXmlContentHandler::processingInstruction ( const QString target,
const QString data 
)
pure virtual

The reader calls this function when he has parsed a processing instruction.

target is the target name of the processing instruction and data is the data of the processing instruction.

If this function returns FALSE the reader will stop parsing and will report an error. The reader will use the function errorString() to get the error message that will be used for reporting the error.

Implemented in QXmlDefaultHandler.

void QXmlContentHandler::setDocumentLocator ( QXmlLocator locator)
pure virtual

The reader calls this function before he starts parsing the document. The argument locator is a pointer to a QXmlLocator which allows the application to get the actual position of the parsing in the document.

Do not destroy the locator; it is destroyed when the reader is destroyed (do not use the locator after the reader got destroyed).

Implemented in QXmlDefaultHandler, BaseHandler< T >, BaseHandler< ProgramListingHandler >, BaseHandler< DocInternalHandler >, BaseHandler< ListItemHandler >, BaseHandler< TocListHandler >, BaseHandler< HighlightHandler >, BaseHandler< TocItemHandler >, BaseHandler< SectionHandler >, BaseHandler< LinkHandler >, BaseHandler< VerbatimHandler >, BaseHandler< GraphHandler >, BaseHandler< FormulaHandler >, BaseHandler< EMailHandler >, BaseHandler< ULinkHandler >, BaseHandler< VariableListEntryHandler >, BaseHandler< NodeHandler >, BaseHandler< ParameterItemHandler >, BaseHandler< CompoundHandler >, BaseHandler< LinkedTextHandler >, BaseHandler< EntryHandler >, BaseHandler< ChildNodeHandler >, BaseHandler< TableHandler >, BaseHandler< ParamHandler >, BaseHandler< HRulerHandler >, BaseHandler< DocHandler >, BaseHandler< SimpleSectHandler >, BaseHandler< TemplateParamListHandler >, BaseHandler< ParagraphHandler >, BaseHandler< RowHandler >, BaseHandler< SymbolHandler >, BaseHandler< ListOfAllMembersHandler >, BaseHandler< TitleHandler >, BaseHandler< OrderedListHandler >, BaseHandler< IncludeHandler >, BaseHandler< IndexEntryHandler >, BaseHandler< MainHandler >, BaseHandler< VariableListHandler >, BaseHandler< ImageHandler >, BaseHandler< EdgeLabelHandler >, BaseHandler< CodeLineHandler >, BaseHandler< AnchorHandler >, BaseHandler< ParameterHandler >, BaseHandler< ItemizedListHandler >, BaseHandler< DocSectionHandler >, BaseHandler< ParameterListHandler >, BaseHandler< MemberHandler >, BaseHandler< RefHandler >, BaseHandler< CopyHandler >, BaseHandler< DotFileHandler >, BaseHandler< LineBreakHandler >, and TagFileParser.

bool QXmlContentHandler::skippedEntity ( const QString name)
pure virtual

Some readers may skip entities if they have not seen the declarations (e.g. because they are in an external DTD). If they do so they will report it by calling this function.

If this function returns FALSE the reader will stop parsing and will report an error. The reader will use the function errorString() to get the error message that will be used for reporting the error.

Implemented in QXmlDefaultHandler, BaseHandler< T >, BaseHandler< ProgramListingHandler >, BaseHandler< DocInternalHandler >, BaseHandler< ListItemHandler >, BaseHandler< TocListHandler >, BaseHandler< HighlightHandler >, BaseHandler< TocItemHandler >, BaseHandler< SectionHandler >, BaseHandler< LinkHandler >, BaseHandler< VerbatimHandler >, BaseHandler< GraphHandler >, BaseHandler< FormulaHandler >, BaseHandler< EMailHandler >, BaseHandler< ULinkHandler >, BaseHandler< VariableListEntryHandler >, BaseHandler< NodeHandler >, BaseHandler< ParameterItemHandler >, BaseHandler< CompoundHandler >, BaseHandler< LinkedTextHandler >, BaseHandler< EntryHandler >, BaseHandler< ChildNodeHandler >, BaseHandler< TableHandler >, BaseHandler< ParamHandler >, BaseHandler< HRulerHandler >, BaseHandler< DocHandler >, BaseHandler< SimpleSectHandler >, BaseHandler< TemplateParamListHandler >, BaseHandler< ParagraphHandler >, BaseHandler< RowHandler >, BaseHandler< SymbolHandler >, BaseHandler< ListOfAllMembersHandler >, BaseHandler< TitleHandler >, BaseHandler< OrderedListHandler >, BaseHandler< IncludeHandler >, BaseHandler< IndexEntryHandler >, BaseHandler< MainHandler >, BaseHandler< VariableListHandler >, BaseHandler< ImageHandler >, BaseHandler< EdgeLabelHandler >, BaseHandler< CodeLineHandler >, BaseHandler< AnchorHandler >, BaseHandler< ParameterHandler >, BaseHandler< ItemizedListHandler >, BaseHandler< DocSectionHandler >, BaseHandler< ParameterListHandler >, BaseHandler< MemberHandler >, BaseHandler< RefHandler >, BaseHandler< CopyHandler >, BaseHandler< DotFileHandler >, and BaseHandler< LineBreakHandler >.

bool QXmlContentHandler::startDocument ( )
pure virtual

The reader calls this function when he starts parsing the document. The reader will call this function only once before any other functions in this class or in the QXmlDTDHandler class are called (except QXmlContentHandler::setDocumentLocator()).

If this function returns FALSE the reader will stop parsing and will report an error. The reader will use the function errorString() to get the error message that will be used for reporting the error.

See also
endDocument()

Implemented in LayoutParser, TagFileParser, QXmlDefaultHandler, BaseHandler< T >, BaseHandler< ProgramListingHandler >, BaseHandler< DocInternalHandler >, BaseHandler< ListItemHandler >, BaseHandler< TocListHandler >, BaseHandler< HighlightHandler >, BaseHandler< TocItemHandler >, BaseHandler< SectionHandler >, BaseHandler< LinkHandler >, BaseHandler< VerbatimHandler >, BaseHandler< GraphHandler >, BaseHandler< FormulaHandler >, BaseHandler< EMailHandler >, BaseHandler< ULinkHandler >, BaseHandler< VariableListEntryHandler >, BaseHandler< NodeHandler >, BaseHandler< ParameterItemHandler >, BaseHandler< CompoundHandler >, BaseHandler< LinkedTextHandler >, BaseHandler< EntryHandler >, BaseHandler< ChildNodeHandler >, BaseHandler< TableHandler >, BaseHandler< ParamHandler >, BaseHandler< HRulerHandler >, BaseHandler< DocHandler >, BaseHandler< SimpleSectHandler >, BaseHandler< TemplateParamListHandler >, BaseHandler< ParagraphHandler >, BaseHandler< RowHandler >, BaseHandler< SymbolHandler >, BaseHandler< ListOfAllMembersHandler >, BaseHandler< TitleHandler >, BaseHandler< OrderedListHandler >, BaseHandler< IncludeHandler >, BaseHandler< IndexEntryHandler >, BaseHandler< MainHandler >, BaseHandler< VariableListHandler >, BaseHandler< ImageHandler >, BaseHandler< EdgeLabelHandler >, BaseHandler< CodeLineHandler >, BaseHandler< AnchorHandler >, BaseHandler< ParameterHandler >, BaseHandler< ItemizedListHandler >, BaseHandler< DocSectionHandler >, BaseHandler< ParameterListHandler >, BaseHandler< MemberHandler >, BaseHandler< RefHandler >, BaseHandler< CopyHandler >, BaseHandler< DotFileHandler >, and BaseHandler< LineBreakHandler >.

bool QXmlContentHandler::startElement ( const QString namespaceURI,
const QString localName,
const QString qName,
const QXmlAttributes atts 
)
pure virtual

The reader calls this function when he has parsed a start element tag.

There will be a corresponding endElement() call when the corresponding end element tag was read. The startElement() and endElement() calls are always nested correctly. Empty element tags (e.g. <a/>) are reported by startElement() directly followed by a call to endElement().

The attribute list provided will contain only attributes with explicit values. The attribute list will contain attributes used for namespace declaration (i.e. attributes starting with xmlns) only if the namespace-prefix property of the reader is TRUE.

The argument uri is the namespace URI, or the empty string if the element has no namespace URI or if namespace processing is not being performed, localName is the local name (without prefix), or the empty string if namespace processing is not being performed, qName is the qualified name (with prefix), or the empty string if qualified names are not available and atts are the attributes attached to the element. If there are no attributes, atts is an empty attributes object

If this function returns FALSE the reader will stop parsing and will report an error. The reader will use the function errorString() to get the error message that will be used for reporting the error.

See also the namespace description.

See also
endElement()

Implemented in LayoutParser, TagFileParser, QXmlDefaultHandler, XMLContentHandler, BaseHandler< T >, BaseHandler< ProgramListingHandler >, BaseHandler< DocInternalHandler >, BaseHandler< ListItemHandler >, BaseHandler< TocListHandler >, BaseHandler< HighlightHandler >, BaseHandler< TocItemHandler >, BaseHandler< SectionHandler >, BaseHandler< LinkHandler >, BaseHandler< VerbatimHandler >, BaseHandler< GraphHandler >, BaseHandler< FormulaHandler >, BaseHandler< EMailHandler >, BaseHandler< ULinkHandler >, BaseHandler< VariableListEntryHandler >, BaseHandler< NodeHandler >, BaseHandler< ParameterItemHandler >, BaseHandler< CompoundHandler >, BaseHandler< LinkedTextHandler >, BaseHandler< EntryHandler >, BaseHandler< ChildNodeHandler >, BaseHandler< TableHandler >, BaseHandler< ParamHandler >, BaseHandler< HRulerHandler >, BaseHandler< DocHandler >, BaseHandler< SimpleSectHandler >, BaseHandler< TemplateParamListHandler >, BaseHandler< ParagraphHandler >, BaseHandler< RowHandler >, BaseHandler< SymbolHandler >, BaseHandler< ListOfAllMembersHandler >, BaseHandler< TitleHandler >, BaseHandler< OrderedListHandler >, BaseHandler< IncludeHandler >, BaseHandler< IndexEntryHandler >, BaseHandler< MainHandler >, BaseHandler< VariableListHandler >, BaseHandler< ImageHandler >, BaseHandler< EdgeLabelHandler >, BaseHandler< CodeLineHandler >, BaseHandler< AnchorHandler >, BaseHandler< ParameterHandler >, BaseHandler< ItemizedListHandler >, BaseHandler< DocSectionHandler >, BaseHandler< ParameterListHandler >, BaseHandler< MemberHandler >, BaseHandler< RefHandler >, BaseHandler< CopyHandler >, BaseHandler< DotFileHandler >, and BaseHandler< LineBreakHandler >.

bool QXmlContentHandler::startPrefixMapping ( const QString prefix,
const QString uri 
)
pure virtual

The reader calls this function to signal the begin of a prefix-URI namespace mapping scope. This information is not necessary for normal namespace processing since the reader automatically replaces prefixes for element and attribute names.

Note that startPrefixMapping and endPrefixMapping calls are not guaranteed to be properly nested relative to each-other: all startPrefixMapping events will occur before the corresponding startElement event, and all endPrefixMapping events will occur after the corresponding endElement event, but their order is not otherwise guaranteed.

The argument prefix is the namespace prefix being declared and the argument uri is the namespace URI the prefix is mapped to.

If this function returns FALSE the reader will stop parsing and will report an error. The reader will use the function errorString() to get the error message that will be used for reporting the error.

See also the namespace description.

See also
endPrefixMapping()

Implemented in QXmlDefaultHandler.


The documentation for this class was generated from the following files: