Sample code for 30+ languages & platforms
Go

Decode HTML Entities found in XML

Demonstrates how to decode HTML entities found in XML.

Chilkat Go Downloads

Go
    success := false

    // Load an XML file containing the following:

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

    xml := chilkat.NewXml()
    success = xml.LoadXmlFile("qa_data/xml/hasHtmlEntity.xml")

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

    // Result is Franz&#xf6;sische
    fmt.Println(xml.Content())

    // Result is Französische
    strDecoded := xml.DecodeEntities(xml.Content())
    fmt.Println(*strDecoded)

    xml.DisposeXml()