[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Replace $ with $$

Subject: Replace $ with $$
From: "Michael Lee" <mlee@xxxxxxxxxx>
Date: Fri, 9 Mar 2001 14:58:21 +0800
replace dollar sign in xsl
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:when test="contains(., '$')">
   <xsl:value-of select="concat(substring-before(.,
'$'),'$$',substring-after(., '$'))"/>
  <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>

Thanks in advance.

Michael Lee

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.