Sample code for 30+ languages & platforms
PureBasic

Convert HTML File to XML File

See more HTML-to-XML/Text Examples

Convert HTML file to XML file.

Chilkat PureBasic Downloads

PureBasic
IncludeFile "CkHtmlToXml.pb"

Procedure ChilkatExample()

    success.i = 0

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

    htmlToXml.i = CkHtmlToXml::ckCreate()
    If htmlToXml.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    ; Indicate the charset of the output XML we'll want.
    CkHtmlToXml::setCkXmlCharset(htmlToXml, "utf-8")

    success = CkHtmlToXml::ckConvertFile(htmlToXml,"test.html","out.xml")
    If success <> 1
        Debug CkHtmlToXml::ckLastErrorText(htmlToXml)
    Else
        Debug "Success"
    EndIf



    CkHtmlToXml::ckDispose(htmlToXml)


    ProcedureReturn
EndProcedure