Sample code for 30+ languages & platforms
Tcl

Decode HTML Entities found in XML

Demonstrates how to decode HTML entities found in XML.

Chilkat Tcl Downloads

Tcl

load ./chilkat.dll

set success 0

# Load an XML file containing the following:

# <?xml version="1.0" encoding="UTF-8"?>
# <output>Franz&#xf6;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&#xf6;sische
puts [CkXml_content $xml]

# Result is Französische
set strDecoded [CkXml_decodeEntities $xml [CkXml_content $xml]]
puts "$strDecoded"

delete_CkXml $xml