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

RE: Windows-style CRLF in text output

Subject: RE: Windows-style CRLF in text output
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 4 Jul 2008 09:49:26 +0100
RE:  Windows-style CRLF in text output
The specification doesn't say how line endings will be represented by the
text output method.

One thing you can be sure of is that the way they are represented in the
stylesheet makes no difference: the XML parser will always normalize line
endings to a single x0A character. 

Saxon doesn't do anything special: if the stylesheet contains

<xsl:text>&#x0a;</xsl:text>

then it will write an xA character, whereas if it contains

<xsl:text>&#x0d;&#x0a;</xsl:text>

then it will write xDxA. Of course there's plenty of scope for the Java
runtime and the operating system to change that before it hits the disk. In
fact one way to achieve what you want might be to write a Java Writer that
adjusts the line endings as required, and send the transformation output to
that Writer.

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


> -----Original Message-----
> From: Steven Hentschel [mailto:steven.hentschel@xxxxxxxxxxx] 
> Sent: 04 July 2008 09:35
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Windows-style CRLF in text output
> 
> 
> I've got an application where the output needs be a text file 
> using windows-style line endings i.e CRLF, so I thought if 
> the stylesheet used CRLF as the line endings these would 
> appear on the output. However the output has carriage returns 
> stripped.
> 
> I've found I can restore the CR if I use a character map as 
> below, but does anyone know why do I need to do this and will 
> all processors exhibit the same behaviour? I'm using Saxon 9.
> 
> 
>  
> 
> 
> 
> Steven Hentschel
> 
> _________________________________________________________________
> Welcome to the next generation of Windows Live 
> http://www.windowslive.co.uk/get-live

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.