Crate opml

source · []
Expand description

This crate provides an API to parse and create OPML documents.


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::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");


To create an OPML document from scratch, use OPML::default() or the good old OPML { /* ... */ } syntax.


The Body child element of OPML. Contains all the Outline elements.
The Head child element of OPML. Contains the metadata of the OPML document.
The top-level OPML element.
The Outline element.


All possible errors.