September 28th, 2004, 09:13 AM
How not to generate <?xml version="1.0" ?> in python
I building an xml using minidom. Is there a way not generate
<?xml version="1.0" ?> at the top of my xml-file using python. I save my output to a file and can manually get rid of this line but I wantt python not generate this line, any function I can use for not generate this line. Any help is appreciated.
September 28th, 2004, 04:49 PM
You can get the first element of the dom and call writexml, toxml or toprettyxml on that. This should do what you want.
Dave - the Developers' Coach
dom = xml.dom.minidom.parseString(document)