xml-macro 0.3.0

A convenience macro for quick-xml
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::io::Cursor;

use quick_xml::Writer;
use xml_macro::xml;

fn main() {
    let event = xml!(<person name = "Josh" occupation = {["a", "b", "c"][2]}>);
    let mut writer = Writer::new(Cursor::new(Vec::new()));
    writer.write_event(event).unwrap();
    println!(
        "{}",
        String::from_utf8(writer.into_inner().into_inner()).unwrap()
    )
}