Project

Profile

Help

Bug #2478

closed

accumulator-after gives wrong state

Added by Markus Lauer over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
XSLT conformance
Sprint/Milestone:
Start date:
2015-10-20
Due date:
% Done:

100%

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

Description

the function accumulator-after gives the state of the wrong context nodes on last sibling nodes.

To reproduce apply stylesheet sample.xslt on input file sample.xml.

It gives result.xml, I would expect expected.xml.


Files

sample.xml (23 Bytes) sample.xml Markus Lauer, 2015-10-20 23:37
sample.xslt (861 Bytes) sample.xslt Markus Lauer, 2015-10-20 23:38
result.xml (428 Bytes) result.xml Markus Lauer, 2015-10-20 23:39
expected.xml (407 Bytes) expected.xml Markus Lauer, 2015-10-20 23:39
Actions #1

Updated by Michael Kay over 8 years ago

Sorry for the delay in responding. Many thanks for reporting this.

I think Saxon 9.6 is implementing the rule as it appeared in the December 2013 draft of the spec (http://www.w3.org/TR/2013/WD-xslt-30-20131212/) which stated:

Each node is labeled with a pre-descent value for the accumulator, which is the value of the accumulator variable immediately AFTER processing the first visit to that node, and with a post-descent value for the accumulator, which is the value of the accumulator variable immediately BEFORE processing the second visit.

This rule was changed in the October 2014 draft.

I'm not entirely sure of the history, but this bug entry:

https://www.w3.org/Bugs/Public/show_bug.cgi?id=26737

(in Sept 2014) observed that accumulator-after returned the value BEFORE processing the second visit, and we may well have made the change in response to discussion of that bug, in which case if changed very late before the Oct 2014 draft (and Saxon 9.6) came out.

More pertinently, it appears that the change has still not been implemented in Saxon 9.7 (the development branch). I will certainly ensure, now it has been brought to my notice, that this is fixed for 9.7. I will have to consider whether to make the change for 9.6 (a) based on how difficult it is, and (b) after thinking about impact on compatibility: when the spec changes after a release comes out, we generally leave implementation of the change until the next major release, rather than retrofitting it in maintenance releases.

Actions #2

Updated by Michael Kay over 8 years ago

  • Status changed from New to In Progress

I think I've made the required change (more testing needed) (on the non-streaming path only) and this gives the result

which looks right to me, though it doesn't seem to match your expected result.

Actions #3

Updated by Michael Kay over 8 years ago

  • Found in version changed from Saxon-PE 9.6.0-7 to 9.6

It seems that on the 9.7 branch, the streaming implementation was producing the correct result according to the current spec, whereas the non-streaming implementation used the old spec. Rather remarkably, change the implementation to work this way did not break any other existing tests. I have now fixed the 9.7 code and will turn my attention to 9.6.

Actions #4

Updated by Michael Kay over 8 years ago

  • Status changed from In Progress to Resolved

The same is true for 9.6: it's producing the correct result when streaming, but not in the non-streaming case. So I'm applying the same fix.

Patch committed to com.saxonica.xslt3.instruct#search; regression tested against the 9.6 snapshot of the accumulator test-set. (9.6 is failing many of the current tests for accumulators, because of unrelated spec changes, or because the tests have changed to use features that weren't implemented in 9.6).

Actions #5

Updated by Michael Kay over 8 years ago

For the record, I have submitted the test case as part of the W3C XSLT3 test suite, test accumulator-051 (non-streaming), and accumulator-051s (streaming)

Actions #6

Updated by O'Neil Delpratt over 8 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in version set to 9.6.0.8

Bug fix applied in the Saxon 9.6.0.8 maintenance release

Actions #7

Updated by O'Neil Delpratt over 8 years ago

  • Applies to branch 9.6 added
  • Fix Committed on Branch 9.6 added
  • Fixed in Maintenance Release 9.6.0.8 added
Actions #8

Updated by O'Neil Delpratt over 8 years ago

  • Sprint/Milestone set to 9.6.0.8

Please register to edit this issue

Also available in: Atom PDF