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

RE: Cannot output CRLF

Subject: RE: Cannot output CRLF
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 2 May 2006 18:47:16 +0100
excel cr lf
The XML parser is required to normalize CRLF to LF on input; the XSLT
processor only sees LF. The serializer is allowed to output a newline using
any representation that the parser will normalize back to LF, but the
chances are that it will simply use LF. If the document is going to be read
by a conformant XML parser, it doesn't make any difference. It's only when
you want to read it using an inflexible text editor or similar that you get
problems. The answer is to postprocess.

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

 

> -----Original Message-----
> From: Paul Venuti [mailto:venutip@xxxxxxxxxxx] 
> Sent: 02 May 2006 18:29
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Cannot output CRLF
> 
> Hi. I'm trying to output a carriage return followed by a line 
> feed (CRLF) for compatability with a mainframe system I'm 
> working with (don't ask). For some reason, though, I never get the CR.
> 
> To simply the issue, I'm using the following stylesheet:
> 
> Code:
> 
> <?xml version="1.0" ?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
> version="1.0">
> 
> <xsl:output method="text" />
> 
> <xsl:template match="/">
>   <xsl:text>Hello.& # x d; & # x a;</xsl:text> </xsl:template>
> 
> </xsl:stylesheet>
> 
> (I added the extra spaces so those aren't interpreted as 
> breaks by the browser -- in the actual stylesheet, there are 
> no spaces.)
> 
> From all the posts I've seen on this list, this should work. 
> But when I view the resulting file in hex, this is what I get:
> 
> Code:
> 
> 48 65 6C 6C 6F 2E 0A
> 
> So that's H E L L O [LF]. What happened to the CR (0D)? I've 
> tried this with both Saxon 8.6.1 and Xalan 2.7.0 ... same results.
> 
> Any ideas?

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.