Bug #2138
closedcurrent() apparently referring to context node in xsl:number/@count
0%
Description
I ran into this in a project for my client.
I think this should be the current() node in XSLT processing, no?
This:
<xsl:number count="*[@type eq current()/@type]" level="any"/>
yields a different result than this:
<out:variable name="type" select="@type"/>
<out:number count="*[@type eq $type]" level="any"/>
To reproduce, run test.xsl against test.xml (attached).
test.xsl has the wrong behavior, I believe (outputs "3")
test2.xsl has the correct behavior (outputs "2")
Files
Updated by Evan Lenz about 10 years ago
I could be completely wrong about whether this is incorrect behavior. It wasn't immediately obvious to me from looking at the Recommendation. If so, sorry for the noise!
Updated by Michael Kay about 10 years ago
- Status changed from New to Rejected
I think Saxon is behaving correctly. From section 16.6.1 of the XSLT 2.0 spec:
If the current function is used within a pattern, its value is the node that is being matched against the pattern.
So it's not the context item for evaluation of xsl:number as supposed; it's a different value for each node being tested.
Michael Kay
Saxonica
Please register to edit this issue