Sample code for 30+ languages & platforms
Chilkat2-Python

Load XML from Local FilePath

Demonstrates how to load XML from a local XML file.

Chilkat Chilkat2-Python Downloads

Chilkat2-Python
import sys
import chilkat2

success = False

xml = chilkat2.Xml()

# Pass either an absolute file path, or a file path relative from the current working directory of the caller.
success = xml.LoadXmlFile("qa_data/hamlet.xml")
if (success == False):
    print(xml.LastErrorText)
    sys.exit()

print("Success.")