I am using python to do some conditional changes to an XML document. The incoming document has <?xml version="1.0" ?>
at the top.
I'm using xml.etree.ElementTree
.
How I'm parsing the changed XMl:
filter_update_body = ET.tostring(root, encoding="utf8", method="xml")
The output has this at the top:
<?xml version='1.0' encoding='utf8'?>
The client wants the "encoding" tag removed but if I remove it then it either doesn't include the line at all or it puts in encoding= 'us-ascii'
Can this be done so the output matches: <?xml version="1.0" ?>
?
(I don't know why it matters honestly but that's what I was told needed to happen)