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

RE: XSLT engines and terminal newline

Subject: RE: XSLT engines and terminal newline
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 19 Sep 2006 18:06:20 +0100
xsltproc newline
If that's the only difference in the serialized output, I'm amazed. Many
aspects of serialization aren't defined in the specs to that level of detail
- for example, the order of attributes is unpredictable. The general rule is
that if the XML parser treats two documents in the same way, then they are
equivalent. The correct way to compare results is to put them both through a
canonicalizer that removes these differences.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Michael(tm) Smith [mailto:smith@xxxxxxxxxxxxxxxxxx] 
> Sent: 19 September 2006 16:47
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  XSLT engines and terminal newline
> 
> When I do an XSLT transformation with xsltproc, the output is 
> always newline-terminated (final byte is a newline character).
> When I do the same transformation with Saxon 6.5, the output 
> is not newline-terminated.
> 
> For most purposes the difference doesn't matter. But to diff 
> and some other text-processing tools, it does (diff considers 
> any line that doesn't end with a newline to be an "incomplete 
> line"; it goes ahead processes such a line as if they did end 
> in a newline, but emits a "No newline at end of file" message 
> in the diff).
> 
> I know I can make changes within my stylesheet to ensure that 
> the terminal newline gets added to the Saxon output, but the 
> problem is that if I then use the same stylesheet with 
> xsltproc, I end up with two newlines at the end of the file 
> (and so an unnecessary blank line at the end). I also know 
> that for the case of XML output, I can do a postprocessing 
> step to run it through a tool that produces canonical XML -- 
> which will ensure that it ends with single newline -- but 
> that does me no good for HTML output.
> 
> Has anybody else run into this issue? Any suggestions about 
> how to deal with it?
> 
>   --Mike
> 
> --
> Michael(tm) Smith
> xmpp:smith@xxxxxxxxxxxxxxxxxx
> irc://irc.freenode.net/mobile-web

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.