xmlserde icon indicating copy to clipboard operation
xmlserde copied to clipboard

Getting <> (empty tag) while serializing a struct with ty = "untag"

Open vastvik123 opened this issue 8 months ago • 3 comments

#[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?

vastvik123 avatar Jun 19 '24 08:06 vastvik123