xml.parsers.expat.xmlparser.CharacterDataHandler()

xmlparser.CharacterDataHandler(data) Called for character data. This will be called for normal character data, CDATA marked content, and ignorable whitespace. Applications which must distinguish these cases can use the StartCdataSectionHandler, EndCdataSectionHandler, and ElementDeclHandler callbacks to collect the required information.

xml.parsers.expat.xmlparser.CurrentLineNumber

xmlparser.CurrentLineNumber Current line number in the parser input.

xml.parsers.expat.xmlparser.CurrentByteIndex

xmlparser.CurrentByteIndex Current byte index in the parser input.

xml.parsers.expat.xmlparser.CurrentColumnNumber

xmlparser.CurrentColumnNumber Current column number in the parser input.

xml.parsers.expat.xmlparser.buffer_text

xmlparser.buffer_text Setting this to true causes the xmlparser object to buffer textual content returned by Expat to avoid multiple calls to the CharacterDataHandler() callback whenever possible. This can improve performance substantially since Expat normally breaks character data into chunks at every line ending. This attribute is false by default, and may be changed at any time.

xml.parsers.expat.xmlparser.buffer_size

xmlparser.buffer_size The size of the buffer used when buffer_text is true. A new buffer size can be set by assigning a new integer value to this attribute. When the size is changed, the buffer will be flushed.

xml.parsers.expat.xmlparser.AttlistDeclHandler()

xmlparser.AttlistDeclHandler(elname, attname, type, default, required) Called for each declared attribute for an element type. If an attribute list declaration declares three attributes, this handler is called three times, once for each attribute. elname is the name of the element to which the declaration applies and attname is the name of the attribute declared. The attribute type is a string passed as type; the possible values are 'CDATA', 'ID', 'IDREF', ... default gives the default value

xml.parsers.expat.xmlparser.buffer_used

xmlparser.buffer_used If buffer_text is enabled, the number of bytes stored in the buffer. These bytes represent UTF-8 encoded text. This attribute has no meaningful interpretation when buffer_text is false.

xml.parsers.expat.ParserCreate()

xml.parsers.expat.ParserCreate(encoding=None, namespace_separator=None) Creates and returns a new xmlparser object. encoding, if specified, must be a string naming the encoding used by the XML data. Expat doesn’t support as many encodings as Python does, and its repertoire of encodings can’t be extended; it supports UTF-8, UTF-16, ISO-8859-1 (Latin1), and ASCII. If encoding [1] is given it will override the implicit or explicit encoding of the document. Expat can optionally do XML namespace

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.