Lua
Lua
Decode HTML Entities found in XML
Demonstrates how to decode HTML entities found in XML.Chilkat Lua Downloads
local chilkat = require("chilkat")
-- Load an XML file containing the following:
-- <?xml version="1.0" encoding="UTF-8"?>
-- <output>Französische</output>
local xml = chilkat.Xml.new()
local success = xml:load_xml_file("qa_data/xml/hasHtmlEntity.xml")
-- Get non-decoded content, then get decoded content.
-- Result is Französische
print(xml.content)
-- Result is Französische
local strDecoded = xml:decode_entities(xml.content)
print(strDecoded)