Skip to main content

Crate xmloxide

Crate xmloxide 

Source
Expand description

§xmloxide

A pure Rust reimplementation of libxml2 — the de facto standard XML/HTML parsing library. Memory-safe, high-performance, and conformant with the W3C XML 1.0 (Fifth Edition) specification.

§Modules

  • tree — DOM tree representation with arena-allocated nodes (Document, NodeId)
  • parser — XML 1.0 parser with error recovery and push/incremental parsing
  • html — Error-tolerant HTML 4.01 parser
  • html5 — WHATWG HTML5 parser (tokenizer + tree construction)
  • html5::sax — Streaming SAX-like API for HTML5 (no DOM tree built)
  • css — CSS selector engine for querying document trees
  • sax — SAX2 event-driven streaming parser
  • readerXmlReader pull-based parsing API
  • xpathXPath 1.0+ expression evaluation (includes key XPath 2.0 functions)
  • validation — DTD, RelaxNG, XML Schema (XSD), and ISO Schematron validation
  • serial — XML/HTML serialization and Canonical XML (C14N)
  • encoding — Character encoding detection and conversion
  • xincludeXInclude 1.0 document inclusion
  • catalog — OASIS XML Catalogs for URI resolution
  • error — Error types and diagnostics
  • serde_xml — Serde XML (de)serialization (requires serde feature)
  • async_xml — Async parsing via tokio::io::AsyncRead (requires async feature)

§Quick Start

use xmloxide::Document;

let doc = Document::parse_str("<root><child>Hello</child></root>").unwrap();
let root = doc.root_element().unwrap();
assert_eq!(doc.node_name(root), Some("root"));

Re-exports§

pub use tree::Attribute;
pub use tree::Document;
pub use tree::NodeId;

Modules§

async_xml
Async XML parsing via tokio::io::AsyncRead.
catalog
XML Catalogs for URI resolution (OASIS XML Catalogs 1.1).
css
CSS selector engine for querying Document trees.
encoding
Encoding detection and transcoding.
error
Error types and diagnostics for XML parsing.
ffi
C FFI layer for xmloxide.
html
Error-tolerant HTML parser.
html5
WHATWG HTML5 parser.
parser
XML 1.0 parser.
reader
Pull-based streaming XML reader API.
sax
SAX2 streaming event handler API.
serde_xml
Serde XML (de)serialization.
serial
XML and HTML serialization.
tree
Arena-based XML document tree.
validation
Document validation framework.
xinclude
XInclude 1.0 processing.
xpath
XPath 1.0 query language implementation.