xml.parsers.expat.ExpatError.lineno

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

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.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.ErrorString()

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

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.parsers.expat.errors.codes

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

xml.parsers.expat.error

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

xml.etree.ElementTree.XMLPullParser.read_events()

read_events() Return an iterator over the events which have been encountered in the data fed to the parser. The iterator yields (event, elem) pairs, where event is a string representing the type of event (e.g. "end") and elem is the encountered Element object. Events provided in a previous call to read_events() will not be yielded again. Events are consumed from the internal queue only when they are retrieved from the iterator, so multiple readers iterating in parallel over iterators obtaine

xml.etree.ElementTree.XMLPullParser.feed()

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

xml.etree.ElementTree.XMLPullParser.close()

close() Signal the parser that the data stream is terminated. Unlike XMLParser.close(), this method always returns None. Any events not yet retrieved when the parser is closed can still be read with read_events().