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 Canonicalisation #175

Open
ljdarj opened this issue Feb 24, 2022 · 3 comments
Open

XML Canonicalisation #175

ljdarj opened this issue Feb 24, 2022 · 3 comments

Comments

@ljdarj
Copy link

ljdarj commented Feb 24, 2022

For something I'm working on I need to output canonicalised XML.

I'm willing to implement a RenderSetting to optionally canonicalise the XML output, would you take such a pull request?

@snoyberg
Copy link
Owner

I'd defer to @k0ral on whether this should be added. But I'm curious: what does canonicalized mean here? What's the difference from what is currently rendered?

@ljdarj
Copy link
Author

ljdarj commented Mar 3, 2022

That's the canonicalisation from here, which in short defines a standard order for attributes, requires that CDATA sections be replaced by their textual content and a few other things.

But thinking of it, a separate function — and not necessarily in xml-conduit at that — would probably be a better fit rather than piggy-backing on renderText & co: canonicalisation can fail contrary to renderText & co.

@k0ral
Copy link
Collaborator

k0ral commented Mar 4, 2022

I've skimmed through the "Canonical XML" specification, and I have the feeling this could fit nicely in xml-conduit, for example as an alternate implementation of the tokenToBuilder function.

The fact that canonicalisation can fail doesn't strike me as a blocker -- the signatures of the new functions just need to convey that possibility.

Just my 2 cents though, I might not realize that this is harder than it looks.

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

No branches or pull requests

3 participants