(PowerBuilder) Decode HTML Entities found in XML
Demonstrates how to decode HTML entities found in XML.
integer li_rc
oleobject loo_Xml
integer li_Success
string ls_StrDecoded
// Load an XML file containing the following:
// <?xml version="1.0" encoding="UTF-8"?>
// <output>Französische</output>
loo_Xml = create oleobject
// Use "Chilkat_9_5_0.Xml" for versions of Chilkat < 10.0.0
li_rc = loo_Xml.ConnectToNewObject("Chilkat.Xml")
if li_rc < 0 then
destroy loo_Xml
MessageBox("Error","Connecting to COM object failed")
return
end if
li_Success = loo_Xml.LoadXmlFile("qa_data/xml/hasHtmlEntity.xml")
// Get non-decoded content, then get decoded content.
// Result is Französische
Write-Debug loo_Xml.Content
// Result is Französische
ls_StrDecoded = loo_Xml.DecodeEntities(loo_Xml.Content)
Write-Debug ls_StrDecoded
destroy loo_Xml
|