Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] Cannot output CRLF

From: "Michael Kay" <mike@------------>
To:
Date: 5/2/2006 5:48:00 PM
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: [xsl] 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?


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent