I have an XML document for which I need to add a couple of things to the XML declaration using minidom. The declaration looks like this:
<?xml version="1.0"?>
And I need it to look like this:
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
I know how to change or add attributes using minidom, which will not work here.
What is the easiest way of doing this? For reference, I am running python 3.3.3.
I'm not sure if this can be done with minidom. But you could try
lxml
.More or less taken from here.