Sample code for 30+ languages & platforms
DataFlex

Decode HTML Entities found in XML

Demonstrates how to decode HTML entities found in XML.

Chilkat DataFlex Downloads

DataFlex
Use ChilkatAx-win32.pkg

Procedure Test
    Boolean iSuccess
    Handle hoXml
    String sStrDecoded
    String sTemp1

    Move False To iSuccess

    // Load an XML file containing the following:

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

    Get Create (RefClass(cComChilkatXml)) To hoXml
    If (Not(IsComObjectCreated(hoXml))) Begin
        Send CreateComObject of hoXml
    End
    Get ComLoadXmlFile Of hoXml "qa_data/xml/hasHtmlEntity.xml" To iSuccess

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

    // Result is Franz&#xf6;sische
    Get ComContent Of hoXml To sTemp1
    Showln sTemp1

    // Result is Französische
    Get ComContent Of hoXml To sTemp1
    Get ComDecodeEntities Of hoXml sTemp1 To sStrDecoded
    Showln sStrDecoded


End_Procedure