返回介绍

QXmlErrorHandler Class

发布于 2019-10-04 15:04:17 字数 2853 浏览 1153 评论 0 收藏 0

The QXmlErrorHandler class provides an interface to report errors in XML data. More...

#include <qxml.h>

Inherited by QXmlDefaultHandler.

List of all member functions.

Public Members

  • virtual bool warning ( constQXmlParseException&exception ) = 0
  • virtual bool error ( constQXmlParseException&exception ) = 0
  • virtual bool fatalError ( constQXmlParseException&exception ) = 0
  • virtual QString errorString () = 0

Detailed Description

The QXmlErrorHandler class provides an interface to report errors in XML data.

If the application is interested in reporting errors to the user or any other customized error handling, you should subclass this class.

You can set the error handler with QXmlReader::setErrorHandler().

Errors can be reported using warning(), error() and fataError(), with the error text being reported with errorString().

See also the Introduction to SAX2.

See also QXmlDTDHandler, QXmlDeclHandler, QXmlContentHandler, QXmlEntityResolver, QXmlLexicalHandler and XML.


Member Function Documentation

bool QXmlErrorHandler::error ( constQXmlParseException&exception ) [pure virtual]

A reader might use this function to report a recoverable error. A recoverable error corresponds to the definiton of "error" in section 1.2 of the XML 1.0 specification. Details of the error are stored in exception.

The reader must continue to provide normal parsing events after invoking 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.

QString QXmlErrorHandler::errorString () [pure virtual]

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

bool QXmlErrorHandler::fatalError ( constQXmlParseException&exception ) [pure virtual]

A reader must use this function to report a non-recoverable error. Details of the error are stored in exception.

If this function returns TRUE the reader might try to go on parsing and reporting further errors; but no regular parsing events are reported.

bool QXmlErrorHandler::warning ( constQXmlParseException&exception ) [pure virtual]

A reader might use this function to report a warning. Warnings are conditions that are not errors or fatal errors as defined by the XML 1.0 specification. Details of the warning are stored in exception.

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文