This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Replace $ with $$
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Replace $ with $$
- From: "Chris Bayes" <Chris at Bayes dot co dot uk>
- Date: Fri, 9 Mar 2001 15:11:25 -0000
- Reply-To: xsl-list at lists dot mulberrytech dot com
Micheal,
Just do it again
<xsl:template match="text()">
<xsl:choose>
<xsl:when test="contains(., '$')">
<xsl:call-template name="doubleYourMoney">
<xsl:with-param name="str" select="." />
</xsl:when>
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="doubleYourMoney">
<xsl:param name="str" />
<xsl:choose>
<xsl:when test="contains(., '$')">
<xsl:value-of select="concat(substring-before(.,'$'),'$$')" />
<xsl:call-template name="doubleYourMoney">
<xsl:with-param name="str" select="substring-after(., '$')" />
</xsl:when>
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
</xsl:choose>
</xsl:template>
Ciao Chris
XML/XSL Portal
http://www.bayes.co.uk/xml
><xsl:template match="text()">
> <xsl:choose>
> <xsl:when test="contains(., '$')">
> <xsl:value-of select="concat(substring-before(.,
>'$'),'$$',substring-after(., '$'))"/>
> </xsl:when>
> <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
> </xsl:choose>
></xsl:template>
>
>
>Thanks in advance.
>
>Michael Lee
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list