Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QXmlLexicalHandler Class

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

Header:#include <QXmlLexicalHandler>
Inherited By:

QXmlDefaultHandler

Note: All functions in this class arereentrant.

Public Functions

virtual~QXmlLexicalHandler()
virtual boolcomment(const QString & ch) = 0
virtual boolendCDATA() = 0
virtual boolendDTD() = 0
virtual boolendEntity(const QString & name) = 0
virtual QStringerrorString() const = 0
virtual boolstartCDATA() = 0
virtual boolstartDTD(const QString & name, const QString & publicId, const QString & systemId) = 0
virtual boolstartEntity(const QString & name) = 0

Detailed Description

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

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 withQXmlReader::setLexicalHandler().

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

The interface provides thestartDTD(),endDTD(),startEntity(),endEntity(),startCDATA(),endCDATA() andcomment() functions.

See alsoQXmlDTDHandler,QXmlDeclHandler,QXmlContentHandler,QXmlEntityResolver,QXmlErrorHandler, andIntroduction to SAX2.

Member Function Documentation

[virtual]QXmlLexicalHandler::~QXmlLexicalHandler()

Destroys the lexical handler.

[pure virtual]bool QXmlLexicalHandler::comment(constQString & ch)

The reader calls this function to report an XML comment anywhere in the document. It reports the text of the comment inch.

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

[pure virtual]bool QXmlLexicalHandler::endCDATA()

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 functionerrorString() to get the error message.

See alsostartCDATA() andQXmlContentHandler::characters().

[pure virtual]bool QXmlLexicalHandler::endDTD()

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 functionerrorString() to get the error message.

See alsostartDTD().

[pure virtual]bool QXmlLexicalHandler::endEntity(constQString & name)

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

For everystartEntity() call, there is a corresponding endEntity() call. The calls tostartEntity() and endEntity() are properly nested.

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

See alsostartEntity(),QXmlContentHandler::skippedEntity(), andQXmlSimpleReader::setFeature().

[pure virtual]QString QXmlLexicalHandler::errorString() const

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

[pure virtual]bool QXmlLexicalHandler::startCDATA()

The reader calls this function to report the start of a CDATA section. The content of the CDATA section is reported through theQXmlContentHandler::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 functionerrorString() to get the error message.

See alsoendCDATA().

[pure virtual]bool QXmlLexicalHandler::startDTD(constQString & name, constQString & publicId, constQString & systemId)

The reader calls this function to report the start of a DTD declaration, if any. It reports the name of the document type inname, the public identifier inpublicId and the system identifier insystemId.

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 throughQXmlDTDHandler orQXmlDeclHandler appear between the startDTD() andendDTD() calls.

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

See alsoendDTD().

[pure virtual]bool QXmlLexicalHandler::startEntity(constQString & name)

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

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

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

See alsoendEntity() andQXmlSimpleReader::setFeature().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp