Sample code for 30+ languages & platforms
PureBasic

Load XML from Local FilePath

Demonstrates how to load XML from a local XML file.

Chilkat PureBasic Downloads

PureBasic
IncludeFile "CkXml.pb"

Procedure ChilkatExample()

    success.i = 0

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

    ; Pass either an absolute file path, or a file path relative from the current working directory of the caller.
    success = CkXml::ckLoadXmlFile(xml,"qa_data/hamlet.xml")
    If success = 0
        Debug CkXml::ckLastErrorText(xml)
        CkXml::ckDispose(xml)
        ProcedureReturn
    EndIf

    Debug "Success."


    CkXml::ckDispose(xml)


    ProcedureReturn
EndProcedure