kilork.github.io

rust-libxml

A Rust wrapper around libxml2.

Sometimes "use libxml2" is not laziness, it is the requirement: the documents were written against its parser, its XPath or its recovery behaviour. This wraps it instead of hiding it.

What changes for you

Getting it

The crate is libxml on crates.io; this repository is the maintainer's working tree.

cargo add libxml
use libxml::parser::Parser;

let document = Parser::default().parse_string("<root><child/></root>")?;
for node in document.child_nodes() {
    println!("{}", node.get_name());
}

Where to look

source · crate