RReverser / serde-xml-rs

xml-rs based deserializer for Serde (compatible with 1.0+)
https://crates.io/crates/serde-xml-rs
MIT License
269 stars 90 forks source link

Document how attributes can be used #168

Closed Corasonn closed 2 years ago

Corasonn commented 2 years ago
A {
    pub b: String
}

let foo = A {
    b: "bar".to_string()
}
let xml = to_string(foo).unwrap();

This produces:

<A><b>bar</bar><A>

It's what I expect, but what I need is:

<A b="bar"><A>

How can I achieve this? I didn't find any documentation about it.

punkstarman commented 2 years ago

Thank you @Corasonn. Unfortunately what you want can't be achieved yet. I am working on rewriting the serializer completely based on a prototype of mine (https://github.com/punkstarman/serde-xml).

punkstarman commented 2 years ago

This is a duplicate of #140.