0

I would like to put <> characters in element content but after write I getting &lt ; and &gt ;

ET.SubElement(ShipTo, "CompanyOrName").text = '<![CDATA[{}]]>'.format(address['company'])

effect:

<CompanyOrName>&lt;![CDATA[Company]]&gt;</CompanyOrName>
user3041764
  • 817
  • 10
  • 35
  • however I took the lxml, it allows you to insert CDATA – user3041764 Jul 07 '15 at 17:35
  • possible duplicate of [How to output CDATA using ElementTree](http://stackoverflow.com/questions/174890/how-to-output-cdata-using-elementtree) – mzjn Jul 07 '15 at 17:50

0 Answers0