I have a python script which takes a json and generates an xml with the values that I need. Unfortunately one of the values has CDATA tag which is escaped somehow by lxml.etree. How do I disable it?
import lxml.etree as ET
print ("Desired:")
print (ET.tostring(string_res, encoding='utf-8', method='xml'))
string_res.text = ''
string_res.text = value['Value']
print ("Desired:")
print string_res.text
print ("Not desired:")
print (ET.tostring(string_res, encoding='utf-8', method='xml'))
result is
Desired:
<![CDATA[<b>hello</b>]]>
Desired:
<![CDATA[<b>hello</b>]]>
Not desired:
<![CDATA[<b>hello</b>]]>