Skip to main content

parse_with

Function parse_with 

Source
pub fn parse_with(src: &str, options: &Options) -> Result<Document, Error>
Expand description

Parses a document. A byte order mark at the start is skipped; an encoding the XML declaration names is ignored, since the text is decoded already.

let e = parsec_xml::parse("<a>\n  <b></a>").unwrap_err();
assert_eq!(e.code(), "mismatched-end-tag");
assert_eq!(e.to_string(), "2:6: `</a>` closes `<b>` [mismatched-end-tag]");