when using Python's stock XML tools such as xml.dom.minidom
for XML writing, a file would always start off like
<?xml version="1.0"?>
[...]
While this is perfectly legal XML code, and it's even recommended to use the header, I'd like to get rid of it as one of the programs I'm working with has problems here.
I can't seem to find the appropriate option in xml.dom.minidom
, so I wondered if there are other packages which do allow to neglect the header.
Cheers,
Nico
You might be able to use a custom file-like object which removes the first tag, e.g:
or something similar. This has the advantage the file doesn't have to be totally rewritten if the XML files are fairly large.