Sample code for 30+ languages & platforms
PowerBuilder

Decode HTML Entities found in XML

Demonstrates how to decode HTML entities found in XML.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
integer li_Success
oleobject loo_Xml
string ls_StrDecoded

li_Success = 0

// Load an XML file containing the following:

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

loo_Xml = create oleobject
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&#xf6;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