libxml 0.2.3

A Rust wrapper for libxml2 - the XML C parser and toolkit developed for the Gnome project
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
extern crate libxml;

use libxml::parser::{Parser};
use libxml::xpath::Context;


fn main() {
  let parser = Parser::default();
  let doc = parser.parse_file("tests/resources/file01.xml").unwrap();
  let context = Context::new(&doc).unwrap();
  let result = context.evaluate("//child/text()").unwrap();

  for node in &result.get_nodes_as_vec() {
      println!("Found: {}", node.get_content());
  }
}