xml.dom.minidom losing the XML document type attribute

Johannes Bauer dfnsonfsduifb at gmx.de
Thu Jun 11 09:20:54 EDT 2009

Stefan Behnel schrieb:

>> Can I somehow force Python to generate it anyways?
> Did you try passing encoding='UTF-8' on serialisation?

Uhm... nope - how can I do that?

>> I have software which
>> complains if an explicit encoding is missing...
> Well, to parse XML, it's best to use an XML parser. ;)

Well, I'm not speaking about my software :-) Actually it's Gnucash which
complains if the tag is not explicitly set. This is because they
appearently had a ancient version which did not specify the charset, but
used a different one than UTF-8. Kind of annoying, but fixing my XML
output seems to be easier than convincing the Gnucash people to change
their software :-)

Kind regards,

"Meine Gegenklage gegen dich lautet dann auf bewusste Verlogenheit,
verlästerung von Gott, Bibel und mir und bewusster Blasphemie."
         -- Prophet und Visionär Hans Joss aka HJP in de.sci.physik
                         <48d8bf1d$0$7510$5402220f at news.sunrise.ch>

More information about the Python-list mailing list