exile
Current version: 0.0.4
exile
is a Rust library for reading and writing XML.
The goal, at least initially, is to provide an abstract syntax tree of an XML file. As such, this is a Exile is a dom parser and loads the complete contents of the document into memory.
Currently supported:
- Attributes
- CDATA Sections
- Comment Parsing
- Elements
- Processing Instructions
- Text Nodes
- UTF-8
- Whitespace Normalization
Not Supported:
- Doctypes
- Entities
- Entity References
- Other Encodings
- Whitesace Preservation: All text nodes are treated as if whitespace
collapse
were in-effect.
Example
Parsing XML looks like this.
let xml = r#"
<root>
<thing name="foo"/>
<thing>bar</thing>
</root>
"#;
let doc = parse.unwrap;
for child in doc.root.children
Authoring XML looks like this.
use ;
let mut root = from_name;
root.add_attribute;
let mut child = from_name;
child.add_text;
root.add_child;
let doc = from_root;
println!;
The above program prints:
Hello World!