Wednesday, October 8, 2008

XSL Whitespace ... Adding a XSL space between elements

I had a problem recently where I could not seperate two elements from my XML with a space. I had an XSL file where I was trying to seperate two elements but you cannot use HTML &signs; in an XSL file (you would think marking them CDATA would work but sadly no.) It was a bugger at first but I finally sorted it out this is how:

<xsl:value-of select="count"></xsl:value-of<>/span<
<xsl:text> </xsl:text>
<span style="max-width: 100px;" ><xsl:value-of select="subjecttrunc"></xsl:value-of>


Yep you see it it is as easy as adding those tags <xsl:text> </xsl:text> with a space between them of course.

Now I just need to solve showing multiple spaces, so far that has eluded me because multiple of these together still results in one space.

No comments: