Thursday, October 22, 2009

XSLT outputing Carriage return/line feed

A couple of years ago, I was trying to use Open Office writer to convert documents to media wiki format using this XSLT file I found. It worked ok, but there was more full featured XSLT here
Anyway, I found that the first XSLT was not putting out the Carriage return linefeed or any linefeed out in it's output. I discovered that I could put &#xA; into the <xsl:value-of select="''"/> statement, i.e. <xsl:value-of select="'&#xA;==='"/> which, for media wiki is the starting === with a line feed in there.

The activasoft way was a bit easier <xsl:text>
===
</xsl:text>

I think its good to know both ways. I know I had to tackle this before, which is why I post this reminder now.

No comments: