Project

Profile

Help

Bug #3428

closed

Streamed xsl:iterate fails to xsl:break when processing grounded consuming sequence

Added by Michael Kay over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Streaming
Sprint/Milestone:
-
Start date:
2017-09-05
Due date:
% Done:

100%

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

Description

See new test case si-iterate-039. Reported on saxon-help mailing list by David Rudel. My initial response:

I've reproduced the problem.

I don't know if your source document had nested 'a' elements: mine did, and the logic certainly needs to cater for the possibility. Because a elements can be nested, the code for //a/snapshot needs to be capable of building more than one snapshot concurrently. Technically, these could be delivered in any order, because the document ordering of nodes in different trees is implementation-defined; but because the logic is shared with other functions, I think Saxon delivers the snapshots in a way that respects the document order of the original 'a' elements. This means that the snapshot for an outer 'a' element is buffered, and is only despatched to the output stream AFTER the snapshots of any descendant 'a' elements have been despatched.

I think what is happening here is that the buffering needed to deliver snapshots in the correct order is interfering with the mechanism used to implement xsl:break. The xsl:break instruction delivers a "pseudo-item" to the result of the xsl:iterate, and the control logic detects this pseudo-item and stops further input being processed. I suspect that the pseudo-item is being buffered and therefore not detected.

Actions #1

Updated by Michael Kay over 6 years ago

On closer study, the explanation is simpler: it seems xsl:break does not work when xsl:iterate is processing a sequence that is consuming but grounded. Internally, the grounded items in the sequence are processed using ItemFeed.processItem() rather than start/endSelectedParentNode(), and the processItem logic is not checking for the special value in the context that indicates xsl:break has been executed.

Actions #2

Updated by Michael Kay over 6 years ago

  • Status changed from New to Resolved
  • Fix Committed on Branch 9.8 added

Patch committed on the 9.8 branch (class IterateAction); marking as resolved.

Actions #3

Updated by Michael Kay over 6 years ago

  • Subject changed from Streamed xsl:iterate fails to xsl:break when processing overlapping snapshots to Streamed xsl:iterate fails to xsl:break when processing grounded consuming sequence
Actions #4

Updated by O'Neil Delpratt over 6 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.8.0.5 added

Bug fix applied in the Saxon 9.8.0.5 maintenance release.

Please register to edit this issue

Also available in: Atom PDF