xmlserde
xmlserde copied to clipboard
Getting <> (empty tag) while serializing a struct with ty = "untag"
#[derive(XmlSerialize)]
#[xmlserde(root = b"root")]
struct Wrapper<T:XmlSerialize> {
#[xmlserde(name = b"header", ty = "attr")]
header: String,
#[xmlserde(ty = "untag")]
body: T,
}
#[derive(XmlSerialize)]
#[xmlserde(root = b"Foo")]
struct Foo {
#[xmlserde(name = b"Bar", ty = "child")]
bar: Bar
}
when serializing, Wrapper<Foo>, Im expecting this,
<root header=""> <bar> </bar> <root>
But, Im getting this xml, which has empty tags
<root header=""> <> <bar> </bar> </> </root>
Anyway to achieve this, without writing custom implementation for serialize trait?