Sample code for 30+ languages & platforms
JavaScript

Decode HTML Entities found in XML

Demonstrates how to decode HTML entities found in XML.
Note
This example is intended for running within a Chilkat.Js embedded JavaScript engine. All Chilkat JavaScript examples require Chilkat v11.4.0 or greater.
JavaScript
var success = false;

// Load an XML file containing the following:

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

var xml = new CkXml();
success = xml.LoadXmlFile("qa_data/xml/hasHtmlEntity.xml");

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

// Result is Franz&#xf6;sische
console.log(xml.Content);

// Result is Französische
var strDecoded = xml.DecodeEntities(xml.Content);
console.log(strDecoded);