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

Re: pretty printing - having CRLF instead of LF

Subject: Re: pretty printing - having CRLF instead of LF
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 29 May 2018 20:59:18 -0000
Re:  pretty printing - having CRLF instead of LF
> On 29 May 2018, at 09:19, cmarchand@xxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> If you use a Java based XSLT Processor, you may change the system property
:
> System.setProperty("line.separator", "\r\n");
>

This may affect the behavior of some Java XSLT processors, but it won't affect
the behavior of Saxon. I don't see anything in the JAXP specs that says it's
relevant.

Note that according to the 3.1 serialization spec (I haven't checked earlier
versions but I suspect they're the same), the serializer has discretion to use
CRLF rather than LF as a line ending when inserting indentation, but it has no
license to do so when outputting the content of text (or attribute) nodes in
the actual transformation result. A newline (LF) character appearing in a text
node must be serialized as a newline character; a CR character appearing in a
text node must be serialized as &#x0D; or equivalent.

I would suggest sending the transformation result to a StreamResult that
contains a custom implementation of OutputStream that translates LF to CRLF.

Michael Kay
Saxonica

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.