xmloxide Rust libxml2 Replacement Hits 100% Conformance
Get the Tech newsletter
Daily tech — startups, AI labs, chips, the launches that shape the next decade. Free.
- xmloxide is a pure Rust reimplementation of libxml2 — the de facto XML/HTML parsing library used across open source — released after libxml2 was declared officially unmaintained in December 2025 with known security issues.
- The library passes 100% of the W3C XML Conformance Test Suite (1727/1727 applicable tests) and 100% of html5lib-tests (8810/8810, including 7032 tokenizer and 1778 tree-construction tests), and exposes zero
unsafein its public API via an arena-based tree. - Benchmarks show parsing within 3–4% of libxml2 on most documents, 12% faster on SVG, serialization 1.5–2.4x faster, and XPath 1.1–2.7x faster across the suite.
- xmloxide ships a full C/C++ FFI (include/xmloxide.h) and an xmllint-compatible CLI, supporting DOM, SAX2, XmlReader, push parsing, CSS selectors, XPath 1.0 with XPath 2.0 extensions, DTD/RelaxNG/XSD/Schematron validation, C14N, XInclude, and XML Catalogs.
- Unlike libxml2, xmloxide has no global state — every Document is self-contained and Send + Sync, with thread-local error storage and no required init/cleanup functions.
- Documented gaps include no XML 1.1, no XSLT (out of scope, like libxslt), and a push parser that currently buffers all data and parses on
finish()rather than truly streaming like libxml2'sxmlParseChunk.
Why it matters: libxml2 underpins Chromium, game engines, and countless C/C++ codebases, so its December 2025 maintenance freeze left a critical gap that xmloxide now targets with 100% W3C and html5lib conformance plus a drop-in C FFI header. Matching libxml2 on parsing while beating it 1.5–2.4x on serialization and 1.1–2.7x on XPath gives downstream projects a safety migration path without trading away performance.
Ask SkimNews

