You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Claudio Sacerdoti Coen <sa...@students.cs.unibo.it> on 2000/06/20 15:04:04 UTC

Bug report for Xalan-J: xsl:key and xsl:import

 Hi guys,

 I have found another bug concerning xsl:key and xsl:import,
 but I have not been able to create a minimal bugged example.

 This is the problem: in an stylesheet named annotatedcont.xsl I declare
 some keys

 e.g.:

<xsl:key name="id" use="@id"
match="LAMBDA|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX|Definition|Axiom|CurrentProof|InductiveDefinition|Variable"/>

 In the same stylesheet I use the declared keys

 e.g.:

<xsl:template match="node">
 <xsl:variable name="id" select="@id"/>
 <xsl:apply-templates select="key('id',$id)"/>
</xsl:template>

 When I run the processor I get the waited results (key() returns the
  right element).

 Then I have this very simple stylesheet: 

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="annotatedcont.xsl"/>
</xsl:stylesheet>

 When I run the processor using the above stylesheet I don't get the
 same results as before: key() never returns any element. I think
 that the keys declaration has been lost somehow.

 If I try this (I replicate the keys declarations in the importing
 stylesheets)...

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="annotatedcont.xsl"/>
<xsl:key name="id" use="@id"
match="LAMBDA|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX|Definition|Axiom|CurrentProof|InductiveDefinition|Variable"/>
</xsl:stylesheet>

 ... then I obtain the expected results.

 Sadly, this does not happen with simple examples. If you can not figure out
 what the problem is, I'll send to you the whole stylesheets (thousands of
 lines ;-)

						Thanks in advance,
                                                      C.S.C.
-- 
----------------------------------------------------------------
Real name: Claudio Sacerdoti Coen
Undergraduate Computer Science Student at University of Bologna
E-mail: sacerdot@cs.unibo.it
http://caristudenti.cs.unibo.it/~sacerdot
----------------------------------------------------------------