Chilkat2-Python
Chilkat2-Python
Decode HTML Entities found in XML
Demonstrates how to decode HTML entities found in XML.Chilkat Chilkat2-Python Downloads
import chilkat2
success = False
# Load an XML file containing the following:
# <?xml version="1.0" encoding="UTF-8"?>
# <output>Französische</output>
xml = chilkat2.Xml()
success = xml.LoadXmlFile("qa_data/xml/hasHtmlEntity.xml")
# Get non-decoded content, then get decoded content.
# Result is Französische
print(xml.Content)
# Result is Französische
strDecoded = xml.DecodeEntities(xml.Content)
print(strDecoded)