Frederic
Frederic

Reputation: 2065

Outputting carriage return from variable set in XSLT

I know it's been asked numerous times and while my question might seem to be a duplicate, I can't make the list of solutions work. How come that doesn't seem to add "\r\n" or CRLF in my output file ?

<xsl:variable name="Newline">&#xD;&#xA;</xsl:variable>
...
<xsl:text>UpperLine</xsl:text>
<xsl:value-of select="$Newline"/>
<xsl:text>LowerLine</xsl:text>

Even when looking a tthe hexadcimal representation of the file, I can't see the 0d0a equivalent of CRLF (I can only see the ones at the end)

enter image description here

I've also tried this with no success either :

<xsl:value-of select="concat('New Line', '&#13;&#10;')"/>

Upvotes: 2

Views: 1296

Answers (1)

Rupesh_Kr
Rupesh_Kr

Reputation: 3435

change your variable declaration to this:

<xsl:variable name="Newline"><xsl:text>&#xA;</xsl:text></xsl:variable>

Upvotes: 6

Related Questions