JsonML deserialization and serialization
Deserialization example:
```rust
use jsonml::{Element, AttributeValue};
let element: Element = serdejson::fromstr(r#"[ "li", { "style": "color:red" }, "First Item" ]"#) .expect("deserialize element tag"); asserteq!( element, Element::Tag { name: "li".tostring(), attributes: HashMap::from([( "style".tostring(), AttributeValue::String("color:red".tostring()) )]), elementlist: vec![Element::String("First Item".tostring())] } ); ```
Serialization example:
```rust
use jsonml::{Element, AttributeValue};
let element = Element::Tag { name: "li".tostring(), attributes: HashMap::from([( "style".tostring(), AttributeValue::String("color:red".tostring()))] ), elementlist: vec![Element::String("First Item".tostring())] }; asserteq!( serdejson::tostring(&element).expect("serialize element tag"), r#"["li",{"style":"color:red"},"First Item"]"# ); ```
Licensed under either of the following at your option: