Handling CDATA with lxml involves making parser with suitable declaration, but how about XSLT? For example:
from lxml import etree
parser = etree.XMLParser(strip_cdata=False)
tree = etree.parse('sample_with_cdata.xml', parser)
transform = etree.XSLT(etree.parse('dupe.xsl'))
xml_out = transform(tree)
xml_out.write('processed.xml')
If I process xml file with CDATA through lxml XSLT processor, all CDATA is stripped. How can I tell XSLT processor to leave CDATA as is?
PS. FYI, adding same parser to etree.XSLT doesn't change outcome