| 8255 | | <!--==== Utility Templates ====--> |
|---|
| 8256 | | |
|---|
| 8257 | | <xsl:template name="escapeApos"> |
|---|
| 8258 | | <xsl:param name="str"/> |
|---|
| 8259 | | <xsl:variable name="apos" select='"'"'/> |
|---|
| 8260 | | <xsl:choose> |
|---|
| 8261 | | <xsl:when test="contains($str, $apos)"> |
|---|
| 8262 | | <xsl:value-of select="substring-before($str, $apos)" /> |
|---|
| 8263 | | <xsl:text>\'</xsl:text> |
|---|
| 8264 | | <xsl:call-template name="escapeApos"> |
|---|
| 8265 | | <xsl:with-param name="str" select="substring-after($str, $apos)" /> |
|---|
| 8266 | | </xsl:call-template> |
|---|
| 8267 | | </xsl:when> |
|---|
| 8268 | | <xsl:otherwise> |
|---|
| 8269 | | <xsl:value-of select="$str" /> |
|---|
| 8270 | | </xsl:otherwise> |
|---|
| 8271 | | </xsl:choose> |
|---|
| 8272 | | </xsl:template> |
|---|
| 8273 | | |
|---|
| 8274 | | <!-- search and replace template taken from |
|---|
| 8275 | | http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html --> |
|---|
| 8276 | | <xsl:template name="replace"> |
|---|
| 8277 | | <xsl:param name="string" select="''"/> |
|---|
| 8278 | | <xsl:param name="pattern" select="''"/> |
|---|
| 8279 | | <xsl:param name="replacement" select="''"/> |
|---|
| 8280 | | <xsl:choose> |
|---|
| 8281 | | <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)"> |
|---|
| 8282 | | <xsl:value-of select="substring-before($string, $pattern)"/> |
|---|
| 8283 | | <xsl:copy-of select="$replacement"/> |
|---|
| 8284 | | <xsl:call-template name="replace"> |
|---|
| 8285 | | <xsl:with-param name="string" select="substring-after($string, $pattern)"/> |
|---|
| 8286 | | <xsl:with-param name="pattern" select="$pattern"/> |
|---|
| 8287 | | <xsl:with-param name="replacement" select="$replacement"/> |
|---|
| 8288 | | </xsl:call-template> |
|---|
| 8289 | | </xsl:when> |
|---|
| 8290 | | <xsl:otherwise> |
|---|
| 8291 | | <xsl:value-of select="$string"/> |
|---|
| 8292 | | </xsl:otherwise> |
|---|
| 8293 | | </xsl:choose> |
|---|
| 8294 | | </xsl:template> |
|---|
| 8295 | | |
|---|