Sample code for 30+ languages & platforms
Zig

Load XML from Local FilePath

Demonstrates how to load XML from a local XML file.

Chilkat Zig Downloads

Zig
const std = @import("std");
const chilkat = @import("chilkat");

pub fn main(init: std.process.Init) !void {
    const alloc = init.arena.allocator();

    const xml = try chilkat.Xml.init();
    defer xml.deinit();

    // Pass either an absolute file path, or a file path relative from the current working directory of the caller.
    xml.loadXmlFile("qa_data/hamlet.xml") catch {
        std.debug.print("{s}\n", .{try xml.getLastErrorText(alloc)});
        return;
    };

    std.debug.print("Success.\n", .{});
}