ovidiu 2002/12/16 23:26:15 Modified: src/java/org/apache/cocoon/components/language/markup/xsp/java jpath.xsl Log: Applied fixes as suggested by Joerg Heinicke <[EMAIL PROTECTED]> to solve Xalan 2.4.1 and XSLTC problems with XSLT key definitions. Revision Changes Path 1.6 +14 -10 xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/jpath.xsl Index: jpath.xsl =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/jpath.xsl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- jpath.xsl 20 Nov 2002 13:20:41 -0000 1.5 +++ jpath.xsl 17 Dec 2002 07:26:15 -0000 1.6 @@ -3,7 +3,12 @@ <!-- Author: Ovidiu Predescu "[EMAIL PROTECTED]" + With fixes for Xalan 2.4.1 and XSLTC from Joerg Heinicke + "[EMAIL PROTECTED]" + Date: February 15, 2002 + + XSP logicsheet for the control flow layer. --> <xsl:stylesheet @@ -12,10 +17,9 @@ xmlns:jpath="http://apache.org/xsp/jpath/1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - <xsl:key name="JPathExprs" match="jpath:if" use="@test"/> - <xsl:key name="JPathExprs" match="jpath:when" use="@test"/> - <xsl:key name="JPathExprs" match="jpath:for-each" use="@select"/> - <xsl:key name="JPathExprs" match="jpath:value-of" use="@select"/> + <xsl:key name="JPathExprs" + match="jpath:if | jpath:when | jpath:for-each | jpath:value-of" + use="concat(@test, @select)"/> <xsl:template match="xsp:page"> <xsp:page> @@ -39,11 +43,11 @@ Object __jxpathResult; // Generate the compiled representation of the JXPath // expressions used by this page. - <xsl:apply-templates - select="(//jpath:if | //jpath:when) - [generate-id(.) = generate-id(key('JPathExprs', @test)[1])] - | (//jpath:for-each | //jpath:value-of) - [generate-id(.) = generate-id(key('JPathExprs', @select)[1])]" + <xsl:apply-templates select=" + //jpath:if [generate-id(.) = generate-id(key('JPathExprs', @test))] + | //jpath:when [generate-id(.) = generate-id(key('JPathExprs', @test))] + | //jpath:value-of[generate-id(.) = generate-id(key('JPathExprs', @select))] + | //jpath:for-each[generate-id(.) = generate-id(key('JPathExprs', @select))]" mode="compile"/> </xsp:init-page> @@ -73,7 +77,7 @@ <xsl:template name="get-var-name"> <xsl:param name="expr"/> - jxpath_<xsl:value-of select="translate($expr, " 	

~`!@%^*()-+=[]{}\|,./?><'", '')"/> + jxpath_<xsl:value-of select="generate-id(key('JPathExprs', $expr))"/> </xsl:template> <xsl:template match="jpath:if">
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]