XSLT transformation and Line Breaks
853060Apr 5 2011 — edited Apr 26 2011Hello!
I'm trying to generate a XML similiar to this one:
<test>Line1
Line2</test>
where there's a line break inside a XML tag.
If I assign this to a variable, it works fine: <test>{fn:concat("Line1", fn:codepoints-to-string((13,10)), "Line2")}</test>
But I want to do this using XSLT. I'm using this variable to hold line break chars: <xsl:variable name="cLineEnd" select="' '"/>
But when OSB does the transformation, it replaces these chars by x20 (space) char.
If I do the same transformation using Visual Studio, it works fine. (sorry about the bad names, guys).
The workaround I found is to do all the transformations using XSLT, but having cLineEnd = "##LineBreak##" and then adding another replace step like this:
fn:replace($body/text(), '##LineBreak##', fn:codepoints-to-string((13,10)))
As you can see, not the proper way...
Any ideas?
Thanks in advance!