Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xml encoding #47

Merged
merged 3 commits into from
Feb 27, 2025
Merged

Xml encoding #47

merged 3 commits into from
Feb 27, 2025

Conversation

einarmo
Copy link
Contributor

@einarmo einarmo commented Feb 26, 2025

This is a major rewrite of XML parsing, adding support for XML serialization, and bringing it up to the same level as JSON and binary. I also fixed a few bugs I hit on in a few places. There are still some things remaining:

  • Unions
  • XML in binary/json encoded extension objects.
  • Proper support for the XmlElement variant (currently it doesn't work properly for XML). Note that this variant type is deprecated.

This PR is already way too big. There was no real way to make it smaller, since once you start replacing FromXml there's no way to stop while still having the library compile.

The PR is split into a few smaller commits, that incrementally add features, at least as much as was possible while still having each commit compile. The line count may be a little misleading, since a fair bit of it is generated, but this is a big PR, just because there are so many changes.

I want to, in the future, use quick-xmls serde feature to replace roxmltree entirely, but this is currently not possible, as there is no way to capture raw XML, which we need to in order to defer loading of values for later, once Context is available.

We may also want to create an attribute-macro to automatically derive all the different encoding macros depending on input type, since just the derives are getting a bit verbose.

Further work is going to need derive macros to be implemented.
This is a major rewrite of XML parsing, adding support for XML
serialization, and bringing it up to the same level as JSON and binary.
I also fixed a few bugs I hit on in a few places. There are still some
things remaining:

 - Unions
 - XML in binary/json encoded extension objects.
 - Proper support for the XmlElement variant (currently it doesn't work
   properly for XML). Note that this variant type is deprecated.

This PR is already way too big. There was no real way to make it
smaller, since once you start replacing FromXml there's no way to stop
while still having the library compile.
Copy link
Contributor

@svanharmelen svanharmelen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must admit I mainly looked at the first two commits (thanks for splitting them) and only skimmed through the last one 😉 But looks good to me 👍🏻

@einarmo
Copy link
Contributor Author

einarmo commented Feb 27, 2025

Thanks for the review! I hope and believe this will be the last PR of this size, (excluding any more generated code in the future).

@einarmo einarmo merged commit 60089b7 into master Feb 27, 2025
6 checks passed
@einarmo einarmo deleted the xml-encoding branch February 27, 2025 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants