Qt 4.8
Public Functions | List of all members
QXmlLexicalHandler Class Referenceabstract

The QXmlLexicalHandler class provides an interface to report the lexical content of XML data. More...

#include <qxml.h>

Inheritance diagram for QXmlLexicalHandler:
QXmlDefaultHandler QDomHandler

Public Functions

virtual bool comment (const QString &ch)=0
 The reader calls this function to report an XML comment anywhere in the document. More...
 
virtual bool endCDATA ()=0
 The reader calls this function to report the end of a CDATA section. More...
 
virtual bool endDTD ()=0
 The reader calls this function to report the end of a DTD declaration, if any. More...
 
virtual bool endEntity (const QString &name)=0
 The reader calls this function to report the end of an entity called name. More...
 
virtual QString errorString () const =0
 The reader calls this function to get an error string if any of the handler functions returns false. More...
 
virtual bool startCDATA ()=0
 The reader calls this function to report the start of a CDATA section. More...
 
virtual bool startDTD (const QString &name, const QString &publicId, const QString &systemId)=0
 The reader calls this function to report the start of a DTD declaration, if any. More...
 
virtual bool startEntity (const QString &name)=0
 The reader calls this function to report the start of an entity called name. More...
 
virtual ~QXmlLexicalHandler ()
 Destroys the lexical handler. More...
 

Detailed Description

The QXmlLexicalHandler class provides an interface to report the lexical content of XML data.

Note
This class or function is reentrant.
Attention
Module: QtXml

The events in the lexical handler apply to the entire document, not just to the document element, and all lexical handler events appear between the content handler's startDocument and endDocument events.

You can set the lexical handler with QXmlReader::setLexicalHandler().

This interface's design is based on the SAX2 extension LexicalHandler.

The interface provides the startDTD(), endDTD(), startEntity(), endEntity(), startCDATA(), endCDATA() and comment() functions.

See also
QXmlDTDHandler, QXmlDeclHandler, QXmlContentHandler, QXmlEntityResolver, QXmlErrorHandler, {Introduction to SAX2}

Definition at line 346 of file qxml.h.

Constructors and Destructors

◆ ~QXmlLexicalHandler()

QXmlLexicalHandler::~QXmlLexicalHandler ( )
inlinevirtual

Destroys the lexical handler.

Definition at line 349 of file qxml.h.

349 {}

Functions

◆ comment()

bool QXmlLexicalHandler::comment ( const QString ch)
pure virtual

The reader calls this function to report an XML comment anywhere in the document.

It reports the text of the comment in ch.

If this function returns false the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Implemented in QDomHandler, and QXmlDefaultHandler.

Referenced by QXmlSimpleReaderPrivate::parseContent(), QXmlSimpleReaderPrivate::parseMarkupdecl(), QXmlSimpleReaderPrivate::parseMisc(), and QXmlSimpleReaderPrivate::parseProlog().

◆ endCDATA()

bool QXmlLexicalHandler::endCDATA ( )
pure virtual

The reader calls this function to report the end of a CDATA section.

If this function returns false the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

See also
startCDATA(), QXmlContentHandler::characters()

Implemented in QDomHandler, and QXmlDefaultHandler.

Referenced by QXmlSimpleReaderPrivate::parseContent().

◆ endDTD()

bool QXmlLexicalHandler::endDTD ( )
pure virtual

The reader calls this function to report the end of a DTD declaration, if any.

If this function returns false the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

See also
startDTD()

Implemented in QXmlDefaultHandler.

Referenced by QXmlSimpleReaderPrivate::parseDoctype().

◆ endEntity()

bool QXmlLexicalHandler::endEntity ( const QString name)
pure virtual

The reader calls this function to report the end of an entity called name.

For every startEntity() call, there is a corresponding endEntity() call. The calls to startEntity() and endEntity() are properly nested.

If this function returns false the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

See also
startEntity(), QXmlContentHandler::skippedEntity(), QXmlSimpleReader::setFeature()

Implemented in QDomHandler, and QXmlDefaultHandler.

Referenced by QXmlSimpleReaderPrivate::reportEndEntities().

◆ errorString()

QString QXmlLexicalHandler::errorString ( ) const
pure virtual

◆ startCDATA()

bool QXmlLexicalHandler::startCDATA ( )
pure virtual

The reader calls this function to report the start of a CDATA section.

The content of the CDATA section is reported through the QXmlContentHandler::characters() function. This function is intended only to report the boundary.

If this function returns false the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

See also
endCDATA()

Implemented in QDomHandler, and QXmlDefaultHandler.

Referenced by QXmlSimpleReaderPrivate::parseContent().

◆ startDTD()

bool QXmlLexicalHandler::startDTD ( const QString name,
const QString publicId,
const QString systemId 
)
pure virtual

The reader calls this function to report the start of a DTD declaration, if any.

It reports the name of the document type in name, the public identifier in publicId and the system identifier in systemId.

If the public identifier is missing, publicId is set to an empty string. If the system identifier is missing, systemId is set to an empty string. Note that it is not valid XML to have a public identifier but no system identifier; in such cases a parse error will occur.

All declarations reported through QXmlDTDHandler or QXmlDeclHandler appear between the startDTD() and endDTD() calls.

If this function returns false the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

See also
endDTD()

Implemented in QDomHandler, and QXmlDefaultHandler.

Referenced by QXmlSimpleReaderPrivate::parseDoctype().

◆ startEntity()

bool QXmlLexicalHandler::startEntity ( const QString name)
pure virtual

The reader calls this function to report the start of an entity called name.

Note that if the entity is unknown, the reader reports it through QXmlContentHandler::skippedEntity() and not through this function.

If this function returns false the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

See also
endEntity(), QXmlSimpleReader::setFeature()

Implemented in QDomHandler, and QXmlDefaultHandler.

Referenced by QXmlSimpleReaderPrivate::insertXmlRef().


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