| | 1070 | <!--==== UTILITY TEMPLATES ====--> |
|---|
| | 1071 | |
|---|
| | 1072 | <!-- search and replace template taken from |
|---|
| | 1073 | http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html --> |
|---|
| | 1074 | <xsl:template name="replace"> |
|---|
| | 1075 | <xsl:param name="string" select="''"/> |
|---|
| | 1076 | <xsl:param name="pattern" select="''"/> |
|---|
| | 1077 | <xsl:param name="replacement" select="''"/> |
|---|
| | 1078 | <xsl:choose> |
|---|
| | 1079 | <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)"> |
|---|
| | 1080 | <xsl:value-of select="substring-before($string, $pattern)"/> |
|---|
| | 1081 | <xsl:copy-of select="$replacement"/> |
|---|
| | 1082 | <xsl:call-template name="replace"> |
|---|
| | 1083 | <xsl:with-param name="string" select="substring-after($string, $pattern)"/> |
|---|
| | 1084 | <xsl:with-param name="pattern" select="$pattern"/> |
|---|
| | 1085 | <xsl:with-param name="replacement" select="$replacement"/> |
|---|
| | 1086 | </xsl:call-template> |
|---|
| | 1087 | </xsl:when> |
|---|
| | 1088 | <xsl:otherwise> |
|---|
| | 1089 | <xsl:value-of select="$string"/> |
|---|
| | 1090 | </xsl:otherwise> |
|---|
| | 1091 | </xsl:choose> |
|---|
| | 1092 | </xsl:template> |
|---|
| | 1093 | |
|---|