SuchiLi
SuchiLi

Reputation: 1

How to wrap XSLT code without breaking lines in the output

I'm using Eclipse IDE to write XSLT code to extract data from XML's to a CSV with a Header line. The issue I have is, if I give a line break in the code to fit the code in to the IDE window the output gives the same line break - I need to have it in a single line in the output (it's a comma delimited CSV).

Example:

Expected Output: A,B,C,D,E

1:<p>
Header line in XSLT:<p>
   A,B,C,D,E <p>
Output:<p>
   A,B,C,D,E
<p>
2:<p>
Header line in XSLT:<p>
   A,B,<p>
   C,D<p>
Output:<p>
   A,B,<p>
   C,D

Upvotes: 0

Views: 181

Answers (1)

Meyer
Meyer

Reputation: 1712

You could try to enclose the text in xsl:text elements. This should work because adjacent text nodes are automatically merged:

<xsl:text>A,B,</xsl:text>
<xsl:text>C,D</xsl:text>

Upvotes: 2

Related Questions