rbatisxmlparser

Build Status http://www.apache.org/licenses/LICENSE-2.0 https://opensource.org/licenses/MIT Clippy Linting Result

API documentation

Warning: This library is alpha quality, so no guarantees are given.

This crate provides a push based XML parser library that trades well-formedness for error recovery.

rbatisxmlparser is based largely on html5ever parser, so if you have experience with html5ever you will be familiar with rbatisxmlparser.

The library is dual licensed under MIT and Apache license.

Why you should use rbatisxmlparser

Main use case for this library is when XML is badly formatted, usually from bad XML templates. XML5 tries to handle most common errors, in a manner similar to HTML5.

When you should use it?

When you shouldn't use it

Installation

Add rbatisxmlparser as a dependency in your project manifest.

toml [dependencies] rbatis_xml_parser = "0.1.3"

And add crate declaration in your lib.rs

rust extern crate rbatis_xml_parser

Getting started

Here is a very simple RcDom backed parser:

```rust

let input = "<xml></xml>".to_tendril();

// To parse XML into a tree form, we need a TreeSink
// luckily rbatis_xml_parser comes with a static RC backed tree represetation.
let dom: RcDom = parse(std::iter::once(input), Default::default());

// Do something with dom

`` The thing that does actual parsing is theparsefunction. It expects an iterator that can be converted intoStrTendril, so you can usestd::iter::once(input)orSome(input).into_iter()(whereinputisStrTendril` like structure).