You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by sy...@apache.org on 2005/09/01 15:31:34 UTC
svn commit: r265718 -
/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-field-styling.xsl
Author: sylvain
Date: Thu Sep 1 06:31:31 2005
New Revision: 265718
URL: http://svn.apache.org/viewcvs?rev=265718&view=rev
Log:
Fix bug #35574, thanks to Jean-Baptiste Quenot <jb...@anyware-tech.com>
Modified:
cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-field-styling.xsl
Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-field-styling.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-field-styling.xsl?rev=265718&r1=265717&r2=265718&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-field-styling.xsl (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-field-styling.xsl Thu Sep 1 06:31:31 2005
@@ -139,11 +139,38 @@
</xsl:if>
</xsl:template>
+ <xsl:template name="apos-replace">
+ <xsl:param name="text"/>
+ <xsl:variable name="pattern">'</xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains($text,$pattern)">
+ <xsl:value-of select="substring-before($text,$pattern)"/>
+ <xsl:text>\'</xsl:text>
+ <xsl:call-template name="apos-replace">
+ <xsl:with-param name="text"
+ select="substring-after($text,$pattern)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$text"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
<!--+
|
+-->
- <xsl:template match="fi:validation-message | fi:validation-error">
- <a href="#" class="forms-validation-message" onclick='alert("{normalize-space(.)}");return false;'> ! </a>
+ <xsl:template match="fi:validation-message">
+ <a href="#" class="forms-validation-message">
+ <xsl:attribute name="onclick">
+ <xsl:text>alert('</xsl:text>
+ <xsl:call-template name="apos-replace">
+ <xsl:with-param name="text" select="normalize-space(.)"/>
+ </xsl:call-template>
+ <xsl:text>'); return false;</xsl:text>
+ </xsl:attribute>
+ <xsl:text> ! </xsl:text>
+ </a>
</xsl:template>
<!--+