You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reading more documentation, I see that serde has a #[serde(other)] enum attribute, but it works only on unit enum variants, and this crate refuses to deserialize xml tags with attributes or children to unit variants.
Let's say I have an xml document with the following form :
and I am only interested in elements of type
item1
anditem2
.Currently, there is no good way to parse such a document with serde-xml-rs.
Try 1
I can write the following
Unfortunately, it won't work with documents such as
because of #55 which has been a open issue since 2017
Try 2
I can write
but this requires me to know ahead of time all the possible tags that can occur in addition of
<item1>
and<item2>
, which I don't.Possible solution
I would like to add a way to parse all unknown tags in a single variant, like this
This follows the same principle as the existing
$value
, but allows parsing any incoming tag without error.For instance
would be parsed as
Is this issue clear enough ? Would you be interested in a PR implementing that ?
The text was updated successfully, but these errors were encountered: