Buhay Programmer
Dont byte more than you can chew

April 2008 Entries

String.Replace() in XSLT

Here's a sample template that lets you have the String.Replace() functionality in XSLT 1.0. The template "string-replace-all" takes 3 parameters and recursively processes the input text string. text : main string replace : the string fragment to be replaced by : the replacement string <xsl:template name="string-replace-all"> <xsl:param name="text" /> <xsl:param name="replace" /> <xsl:param name="by" /> <xsl:choose> <xsl:when test="contains($text, $replace)"> <xsl:value-of ......