I have a string variable contents
with following value:
<ph type="0" x="1"></ph>
I try to write it to a XML element as follows:
elemen_ref.text = contents
After I write XML tree to a file and check it with Notepad++, I see following value written to the XML element:
<ph type="0" x="1"></ph>
How do I write unescaped string? Please note that this value is copied from another XML element which remains intact after writing tree to a file, so the issue is with assigning value to a text
attribute.
content
looked like a valid option, but it does not work with other strings of formatted text, for example:My test<pha type="0" />
and16<bpt i="1" type="25" />th<ept i="1" /> November 2018
– Hamlet