Sample code for 30+ languages & platforms
VBScript

Decode HTML Entities found in XML

Demonstrates how to decode HTML entities found in XML.

Chilkat VBScript Downloads

VBScript
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)

success = 0

' Load an XML file containing the following:

' <?xml version="1.0" encoding="UTF-8"?>
' <output>Franz&#xf6;sische</output> 

set xml = CreateObject("Chilkat.Xml")
success = xml.LoadXmlFile("qa_data/xml/hasHtmlEntity.xml")

' Get non-decoded content, then get decoded content.

' Result is Franz&#xf6;sische
outFile.WriteLine(xml.Content)

' Result is Französische
strDecoded = xml.DecodeEntities(xml.Content)
outFile.WriteLine(strDecoded)

outFile.Close