Subject: Re: [xsl] C14N and XSLT From: "Peter Flynn peter@xxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Tue, 10 Apr 2018 20:27:31 -0000 |
On 10/04/18 18:57, Michael Kay mike@xxxxxxxxxxxx wrote: > I decided it was worth looking at whether C14N can be offered as an XSLT > serialization option (saxon:canonical="yes") and it seems easy enough. > The main changes needed to the existing XML serializer seem to be: Canonicalisation would be useful, I think. I'm just curious about the options. > (a) <empty></empty> for empty elements That could be good as an option. How difficult would it be to make it <empty/> when the element type is declared as EMPTY and <empty></empty> when declared with potential content (or undeclared, as in DTDless mode)? It doesn't make a scrap of difference to subsequent XML-conformant processors, but the NET can make a BIG difference when you generate HTML for browsers which may be consumed in HTML5 mode. [...] > (c) sorting of attributes by name - equivalent to the existing Saxon 9.8 > option saxon:attribute-order="". Again, I think it makes no difference to a processor unless the processor is human. But how difficult would it be to make the order follow the order of declaration in the Schema or DTD (without it needing to be specified in saxon:attribute-order)? Conventionally, in the document world, if an element type has an ID type attribute (or several) they tend come first because they have a degree of primacy in the validation of a document, or (in the case of the TEI, I believe) they are grouped by function (such as all those relating to linguistics) because of the way the component models are assembled. > (d) inserting newlines before/after top-level comments and processing > instructions. Top-level is fine. Adding those newlines in element content (at whatever depth) would also be fine. ///Peter
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] C14N and XSLT, Michael Kay mike@xxx | Thread | [xsl] Employment Opportunity, Craig Sampson craig. |
Re: [xsl] C14N and XSLT, Michael Kay mike@xxx | Date | [xsl] Employment Opportunity, Craig Sampson craig. |
Month |