[ http://issues.apache.org/jira/browse/XALANJ-1651?page=all ]
Brian Minchau updated XALANJ-1651:
----------------------------------
Version: 2.5Dx
(was: Latest Development Code)
> Error with node sets and [last()] predicate
> -------------------------------------------
>
> Key: XALANJ-1651
> URL: http://issues.apache.org/jira/browse/XALANJ-1651
> Project: XalanJ2
> Type: Bug
> Components: transformation, Xalan-interpretive
> Versions: 2.5Dx
> Environment: Operating System: Other
> Platform: Other
> Reporter: Brian Minchau
> Assignee: Xalan Developers Mailing List
> Attachments: Bug22949Expr.txt
>
> This test was originally posted by Brian Lalonde under bug 15327 which is
> against XSLTC, but it didn't fail with XSLTC. It does however fail for
> Xalan-J interpretive.
> Here is the stylesheet:
> ------------------------------------------
> <?xml version="1.0" ?><?xml-stylesheet type="text/xsl" ?><!-- self-test -->
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method="text" encoding="utf-8" media-type="text/plain"/>
> <xsl:param name="one">first</xsl:param>
> <xsl:param name="two">second</xsl:param>
> <xsl:template match="/">
> <xsl:variable name="params" select="//xsl:param"/>
> <xsl:variable name="params1" select="$params[1]"/>
> <xsl:variable name="expression1"><xsl:value-of select="$params1[last
> ()]"/></xsl:variable>
> <xsl:variable name="expression2"><xsl:value-of select="$params[1][last
> ()]"/></xsl:variable>
> <xsl:text>Testing: </xsl:text>
> <xsl:value-of select="system-property('xsl:vendor')"/><xsl:text> </xsl:text>
> <xsl:value-of select="system-property('xsl:vendor-url')"/><xsl:text>
> </xsl:text>
> <xsl:choose>
> <xsl:when test="$expression1=$expression2">OK</xsl:when>
> <xsl:otherwise>Fail!</xsl:otherwise>
> </xsl:choose>
> <xsl:text>
> </xsl:text>
> </xsl:template>
> </xsl:stylesheet>
> ------------------------------------------
> The same document is used as input (so it acts as XSL and input XML at the
> same
> time). One difference from the original is that I've removed an
> href="test.xml"
> in the xml-stylesheet processing instruction and I've renamed a few things.
> Analysis: When fed as input to itself "params" should take on the list of two
> parameters, "one" and "two". "params1" should take on the first of those,
> just "one". "expression1" should be the last one in "params1", but since
> there is only a single node it is just "one". "expression2" is just
> like "expression1" except that the calculation happens in a single select,
> not
> across 2 selects as it does for expression1. There is a final
> test="$expression1=$expression2" which outputs OK or Fail!
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]