This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

How to preserve whitespace in the stylesheet?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]