This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
How to preserve whitespace in the stylesheet?
- To: "Xsl-List" <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] How to preserve whitespace in the stylesheet?
- From: "Robert Nicholson" <robert at elastica dot com>
- Date: Wed, 20 Dec 2000 18:48:08 +0700
- Reply-To: xsl-list at lists dot mulberrytech dot com
I have the following template rule
<xsl:template name="separated-list">
<xsl:param name="nodes"/>
<xsl:param name="separator"/>
<xsl:for-each select="$nodes">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">
<xsl:value-of select="$separator"/>
</xsl:if>
</xsl:for-each>
</xsl:template>
Sometimes separator is "," and other times it's a <BR>
or that's the plan.
However, I'm getting hung up on XSLT stripping the whitespace from the tree
obtained from the stylesheet.
How can I ensure that the whitespace in this case in preserved?
I call this rule thus
<xsl:call-template name="separated-list">
<xsl:with-param name="nodes" select="note"/>
<xsl:with-param name="separator">
<BR/>
</xsl:with-param>
</xsl:call-template>
also, where is it documented exactly why you cannot do
<xsl:text><BR/><xsl:text>?
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list