[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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 
 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|