Commit graph

9 commits

Author SHA1 Message Date
Emmanuel Gil Peyrot
4356cab33c xso-proc: Fix all clippy warnings 2024-07-03 16:28:11 +02:00
Jonas Schäfer
c83ff286e0 xso-proc: add support for text codecs
Text codecs allow to customize the conversion of data from/to XML,
in particular in two scenarios:

1. When the type for which the behaviour is to be defined comes from a
   foreign crate, preventing the implementation of
   FromXmlText/IntoXmlText.

2. When there is not one obvious, or more than one sensible, way to
   convert a value to XML text and back.
2024-07-02 06:56:30 +02:00
Jonas Schäfer
46584f05f9 xso: refine handling of multiple #[xml(text)] fields
Previously, we only enforced the existence of at most one `#[xml(text)]`
field only at code generation time for `FromXml`. This change enforces
it at parsing time, which is more consistent and allows for a clearer
error message.
2024-07-01 08:01:42 +02:00
Jonas Schäfer
b0803f831b xso-proc: add support for parsing text content 2024-07-01 08:01:42 +02:00
Jonas Schäfer
0c57be3e61 xso-proc: add support for defaulting in attribute parsing 2024-06-30 13:05:37 +02:00
Jonas Schäfer
c0fc7f49cf xso-proc: add support for non-String typed attributes 2024-06-30 13:01:36 +02:00
Jonas Schäfer
84de7fc248 xso-proc: add support for namespaced attributes 2024-06-24 12:39:32 +02:00
Jonas Schäfer
219d682295 xso-proc: add support for renaming attributes
This is akin to `#[serde(rename = ..)]` and thus useful.
2024-06-24 11:33:10 +02:00
Jonas Schäfer
212c5c4a83 xso-proc: add support for parsing attributes into Strings
This is bare-bones and is missing many features which we intend to add
in future commits, such as parsing from attributes whose names differ
from the field names and parsing into non-String types.
2024-06-24 11:33:10 +02:00