[XML-SIG] Q: minidom and iso-8859-1

Paul Prescod paul@prescod.net
Wed, 13 Sep 2000 23:23:07 -0700

"Martin v. Loewis" wrote:
> It appears that the DOM itself does not provide any mechanism for
> that. It may be that the reader passes this information to the DOM
> builder, so you may need to hook into the parser. However, it also
> appears that SAX does not generate an event for the <?xml header, so
> you could only use a specific parser with some extended interface.
> I know xmllib invokes handle_xml for that; I don't know whether expat
> gives access to that information, it appears as if the default handler
> would be invoked when <?xml is seen, with the encoding as a parameter.

That's true. I'm not going to go out and implement a feature to sniff
the original encoding declaration but if someone wants to add it to
pyexpat and pysax they are welcome to. The DOM still doesn't provide a
standard way of reporting it and I would be reluctant to add a
non-standard way to minidom.

Anyhow, am I right that this perceived bug turned out not to be one?

 Paul Prescod - Not encumbered by corporate consensus
Simplicity does not precede complexity, but follows it. 
	- http://www.cs.yale.edu/homes/perlis-alan/quotes.html