Debian Codegraph @

examples/xpath_example.rs

raw symbols SCIP
1 use libxml::parser::Parser;
2 use libxml::xpath::Context;
3
4 fn main() {
5 let parser = Parser::default();
6 let doc = parser.parse_file("tests/resources/file01.xml").unwrap();
7 let context = Context::new(&doc).unwrap();
8 let result = context.evaluate("//child/text()").unwrap();
9
10 for node in &result.get_nodes_as_vec() {
11 println!("Found: {}", node.get_content());
12 }
13 }