#xml #parser

trashy-xml

Xml parser that does not stop parsing when encountering errors

16 releases (8 breaking)

0.11.0 Apr 21, 2021
0.10.1 Mar 30, 2021
0.7.0 May 11, 2020
0.5.3 Mar 8, 2020

#788 in Text processing

39 downloads per month

MIT license

60KB
1.5K SLoC

trashy-xml

A non-spec compliant xml parser that does not stop parsing when encountering errors.

Example

use trashy_xml::XmlParser;

// Gets each open element matching "this_element"
// then prints the debug representation of its attributes.
let parsed = XmlParser::str("<this_element attribute=\"value\" />").parse();
for token in parsed.elements_from_name("this_element") {
    dbg!(token.attributes());
}

lib.rs:

A non-spec compliant xml parser that does not stop parsing when encountering errors.

Examples

use trashy_xml::XmlParser;

// Gets each open element matching "this_element"
// then prints the debug representation of its attributes.
let parsed = XmlParser::str("<this_element attribute=\"value\" />").parse();
for token in parsed.elements_from_name("this_element") {
    dbg!(token.attributes());
}

Dependencies

~1.5MB
~20K SLoC