DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23851>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23851

Xalan-J interpretive problems with [last()] and [last() -1]

           Summary: Xalan-J interpretive problems with [last()] and [last()
                    -1]
           Product: XalanJ2
           Version: CurrentCVS
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xalan
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


This information is copied from bug 22949 but it seems to be a different 
problem than the one originally reported in 22949. This bug is only against 
Xalan-J interpretive, not XSLTC.

[last()] predicate has problem for Xalan interpretive for the followingng test 
case:
XML file:
-----------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<doc>
        <num>1</num>
        <num>2</num>
        <num>3</num>
</doc>
-----------------------------------------------------

XSLT file:
-----------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
    <xsl:variable name="a" select="doc/num"/>   
     
<xsl:template match="doc">  
  <out><xsl:text>
</xsl:text>
    <xsl:value-of select="num[last()]"/><xsl:text>
</xsl:text>
    <xsl:value-of select="num[last()-1]"/><xsl:text>
</xsl:text>
    <xsl:value-of select="num[last()-1][last()]"/><xsl:text>
</xsl:text>
    <xsl:value-of select="$a[last()-1][last()]" /><xsl:text>
</xsl:text>
  </out> 
</xsl:template>
</xsl:stylesheet>
-----------------------------------------------

Output using Xalan interpretive failed to evaluate double predicate [last()-1]
[last()]:
------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<out>
3
2
2

</out>
------------------------------------------------------

Correct output is:
------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<out>
3
2
2
2
</out>
------------------------------------------------------

Christine Li's patch in bug 22949 fixed a similar problem with the testcase for 
XSLTC and also fixed bug 15327 but did not fix the problem above.

Regards,
Brian Minchau

Reply via email to