Expand description
A no_std XML reader using embedded-io for memory constrainted environment.
§Features
- no_std
- alloc optional
- streaming
§Usage
let mut reader = xml::Reader::new(&mut reader, xml.len(), 64)?;
loop {
match reader.next_event()? {
xml::Event::StartElement { name, attrs } => {
println!("Start element: {name} with attributes: {attrs:?}");
}
xml::Event::EndElement { name } => {
println!("End element: {name}");
}
xml::Event::EndOfFile => break,
_ => {}
}
}§Limitations & non-goals
- no rewinding
- no DTD support
- no XPath
- no decoding
- individual “Events” have to fit inside the internal buffer
Structs§
- Attribute
Reader - XML attribute reader
- Reader
- A streaming XML reader. The temporary buffer can be owned or borrowed