Comments (3)
(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.
I also think this would be useful.
(b) I think my preference would be to use
fn:serialize
withmethod="canonical-xml"
. An alternative is to usemethod="xml" canonical="yes"
, but this has the disadvantage that there are many interactions with other serialization options, e.g.indent
,cdata-section-elements
, andomit-xml-declaration
.
+1 for adding a custom method, and we should raise an error if the input is not a single node.
from qtspecs.
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
versusnamespace-prefixes
. - The default setting for
namespace-prefixes
in the map options forfn: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
andfn: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
andfn:serialize
conflict, let the latter prevail (in XQFO 3.1fn: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)
- parse-json: liberal parsing HOT 2
- fn:json-to-xml: 'number-parser' option HOT 2
- Backwards incompatibility caused by use of EBV in callback functions HOT 4
- Allow dynamic collations in XQuery "order by" and "group by" HOT 11
- CSV parsing - "blank" rows HOT 3
- CSV row delimiter - allowed values HOT 5
- Functions to manage namespace usage HOT 2
- Incorrect note for `fn:some` and `fn:every` HOT 5
- fn:format-number: relax restrictions on exponent-separator (possibly minus-sign, percent, per-mille) HOT 13
- Potential (low-risk) Ambiguities in XPath EBNF
- parse-csv() - simplify output HOT 1
- Spec fn:message #id using old name fn:log
- simplifying the language - attempt 2 HOT 22
- Simplifying match templates HOT 11
- Formatting XPath/XQuery HOT 2
- discussion - language pragmas HOT 6
- deep-equal() - option to compare functions liberally HOT 25
- fn:format-number: further notes
- fn:deep-equal: significant children HOT 2
- fn:ucd HOT 25
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qtspecs.