Introduction to XMLity
XMLity is a (de)serialization library for XML, inspired by serde
and improves upon XML (de)serialization libraries such as yaserde
and quick-xml
by providing a more flexible API that is more powerful, utilising primairly a trial and error approach to parsing XML.
Want to get started? Click here.
Comparison
Why does XMLity need to exist? Doesn't other XML-parsers/deserializers exist in Rust and why should I use/contribute to XMLity instead? To answer these questions, we've provided a feature chart below:
If something stated here is wrong, please submit a PR! It is not guaranteed to be correct, but should be a pretty fair description. The list tries to rank the features in order of importance, but it is ofcourse subjective.Feature | XMLity | Yaserde | quick-xml ( serde feature) |
---|---|---|---|
Namespace support | Yes | Yes | No |
Enum string value | Yes | Yes | Yes |
Enum number value | No? | Yes | Yes |
Trial and error deserialization | Yes | No | No * |
Standalone named elements (inherit element names from types) | Yes | No | No |
Order-based deserialization | Yes | No | Yes |
XSD Generator | No + | Yes | Yes |
Multiple reader/writer implementation support | Yes ** | No | No |
+ Being worked on.
? Planned.
* While quick-xml
has partial support, it is insufficient for any range of possible values. It only supports textual nodes, meaning trial and error deserialization is not possible for proper elements.
** While XMLity does have support for multiple readers/writers, the only current one that exists is the official one using quick-xml
, even if others are supported due to the data-model being completely deconnected from any other library. This should change in the near future as support for xml-rs
is planned.