Skip to main content

parse

Function parse 

Source
pub fn parse<T: AsRef<[u8]>>(xml: T) -> Result<XmlDocument>
Expand description

Parses XML content from a byte slice.

This is the main entry point for parsing XML.

ยงExample

use fastxml::parse;

let xml = r#"<root><child>Hello</child></root>"#;
let doc = parse(xml).unwrap();
let root = doc.get_root_element().unwrap();
assert_eq!(root.get_name(), "root");