A high-performance, low-memory XML DOM parser for Rust — with namespace-aware parsing, order-preserving attributes, and round-trip safe serialization.
This project is dual-licensed:
- Open Source — AGPL-3.0 (see LICENSE). Free to use, including commercially, as long as you comply with AGPL-3.0 copyleft (share source of derivatives and network-served versions).
- Commercial License for closed-source / proprietary use without AGPL obligations — available to sponsors (see COMMERCIAL-LICENSE.md).
💜 If this project helps you or your business, please consider sponsoring — sponsors get the commercial license, private releases, and priority support.
- UTF-8 focused XML parsing
- Reads XML declaration (version, encoding, standalone)
- Line break normalization (
\r\n/\r→\n) - Full namespace resolution with prefix → URI stack
- Correct QName parsing (
{namespace_uri, local_name}) - Order-preserving attributes (using
IndexMap) - Support for:
- Elements (
<tag>/<tag/>) - Attributes (namespaced & unnamespaced)
- Mixed content (text + elements)
- Comments (
<!-- -->)
- Elements (
- Round-trip safe serialization:
- Preserves original namespace prefixes
- namespace alias rename
- Preserves attribute order
- Low memory ID-based tree model (similar to arena allocation)
- No unsafe code
- Working on setting up a central system for all my OSS contribution will update link in description once ready. Please refer to tests crate present in this repository to understand the methods
cargo add draviavemal-xml_rs