Node.js
Node.js
Decode HTML Entities found in XML
Demonstrates how to decode HTML entities found in XML.Chilkat Node.js Downloads
NODEJS_PRELUDE
function chilkatExample() {
var success = false;
// Load an XML file containing the following:
// <?xml version="1.0" encoding="UTF-8"?>
// <output>Französische</output>
var xml = new chilkat.Xml();
success = xml.LoadXmlFile("qa_data/xml/hasHtmlEntity.xml");
// Get non-decoded content, then get decoded content.
// Result is Französische
console.log(xml.Content);
// Result is Französische
var strDecoded = xml.DecodeEntities(xml.Content);
console.log(strDecoded);
}
chilkatExample();