Project

Profile

Help

Bug #2138

closed

current() apparently referring to context node in xsl:number/@count

Added by Evan Lenz about 10 years ago. Updated about 10 years ago.

Status:
Rejected
Priority:
Low
Assignee:
-
Category:
XSLT conformance
Sprint/Milestone:
-
Start date:
2014-09-02
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

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

test.xml (64 Bytes) test.xml Evan Lenz, 2014-09-02 22:41
test.xsl (354 Bytes) test.xsl Evan Lenz, 2014-09-02 22:41
test2.xsl (393 Bytes) test2.xsl Evan Lenz, 2014-09-02 22:41
Actions #1

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!

Actions #2

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

Also available in: Atom PDF