Sample code for 30+ languages & platforms
Unicode C

Convert HTML File to XML File

See more HTML-to-XML/Text Examples

Convert HTML file to XML file.

Chilkat Unicode C Downloads

Unicode C
#include <C_CkHtmlToXmlW.h>

void ChilkatSample(void)
    {
    BOOL success;
    HCkHtmlToXmlW htmlToXml;

    success = FALSE;

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    htmlToXml = CkHtmlToXmlW_Create();

    // Indicate the charset of the output XML we'll want.
    CkHtmlToXmlW_putXmlCharset(htmlToXml,L"utf-8");

    success = CkHtmlToXmlW_ConvertFile(htmlToXml,L"test.html",L"out.xml");
    if (success != TRUE) {
        wprintf(L"%s\n",CkHtmlToXmlW_lastErrorText(htmlToXml));
    }
    else {
        wprintf(L"Success\n");
    }



    CkHtmlToXmlW_Dispose(htmlToXml);

    }