Add a Carriage Return to the Output of an XSL Transformation

Posted by dsrekab on Stack Overflow See other posts from Stack Overflow or by dsrekab
Published on 2010-05-28T19:29:38Z Indexed on 2010/05/28 19:32 UTC
Read the original article Hit count: 290

Filed under:
|

I am trying to use XSLT to convert an XML document to a text file and the text of the document looks fine. However, I need to add a carriage return after the end of each line (NOT A CRLF) and I seem to be failing in every attempt. I have tried adding just a CR at the end of the line like this:

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

I have tried changing my media-type to string, I have tried to add the disable-output-escaping attribute to the text element, but it always adds a CRLF.

This is on a Windows OS and I know that Windows uses CRLF for a new line, but I would have thought you could override that if you said to specifically use only the CR or the LF (e.g. VB.net's VBCR or VBLF). Does anyone know if it is possible to only output a CR with XSLT?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about xslt

Related posts about carriage-return