descendant-or-self isn't sorted
-------------------------------
Key: XALANJ-2212
URL: http://issues.apache.org/jira/browse/XALANJ-2212
Project: XalanJ2
Type: Bug
Components: XPath
Environment: Windows XP SP 2, JRE 1.4.2_05, Xalan 2.7.1
Reporter: David Landwehr
Priority: Minor
Take the following instance:
<a>
<b>
<c>
<d/>
</c>
</b>
</a>
And make a transformation with the following stylesheet:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
Should Return:b1,c2 =
<xsl:for-each select="/descendant-or-self::*/descendant-or-self::*[
(local-name()='b' and position()=1) or (local-name()='c' and position()=3)]">
<xsl:value-of select="concat(local-name(),
position())"/>,</xsl:for-each>
Should Return: b =
<xsl:value-of
select="local-name(/descendant-or-self::*/descendant-or-self::*[
(local-name()='b' and position()=1) or (local-name()='c' and position()=3)])"/>
Should Return: 4=
<xsl:value-of
select="count(/descendant-or-self::*/descendant-or-self::*)"/>
</xsl:template>
</xsl:stylesheet>
The result should be (which it is when using xsltc):
Should Return:b1,c2 =
b1,c2,
Should Return: b =
b
Should Return: 4=
4
But the result is:
Should Return:b1,c2 =
c1,b2,
Should Return: b =
c
Should Return: 4=
10
It looks like the descendant-or-self::*/descendant-or-self::* isn't sorted and
that the nodes returned from the iterator isn't unique (e.g. that the iterator
believes it returns unique nodes).
--
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]