Skip to content

XML Canonicalisation #175

Description

@ljdarj

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?

Activity

  1. snoyberg commented on Feb 27, 2022

    @snoyberg
    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?

  2. ljdarj commented on Mar 3, 2022

    @ljdarj
    Author

    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.

  3. k0ral commented on Mar 4, 2022

    @k0ral
    Collaborator

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions