xmlJSON
Convert XML data to JSON. Note that this is not yet well tested. Use at your own risk.
Status
Usage
Add this to your Cargo.toml:
= "0.1.3"
xmlJSON
Structs for conversions from XML to JSON
extern crate xmlJSON;
extern crate rustc_serialize;
use XmlDocument;
use json;
use FromStr;
let s = "<test lang=\"rust\">An XML Document <testElement>A test
element</testElement></test>"
let document : XmlDocument = from_str.unwrap;
let jsn : Json = document.to_json;
The resulting Json will be of the form
and add this to your crate root:
extern crate xmlJSON;
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
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.
TODO:
- Add better testing
- Add documentation
- Add conversion from JSON to XML, and allowing for writing JSON as XML