sup-xml
A memory-safe, fast, spec-compliant XML toolkit for Rust — parsing,
serialization, XPath, XSD, XSLT, RelaxNG, Schematron, C14N, and HTML5 in
one library, with a clean idiomatic API and no unsafe in your way.
This crate (sup-xml) is the idiomatic Rust API. The same engine also
ships as a drop-in libxml2 ABI replacement
for code that links libxml2 today (C/C++, Python lxml, Ruby nokogiri,
Perl XML::LibXML).
- Memory-safe — pure Rust with a small, audited
unsafecore, enforced by#![forbid(unsafe_code)]everywhere else and exercised under Miri in CI. - Spec-compliant — 255 / 257 on the W3C XML Conformance Test Suite, ahead of libxml2's 250 / 257.
- Fast — roughly 2× libxml2 and ~1.04× quick-xml on matched-contract byte-event throughput.
Install
[]
= "1.0"
# Optional features — pull in only what you need:
= { = "1.0", = ["xsd", "xslt", "html"] }
Requires Rust 1.85+ (edition = "2024").
Quick start
use ;
let opts = ParseOptions ;
let doc = parse_str?;
let ctx = new;
assert_eq!;
# Ok::
Features
| Feature flag | Enables |
|---|---|
| (default) | XML 1.0 parse / serialize, XPath 1.0 |
xsd |
XML Schema 1.0 / 1.1 validation (sup_xml::xsd) |
xslt |
XSLT 1.0 engine + Schematron (sup_xml::xslt) |
html |
Lenient HTML5 parser (sup_xml::html) |
serde |
Typed deserialization into Rust values (sup_xml::de) |
tokio |
Async parse entry points (sup_xml::async_io) |
network-resolver |
HTTPS-fetched DTDs / entities (NetworkResolver) |
License
SupXML is source-available software released through Supported Source. The source is public and this crate installs normally, but a valid license certificate is required to use it — without one, document parsing returns a fatal error (a grace period applies after an existing certificate expires).
| Use | License |
|---|---|
| Company, government, or organization | Paid commercial license |
| Evaluating before you decide | Free 30-day evaluation license |
| Individual, non-monetized project | Free, renewable one-year hobbyist license |
Get a certificate at
supso.org/projects/sup-xml and place it
where SupXML looks — ~/.supso/license_certificates/ or a project-local
./.supso/license_certificates/. Full terms are in the repository LICENSE.