+++ /dev/null
-<?xml version="1.0"?>
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-<!-- Next function to quote strings for JavaScript (i.e. ' ==> \' -->
-<xsl:template name="jsquote">
- <xsl:param name="s" select="''"/>
- <xsl:param name="news" select="''"/>
- <xsl:param name="times" select="1"/>
- <xsl:choose>
- <xsl:when test="$s = ''"><xsl:value-of select="$news"/></xsl:when>
- <xsl:otherwise>
- <xsl:variable name="char" select="substring($s,1,1)"/>
- <xsl:choose>
- <xsl:when test='$char = "'" and $times = 1'>
- <xsl:call-template name="jsquote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select='concat($news,"\'")'/>
- <xsl:with-param name="times" select="$times"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test='$char = "'" and $times = 2'>
- <xsl:call-template name="jsquote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select='concat($news,"\\\'")'/>
- <xsl:with-param name="times" select="$times"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="jsquote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,$char)"/>
- <xsl:with-param name="times" select="$times"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-</xsl:stylesheet>