Replace $ with $$
Hi, I am working on an XSLT stylesheet which transforms XHTML into WML. However, a dollar sign is used to indicate the beginning of a variable in WML. In order to represent a dollar sign character, a sequence of two dollar signs must be used. Right now I am using the following template to replace $ with $$, but I know that it will only apply to the first $ in the text node. How can I modify the following template to make the processor replace all the $ within the same text node? <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
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format