This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 10299 - [XSLT 2.0] xsl:number level="any" from="no-match"
Summary: [XSLT 2.0] xsl:number level="any" from="no-match"
Status: CLOSED WORKSFORME
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 2.0 (show other bugs)
Version: Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-05 12:08 UTC by Michael Kay
Modified: 2011-03-24 15:23 UTC (History)
2 users (show)

See Also:


Attachments

Description Michael Kay 2010-08-05 12:08:15 UTC
When xsl:number is used with level="any" and a from pattern, and no node matches the from pattern, the spec is reasonably clear that the root node of the tree should be treated as if it matched the from pattern, and that numbering should therefore be from the root:

"Let matches-from($node) be a function that returns true if and only if the given node $node matches the pattern given in the from attribute, or if $node is the root node of a tree."

However, quite a few tests in the test suite break if you implement this rule as written. An example is numbering18. These tests are written on the assumption that if no node matches the from pattern, then no number is allocated.

Martin Honnen reports on xsl-list that Saxon and Intel are following the behaviour shown in tests such as numbering18, not the behaviour described in the spec. We therefore need to decide whether to endorse the spec as written, or whether to change it to match the behaviour of the tests.

Changing the spec might not be trivial to do, and could end up being messy,  because the definition in question affects all values of "level". My preference would be to change the tests, and regard these products as being in error.

The XSLT 1.0 spec is hopelessly ambiguous in this area. However, it is very likely that these tests were carried forward from 1.0 tests and reflect the behaviour of at least some XSLT 1.0 implementations.
Comment 1 Henry Zongaro 2010-08-16 20:48:14 UTC
I searched through old minutes and mailing list discussions.  I found the minutes from the face-to-face meeting of April 2003[1] where there was a quite explicit decision made by the WG that if no preceding node matches the "from" pattern, counting should begin from the root of the tree.  The wording in the XSLT 1.0 specification was taken into consideration in the discussion.

Of course there's nothing stopping the WG from reversing itself, but I just wanted to point out that it does seem the WG considered the issues.

[1] http://lists.w3.org/Archives/Member/w3c-xsl-wg/2003Apr/0034.html (Member-only link)
Comment 2 Michael Kay 2010-09-24 13:59:48 UTC
The WG decided to confirm that the spec says what the WG intended it to say.

As a result, the following tests have new expected results:

numb41, 44
numbering18, 61, 63, 67, 97
Comment 3 Michael Kay 2010-09-29 13:49:14 UTC
The result of test key246 is also affected