QXmlParseException¶

PyQt5.QtXml.QXmlParseException

Description¶

The QXmlParseException class is used to report errors with the QXmlErrorHandler interface.

The XML subsystem constructs an instance of this class when it detects an error. You can retrieve the place where the error occurred using systemId(), publicId(), lineNumber() and columnNumber(), along with the error message(). The possible error messages are:

  • “no error occurredâ€�

  • “error triggered by consumerâ€�

  • “unexpected end of fileâ€�

  • “more than one document type definitionâ€�

  • “error occurred while parsing elementâ€�

  • “tag mismatchâ€�

  • “error occurred while parsing contentâ€�

  • “unexpected characterâ€�

  • “invalid name for processing instructionâ€�

  • “version expected while reading the XML declarationâ€�

  • “wrong value for standalone declarationâ€�

  • “encoding declaration or standalone declaration expected while reading the XML declarationâ€�

  • “standalone declaration expected while reading the XML declarationâ€�

  • “error occurred while parsing document type definitionâ€�

  • “letter is expectedâ€�

  • “error occurred while parsing commentâ€�

  • “error occurred while parsing referenceâ€�

  • “internal general entity reference not allowed in DTDâ€�

  • “external parsed general entity reference not allowed in attribute valueâ€�

  • “external parsed general entity reference not allowed in DTDâ€�

  • “unparsed entity reference n wrong contextâ€�

  • “recursive entitiesâ€�

  • “error in the text declaration of an external entityâ€�

Note that, if you want to display these error messages to your application’s users, they will be displayed in English unless they are explicitly translated.

Methods¶

__init__(QXmlParseException)

Creates a copy of other.


__init__(name: str = '', column: int = -1, line: int = -1, publicId: str = '', systemId: str = '')

Constructs a parse exception with the error string name for column c and line l for the public identifier p and the system identifier s.


columnNumber() → int

Returns the column number where the error occurred.


lineNumber() → int

Returns the line number where the error occurred.


message() → str

Returns the error message.


publicId() → str

Returns the public identifier where the error occurred.


systemId() → str

Returns the system identifier where the error occurred.