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]

RE: Replace $ with $$


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


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