MaybeXml
MaybeXml is a library to scan and evaluate XML-like data into tokens. In effect, the library provides a non-validating parser. The interface is similar to many XML pull parsers.
Purpose
The purpose of the library is to provide a way to read XML documents including office suite documents, RSS/Atom feeds, config files, SVG, and web service messages.
Examples
Using tokenize()
use ;
let input = "<id>123</id>";
let reader = from_str;
let mut pos = 0;
let token = reader.tokenize;
if let Some = token.map else
assert_eq!;
let token = reader.tokenize;
if let Some = token.map else
assert_eq!;
let token = reader.tokenize;
if let Some = token.map else
assert_eq!;
let token = reader.tokenize;
assert_eq!;
// Verify that `pos` is equal to `input.len()` to ensure all data was
// processed.
Using Iterator functionality
use ;
let input = "<id>123</id><name>Jane Doe</name>";
let reader = from_str;
let mut iter = reader.into_iter.filter_map;
let name = iter.next;
assert_eq!;
let name = iter.next;
assert_eq!;
assert_eq!;
Installation
By default, the std feature is enabled.
Alloc only
If the host environment has an allocator but does not have access to the Rust
std library:
No allocator / core only
If the host environment does not have an allocator:
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.
Contributions
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.