Tcl
Tcl
Decode HTML Entities found in XML
Demonstrates how to decode HTML entities found in XML.Chilkat Tcl Downloads
load ./chilkat.dll
set success 0
# Load an XML file containing the following:
# <?xml version="1.0" encoding="UTF-8"?>
# <output>Französische</output>
set xml [new_CkXml]
set success [CkXml_LoadXmlFile $xml "qa_data/xml/hasHtmlEntity.xml"]
# Get non-decoded content, then get decoded content.
# Result is Französische
puts [CkXml_content $xml]
# Result is Französische
set strDecoded [CkXml_decodeEntities $xml [CkXml_content $xml]]
puts "$strDecoded"
delete_CkXml $xml