No description
Find a file
stacksmash 540c375fed Zig 0.17 compat patches for zmage
Forked from ianprime0509/zig-xml ~v0.2.0.

Two patches:
- src/Reader.zig: array/string repetition operator (**) removed in Zig 0.17;
  use @splat for the long-element-name test.
- src/Reader.zig: ArrayList.getLast() now returns ?T; unwrap with .?.
2026-05-23 14:19:27 -04:00
.github/workflows Zig 0.17 compat patches for zmage 2026-05-23 14:19:27 -04:00
bench Zig 0.17 compat patches for zmage 2026-05-23 14:19:27 -04:00
examples Zig 0.17 compat patches for zmage 2026-05-23 14:19:27 -04:00
fuzz Zig 0.17 compat patches for zmage 2026-05-23 14:19:27 -04:00
src Zig 0.17 compat patches for zmage 2026-05-23 14:19:27 -04:00
xmlconf Zig 0.17 compat patches for zmage 2026-05-23 14:19:27 -04:00
.editorconfig Zig 0.17 compat patches for zmage 2026-05-23 14:19:27 -04:00
.gitignore Zig 0.17 compat patches for zmage 2026-05-23 14:19:27 -04:00
build.zig Zig 0.17 compat patches for zmage 2026-05-23 14:19:27 -04:00
build.zig.zon Zig 0.17 compat patches for zmage 2026-05-23 14:19:27 -04:00
LICENSE Zig 0.17 compat patches for zmage 2026-05-23 14:19:27 -04:00
README.md Zig 0.17 compat patches for zmage 2026-05-23 14:19:27 -04:00

zig-xml

zig-xml is an XML library for Zig, currently supporting Zig 0.15.0 and the latest master at the time of writing.

See the documentation in the code for more information about the available APIs (start in xml.zig). Autodocs are also published to GitHub Pages: http://ianjohnson.dev/zig-xml/

The library aims to confirm with the following standards:

Currently, DTDs (DOCTYPE) are not supported.

Other standards (such as XML 1.1 or XML 1.0 prior to the fifth edition) are only supported insofar as they are compatible with the above standards.

Examples

A basic example of usage can be found in the examples directory, and can be built using zig build install-examples.

Tests

The library has several tests of its own, which can be run using zig build test.

The xmlconf directory additionally contains a runner for the W3C XML Conformance Test Suite. Running zig build test in that directory will fetch the test suite distribution tarball and run the tests within. Due to features missing in the current parser implementation (DTD support), many tests are currently skipped. At the time of writing, 250 tests pass, and 924 are skipped due to unsupported features.

Fuzzing

There is a fuzzing sub-project in the fuzz directory using https://github.com/kristoff-it/zig-afl-kit.

Recommended fuzzing command:

afl-fuzz -x dictionaries/xml.dict -x dictionaries/xml_UTF_16.dict -x dictionaries/xml_UTF_16BE.dict -x dictionaries/xml_UTF_16LE.dict -i inputs -o outputs zig-out/bin/fuzz-xml

License

zig-xml is free software, released under the Zero Clause BSD License, as found in the LICENSE file of this repository. This license places no restrictions on your use, modification, or redistribution of the library: providing attribution is appreciated, but not required.