[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: C14N and XSLT

Subject: Re: C14N and XSLT
From: "Peter Flynn peter@xxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 10 Apr 2018 20:27:31 -0000
Re:  C14N and XSLT
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.