You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2003/10/10 20:43:49 UTC

DO NOT REPLY [Bug 22949] - Error with node sets and [last()] predicate

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=22949>.
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=22949

Error with node sets and [last()] predicate





------- Additional Comments From jycli@ca.ibm.com  2003-10-10 18:43 -------
[last()] predicate has problem for both Xalan interpretive and XSLTC in the 
following 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>

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


2
</out>