xml-doc 0.1.1

Read, modify and write xml in tree-like structure. Supports UTF-16.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use xml_doc::Document;

#[test]
fn test_normalize_attr() {
    // See comment on xml_doc::parser::DocumentParser::normalize_attr_value
    let xml = "<?xml version=\"1.0\"?>
<root attr=\" \r\t

 ab&#xD;   c
  \" />";
    let doc = Document::parse_str(xml).unwrap();
    let root = doc.root_element().unwrap();
    let val = root.attribute(&doc, "attr").unwrap();

    assert_eq!(val, "ab\r c");
}