C
C
Decode HTML Entities found in XML
Demonstrates how to decode HTML entities found in XML.Chilkat C Downloads
#include <C_CkXml.h>
void ChilkatSample(void)
{
BOOL success;
HCkXml xml;
const char *strDecoded;
success = FALSE;
// Load an XML file containing the following:
// <?xml version="1.0" encoding="UTF-8"?>
// <output>Französische</output>
xml = CkXml_Create();
success = CkXml_LoadXmlFile(xml,"qa_data/xml/hasHtmlEntity.xml");
// Get non-decoded content, then get decoded content.
// Result is Französische
printf("%s\n",CkXml_content(xml));
// Result is Französische
strDecoded = CkXml_decodeEntities(xml,CkXml_content(xml));
printf("%s\n",strDecoded);
CkXml_Dispose(xml);
}