(DataFlex) Decode HTML Entities found in XML
Demonstrates how to decode HTML entities found in XML.
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoXml
Boolean iSuccess
String sStrDecoded
String sTemp1
// Load an XML file containing the following:
// <?xml version="1.0" encoding="UTF-8"?>
// <output>Franzö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ö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
|