Giter Site home page Giter Site logo

Canonical serialization about qtspecs HOT 3 OPEN

Arithmeticus avatar Arithmeticus commented on July 18, 2024
Canonical serialization

from qtspecs.

Comments (3)

michaelhkay avatar michaelhkay commented on July 18, 2024

(a) Yes I think it would be useful.

(b) I think my preference would be to use fn:serialize with method="canonical-xml". An alternative is to use method="xml" canonical="yes", but this has the disadvantage that there are many interactions with other serialization options, e.g. indent, cdata-section-elements, and omit-xml-declaration.

Note, if you want to experiment, Saxon already offers `method="xml" saxon:canonical="yes": see https://www.saxonica.com/documentation12/index.html#!extensions/output-extras/serialization-parameters. I tested this against the canonicalizer offered by XOM.

(c) There are certainly users who would want XML Signature for document signing, rather than just canonicalisation.

from qtspecs.

ChristianGruen avatar ChristianGruen commented on July 18, 2024

I also think this would be useful.

(b) I think my preference would be to use fn:serialize with method="canonical-xml". An alternative is to use method="xml" canonical="yes", but this has the disadvantage that there are many interactions with other serialization options, e.g. indent, cdata-section-elements, and omit-xml-declaration.

+1 for adding a custom method, and we should raise an error if the input is not a single node.

from qtspecs.

Arithmeticus avatar Arithmeticus commented on July 18, 2024

In thinking about discussion that might happen on this issue at today's CG meeting, I noted to myself:

  • CX1.1 has a boolean parameter for whether comments are significant.
  • CX1.1 resolves not to normalize namespace prefixes or characters.
  • Some options in the options map of fn:serialize express parameters one might like to adjust in canonical serialization.
  • Most of the options in the options map in fn:deep-equal express even more parameters one might like to adjust in canonical serialization, including namespace prefixes and characters.
  • There is overlap between the two abovementioned functions' options maps, with some inconsistency, e.g., undeclare-prefixes versus namespace-prefixes.
  • The default setting for namespace-prefixes in the map options for fn:deep-equal runs against CX1.1's resolution.

Ideas for a way forward to avoid repetition in the specs:

  • Identify a common set of options from fn:deep-equal and fn:serialize that should apply to canonical serialization.
  • From the common set, define a canonical serialization options map that can be referred to by both functions, or any other function that might need to appeal to canonical serialization options. Where names, behavior, or default of options in fn:deep-equal and fn:serialize conflict, let the latter prevail (in XQFO 3.1 fn:deep-equal lacks an options map).
  • Introduce and describe that options map in its own section, structured analogous to what already exists for the regular expression functions. That is, refer to the external standard being used, CX1.1, but specify where adjustments have been made.

I am uncertain what edits might be needed to the serialization specs, particularly for those options in fn:deep-equal that have no fn:serialize counterpart, e.g., schema-aware adjustments, processing-instructions. It may turn out we wish not to include some of these in a common options map. Let's discuss.

from qtspecs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.