<?xml version=“1.0” encoding=“UTF-8”?> not <?xml version='1.0' encoding='UTF-8'?>
- by user2446702
I am using lxml with
tree.write(xmlFileOut, pretty_print = True, xml_declaration = True, encoding='UTF-8'
to write out my opened and edited xml file, but I absolutely need to have the xml declaration as
<?xml version=“1.0” encoding=“UTF-8”?>
and NOT
<?xml version='1.0' encoding='UTF-8'?>
Now I know they are exactly the same when it comes to xml, but I am dealing with a very tricky customer who absolutely has to have " in the declaration and not '. I have searched everywhere but can't find the answer.
Could I create it and add it in myself to the head of the xml somehow?
Could I tell lxml that this is what I need as an xml declaration?