xml.parsers.expat.ExpatError.code

ExpatError.code Expat’s internal error number for the specific error. The errors.messages dictionary maps these error numbers to Expat’s error messages. For example: from xml.parsers.expat import ParserCreate, ExpatError, errors p = ParserCreate() try: p.Parse(some_xml_document) except ExpatError as err: print("Error:", errors.messages[err.code]) The errors module also provides error message constants and a dictionary codes mapping these messages back to the error codes, see below.

xml.parsers.expat.ErrorString()

xml.parsers.expat.ErrorString(errno) Returns an explanatory string for a given error number errno.

xml.parsers.expat.ExpatError.offset

ExpatError.offset Character offset into the line where the error occurred. The first column is numbered 0.

xml.parsers.expat.ExpatError

exception xml.parsers.expat.ExpatError The exception raised when Expat reports an error. See section ExpatError Exceptions for more information on interpreting Expat errors.

xml.parsers.expat.ExpatError.lineno

ExpatError.lineno Line number on which the error was detected. The first line is numbered 1.

xml.parsers.expat.errors.messages

xml.parsers.expat.errors.messages A dictionary mapping string descriptions to their error codes. New in version 3.2.

xml.etree.ElementTree.XMLPullParser

class xml.etree.ElementTree.XMLPullParser(events=None) A pull parser suitable for non-blocking applications. Its input-side API is similar to that of XMLParser, but instead of pushing calls to a callback target, XMLPullParser collects an internal list of parsing events and lets the user read from it. events is a sequence of events to report back. The supported events are the strings "start", "end", "start-ns" and "end-ns" (the “ns” events are used to get detailed namespace information). If e

xml.etree.ElementTree.XMLParser.feed()

feed(data) Feeds data to the parser. data is encoded data.

xml.etree.ElementTree.XMLPullParser.feed()

feed(data) Feed the given bytes data to the parser.

xml.parsers.expat.error

exception xml.parsers.expat.error Alias for ExpatError.