Crate treexml [] [src]

An element-tree style XML library

Examples

use treexml::Document;

let doc_raw = r#"
<?xml version="1.1" encoding="UTF-8"?>
<table>
    <fruit type="apple">worm</fruit>
    <vegetable />
</table>
"#;

let doc = Document::parse(doc_raw.as_bytes()).unwrap();
let root = doc.root.unwrap();

let fruit = root.find_child(|tag| tag.name == "fruit").unwrap().clone();
println!("{} [{:?}] = {}", fruit.name, fruit.attributes, fruit.contents.unwrap());

Structs

Document

An XML document

Element

An XML element

Enums

Error

The common error type for all XML tree operations

XmlVersion

Enumeration of XML versions