Expand description
Arena-based XML document tree.
This module implements the core tree representation using arena allocation
with typed indices. All nodes live in a contiguous Vec<NodeData> owned by
the Document, and are referenced by NodeId — a newtype over NonZeroU32.
This design provides O(1) node access, cache-friendly layout, no reference
counting overhead, and safe bulk deallocation (drop the Document and
everything is freed).
§Architecture
Unlike libxml2’s web of raw C pointers, we use arena indices for all navigation links (parent, first_child, last_child, next_sibling, prev_sibling). This avoids borrow checker issues, reference cycles, and per-node heap allocation.
Structs§
- Ancestors
- Iterator over a node and its ancestors, walking up toward the document root.
- Attribute
- An XML attribute on an element.
- Children
- Iterator over the direct children of a node.
- Descendants
- Depth-first (pre-order) iterator over all descendants of a node.
- Document
- An XML document.
- Node
Data - Storage for a single node in the document arena.
- NodeId
- A typed index into the document’s node arena.
Enums§
- Node
Kind - The kind of an XML node and its associated data.