Module alfred::xml
[−]
[src]
Helpers for writing Alfred script filter XML output (Alfred 2)
Unless you specifically need Alfred 2 compatibility, you should use the alfred::json
module
instead.
Example
let mut xmlw = try!(alfred::XMLWriter::new(io::stdout())); let item1 = alfred::Item::new("Item 1"); let item2 = alfred::ItemBuilder::new("Item 2") .subtitle("Subtitle") .into_item(); let item3 = alfred::ItemBuilder::new("Item 3") .arg("Argument") .subtitle("Subtitle") .icon_filetype("public.folder") .into_item(); try!(xmlw.write_item(&item1)); try!(xmlw.write_item(&item2)); try!(xmlw.write_item(&item3)); let mut stdout = try!(xmlw.close()); stdout.flush()
Structs
XMLWriter |
Helper struct used to manage the XML serialization of |
Functions
write_items |
Writes a complete XML document representing the |