Open futile opened 6 years ago
@futile did you find an answer to this?
@futile did you find an answer to this?
Nope, don't think I ever found a solution. But, given that the last commit to this repo was ~2 years ago, I would assume that there exist better options for XML-parsing (maybe without serde) for Rust by now. Good luck! :)
@futile Thanks for your response on this! Sort of what I was afraid of... think I'll try quick_xml.
I have data which can look like either:
or
And, as far as I can see, this is not (yet) possible to deserialize. With the old serde-xml I was able to get a
serde_xml::Value
, which was an enum that could be, e.g.,Value::Element(...)
orValue::Content(...)
, which made it possible to handle them individually. However, I have no Idea how I would do that currently.The regular
Deserializer
/Visitor
pattern seems to fail here, as I need to dispatch based on what is actually inside the XML, and don't known that beforehand.Edit: Something that looked like it should work, but didn't. It worked for the string case, but not for the XML-case (
cant match any variant
-error):Inlining either of the variants (String or Vec) into DataImpl actually makes it work for that case (but obviously not for the other).
All help is appreciated!