Expand description
§tinyxml2
A ground-up Rust implementation of the TinyXML2 API — behavioral compatibility with idiomatic Rust internals.
§Overview
tinyxml2 provides a lightweight, DOM-based XML parser and serializer that
is behaviorally compatible with the C++ TinyXML2 library. TinyXML2 is treated
as the specification — this crate matches its parsing semantics,
serialization output, entity handling, and error behavior while using Rust’s
type system, ownership model, and standard library conventions internally.
§What this crate is NOT
- Not a wrapper around the C++ TinyXML2 library
- Not a line-by-line translation of C++ code
- Not a fork — it is an entirely new implementation
§Architecture
The DOM is backed by a generational arena allocator where the Document
owns all nodes. This matches TinyXML2’s ownership model (XMLDocument owns
everything) while providing Rust’s memory safety guarantees without unsafe.
§Modules
| Module | Purpose |
|---|---|
error | Error types compatible with TinyXML2’s error codes |
entity | XML entity encoding and decoding |
util | Character classification and string utilities |
arena | Generational arena allocator for DOM nodes |
§Status
This crate is under active development. See the roadmap for the current implementation phase.
Re-exports§
pub use arena::NodeId;pub use error::ParseErrorKind;pub use error::Result;pub use error::XmlError;
Modules§
- arena
- Generational arena allocator for DOM nodes.
- entity
- XML entity encoding and decoding.
- error
- XML error types compatible with TinyXML2’s error codes.
- util
- XML utility functions for character classification and string helpers.
Structs§
- Parse
Options - Options for parsing XML documents.
Enums§
- Whitespace
- Whitespace handling mode, matching TinyXML2’s
Whitespaceenum.