I'm trying to replace line breaks (

) with <br />
. However, I cannot get the actual <br />
tags to show up.
Invocation:
<xsl:variable name="br"><br /></xsl:variable>
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="@SolutionNote" />
<xsl:with-param name="replace" select="'
'" />
<xsl:with-param name="by" select="$br" />
</xsl:call-template>
string-replace-all
is taken from the answer given in this question (pasted here for quick reference):
<xsl:template name="string-replace-all">
<xsl:param name="text" />
<xsl:param name="replace" />
<xsl:param name="by" />
<xsl:choose>
<xsl:when test="$text = '' or $replace = ''or not($replace)" >
<!-- Prevent this routine from hanging -->
<xsl:value-of select="$text" />
</xsl:when>
<xsl:when test="contains($text, $replace)">
<xsl:value-of select="substring-before($text,$replace)" />
<xsl:value-of select="$by" />
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="substring-after($text,$replace)" />
<xsl:with-param name="replace" select="$replace" />
<xsl:with-param name="by" select="$by" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Testing with a string literal instead of $br
confirms that there are indeed things that are being replaced. The line breaks themselves are also gone--just replaced with seemingly nothing. What is the correct way to declare/use the br
variable?