|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xslt replace special characters
At 12:40 PM 11/8/2002, you wrote:
How do you replace characters in xslt. <xsl:template name="replace"> <xsl:param name="string" select="''"/> <xsl:param name="pattern" select="''"/> <xsl:param name="replacement" select="''"/> <xsl:choose> <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)"> <xsl:value-of select="substring-before($string, $pattern)"/> <!-- Use "xsl:copy-of" instead of "xsl:value-of" so that users may substitute nodes as well as strings for $replacement. --> <xsl:copy-of select="$replacement"/> <xsl:call-template name="replace"> <xsl:with-param name="string" select="substring-after($string, $pattern)"/> <xsl:with-param name="pattern" select="$pattern"/> <xsl:with-param name="replacement" select="$replacement"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$string"/> </xsl:otherwise> </xsl:choose> </xsl:template>
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
|

Cart








