Hi Joerg, [Oddly enough, I couldn't find the message you're quoting.]
On Saturday, Dec 14, 2002, at 06:09 US/Pacific, Joerg Heinicke wrote:
1. The differences between Cocoon and command line result from the usage of XSLTC in Cocoon.I don't see why Cocoon running in the command line and in the Web environment could affect the XSLTC processor. There shouldn't be any difference in how XSLTC processing happens.
2. Further investigations with Xalan (not XSLTC):So you're saying that Xalan 2.4.1 with the following
<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:template match="xsp:page">
<xsl:apply-templates select="//jpath:if | //jpath:when | //jpath:for-each | //jpath:value-of" mode="compile"/>
</xsl:template>
<xsl:template match="jpath:if | jpath:when | jpath:for-each | jpath:value-of" mode="compile">
<xsl:value-of select="count(key('JPathExprs', concat(@test, @select)))"/>
</xsl:template>
the count() in the last template returns 0, while with the key declaration from the last mail it returns 1. This is only a repetition of the description below.
3. But if you use Xalan (not XSLTC) and the changed key declaration, it works ;-)
<xsl:key name="JPathExprs" match="jpath:if | jpath:when | jpath:for-each
| jpath:value-of" use="concat(@test, @select)"/>
<xsl:template match="jpath:if | jpath:when | jpath:for-each | jpath:value-of" mode="compile">
<xsl:value-of select="count(key('JPathExprs', concat(@test, @select)))"/>
</xsl:template>
will have count() return 1?
Yes, generate-id() is a better solution. I've changed to using it in my local copy.Joerg Heinicke wrote:[...]
At the end something for the theory:
On <jpath:when test="check and firstName = ''">
and <jpath:when test="check and firstName">
the templates are applied, because @test is different. But after the translating the expressions will result in the same variable name, won't they? Wouldn't it be better to use something like >> generate-id()?
Thanks for taking the time to investigate this one!
Regards,
Ovidiu
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]