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/19 17:56:49 UTC

Bug report for Xalan-J: xsl:key not working after empty attribute

 Hello,

  I have found what I think is a bug of Xalan-J (but only when Xalan-J
  is used outside Cocoon, for example from the command line). I'm
  using xalan_1_0_1.

  The bug is about the usage of xsl:key when in the document there are
  "empty" attributes. I will give you an example:

  This is the (standard) command line I'm using:

  java org.apache.xalan.xslt.Process -in bool.ind.xml -xsl hello.xsl -out
  xxx.html

  This is a minimal stylesheet where I can show the bug:

======================

<?xml version="1.0"?>

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

  <xsl:key name="idkey" match="*" use="@id"/>

  <xsl:template match="/">
   <xsl:processing-instruction
name="cocoon-format">type="text/html"</xsl:processing-instruction>
   <html>
    <body>
     <h2><xsl:value-of select="key('idkey','i10')/@id"/></h2>
    </body>
   </html>
  </xsl:template>

</xsl:stylesheet>

======================

And now the minimal XML file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="hello.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>


<X params="x">
 <Y id="i10"/>
</X>

======================

Using the command line shown, with the XML file above I get this output:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?cocoon-format type="text/html"?><html><body><h2>i10</h2></body></html>

If I change the value of the params attribute in an empty value...

======================

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="hello.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>


<X params="">
 <Y id="i10"/>
</X>

======================

Then I get this output:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?cocoon-format type="text/html"?><html><body><h2></h2></body></html>


 Using Cocoon, the bug hides itself.

 
 Please, let me know if this is really a bug.

					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
----------------------------------------------------------------