xml.sax.XMLReader and document encodings

Martin v. Löwis martin at v.loewis.de
Tue Mar 4 02:54:09 EST 2003


Jp Calderone <exarkun at intarweb.us> writes:

>   I am interested in the encoding of the document, though.  I can't seem to
> find the API which provides this functionality.  Does anyone know?

With SAX being a "simple api for XML", this is not possible. Java SAX
defines the Locator2 interface (as an extension, indicated by the
http://xml.org/sax/features/use-locator2 feature), which exposes the
encoding, but this is unimplemented in Python SAX.

Regards,
Martin




More information about the Python-list mailing list