| | 3 | |
|---|
| | 4 | <!-- search and replace template taken from |
|---|
| | 5 | http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html --> |
|---|
| | 6 | <xsl:template name="replace"> |
|---|
| | 7 | <xsl:param name="string" select="''"/> |
|---|
| | 8 | <xsl:param name="pattern" select="''"/> |
|---|
| | 9 | <xsl:param name="replacement" select="''"/> |
|---|
| | 10 | <xsl:choose> |
|---|
| | 11 | <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)"> |
|---|
| | 12 | <xsl:value-of select="substring-before($string, $pattern)"/> |
|---|
| | 13 | <xsl:copy-of select="$replacement"/> |
|---|
| | 14 | <xsl:call-template name="replace"> |
|---|
| | 15 | <xsl:with-param name="string" select="substring-after($string, $pattern)"/> |
|---|
| | 16 | <xsl:with-param name="pattern" select="$pattern"/> |
|---|
| | 17 | <xsl:with-param name="replacement" select="$replacement"/> |
|---|
| | 18 | </xsl:call-template> |
|---|
| | 19 | </xsl:when> |
|---|
| | 20 | <xsl:otherwise> |
|---|
| | 21 | <xsl:value-of select="$string"/> |
|---|
| | 22 | </xsl:otherwise> |
|---|
| | 23 | </xsl:choose> |
|---|
| | 24 | </xsl:template> |
|---|
| | 25 | |
|---|