Expand description
This crate provides an API to parse and create OPML documents.
Parsing
To parse an OPML document use OPML::from_str
or OPML::from_reader
.
Parsing will result in an error if:
- the XML is malformed,
- the included OPML version is not supported (currently all OPML versions (1.0, 1.1 and 2.0) are supported) or,
- if the
Body
element contains no childOutline
elements, as per the spec.
use opml::OPML;
let xml = r#"<opml version="2.0"><head/><body><outline text="Outline"/></body></opml>"#;
let document = OPML::from_str(xml).unwrap();
assert_eq!(document.version, "2.0");
Creating
To create an OPML document from scratch, use OPML::default()
or the good
old OPML { /* ... */ }
syntax.
Structs
Enums
- All possible errors.