Sample code for 30+ languages & platforms
Swift

Load XML from Local FilePath

Demonstrates how to load XML from a local XML file.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    let xml = CkoXml()!

    // Pass either an absolute file path, or a file path relative from the current working directory of the caller.
    success = xml.loadFile(path: "qa_data/hamlet.xml")
    if success == false {
        print("\(xml.lastErrorText!)")
        return
    }

    print("Success.")

}