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 child [Outline
] elements, as per the spec.
use OPML;
let xml = r#"<opml version="2.0"><head/><body><outline text="Outline"/></body></opml>"#;
let document = OPML from_str.unwrap;
assert_eq!;
Creating
To create an OPML document from scratch, use [OPML::default()
] or the good
old OPML { /* ... */ }
syntax.