I've been using the minidom to produce little properly-formatted XML documents, by building a DOM tree, then calling "toxml" to generate the actual XML. But I tripped over the optional "encoding" argument to that function.
I figured that the only point of having an encoding argument would be to allow the user to control the output character set encoding, but it turns out that specifying an encoding of, say, "ASCII", doesn't do that. It just raises encoding exceptions when you attempt to encode a non-ASCII character. What's the point of having an encoding argument when it always has to be "UTF-8"? Especially since it seems that this could be made useful by changing one line of code. In xml/dom/minidom.py, in the class Node, in the method "toprettyxml", change the line writer = codecs.lookup(encoding)[3](writer) to writer = codecs.lookup(encoding)[3](writer, "xmlcharrefreplace") What am I missing here? Bill _______________________________________________ XML-SIG maillist - XML-SIG@python.org http://mail.python.org/mailman/listinfo/xml-sig