Subject: [xsl] Replace $ with $$ From: "Michael Lee" <mlee@xxxxxxxxxx> Date: Fri, 9 Mar 2001 14:58:21 +0800 |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Q on XML 2 XML/plain text, Rosa I-Ting Cheng | Thread | RE: [xsl] Replace $ with $$, Chris Bayes |
[xsl] Q on XML 2 XML/plain text, Rosa I-Ting Cheng | Date | RE: [xsl] [Ann] jd.xslt - a XSLT 1., DPawson |
Month |