</xsl:choose>\r
</xsl:template>\r
\r
+ <xsl:template name="escapesinglequotes">\r
+ <xsl:param name="arg1"/>\r
+ <xsl:variable name="apostrophe">'</xsl:variable>\r
+ <xsl:choose>\r
+ <!-- this string has at least on single quote -->\r
+ <xsl:when test="contains($arg1, $apostrophe)">\r
+ <xsl:if test="string-length(normalize-space(substring-before($arg1, $apostrophe))) > 0"><xsl:value-of select="substring-before($arg1, $apostrophe)" disable-output-escaping="yes"/>''</xsl:if>\r
+ <xsl:call-template name="escapesinglequotes">\r
+ <xsl:with-param name="arg1"><xsl:value-of select="substring-after($arg1, $apostrophe)" disable-output-escaping="yes"/></xsl:with-param>\r
+ </xsl:call-template>\r
+ </xsl:when>\r
+ <!-- no quotes found in string, just print it -->\r
+ <xsl:when test="string-length(normalize-space($arg1)) > 0"><xsl:value-of select="normalize-space($arg1)"/></xsl:when>\r
+ </xsl:choose>\r
+ </xsl:template>\r
+\r
<!--macro to pull out function parameter names so we can provide a pretty arg list prefix for each function -->\r
<xsl:template name="listparams">\r
<xsl:param name="func" />\r
<xsl:if test="count(paramdef/parameter) > 0">args: </xsl:if>\r
<xsl:for-each select="paramdef">\r
<xsl:choose>\r
- <xsl:when test="count(parameter) > 0"> \r
- <xsl:value-of select="parameter" />\r
- </xsl:when>\r
+ <xsl:when test="count(parameter) > 0"> \r
+ <xsl:call-template name="escapesinglequotes">\r
+ <xsl:with-param name="arg1" select="parameter"/>\r
+ </xsl:call-template>\r
+ </xsl:when>\r
</xsl:choose>\r
<xsl:if test="position()<last()"><xsl:text>, </xsl:text></xsl:if>\r
</xsl:for-each>\r