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 primarily a trial and error approach to parsing XML. This can inherently be a bit slower than other libraries, but it allows for more complex XML structures to be parsed.
Get started
To get started, we recommend you check out the documentation and the examples.
Example
- Add XMLity and XMLity-compatible (de)serializer library. In this example we use
xmlity-quick-xml
.
[]
= { = "0.0.8", = ["derive"] }
= "0.0.8"
- Write defintions and use:
extern crate xmlity_quick_xml;
use ;;
;
;
let person = Person ;
let xml = to_string.expect;
assert_eq!;
let person: Person = from_str.expect;
assert_eq!;
assert_eq!;
Why use XMLity instead of other XML libraries?
serde-xml-rs
: Lacking proper namespace support and other features.yaserde
: Lacking support for trial-and-error deserialization, a requirement for full coverage of XML schemas.quick-xml
(serde
feature): Lacking support for namespaces.
Other resources
- The official XML schema generator: Coming soon! It's already very feature-rich and is good enough to bootstrap itself by deserializing XML schemas using its own generated code, however it still requires some cleanup before its ready for public use.