问题
In my code, I am changing an existed formatted string in XML with predefined format with ElementTree in Python.
<Value xsi:type='xs:string'>{"name":"Test123","type":"}</Value>
New text adding by: ValueNode.text = '{"name":"NewTextdemo"}'
and to save the file I am using doc.write(path_to_XML_file)
The problem is, that the doc.write(path_to_XML_file)
is changing the "
to &quot;
further entity name - and so the result XML is invalid.
Does anybody know how to avoid it? How to set write function to omits conding these special characters?
Thank you
来源:https://stackoverflow.com/questions/61019991/elementtrees-write-changes-strings-with-quot-to-ampquot