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 30228 - [xslt30] Streamability of array constructors
Summary: [xslt30] Streamability of array constructors
Status: NEW
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 Test Suite (show other bugs)
Version: Recommendation
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Abel Braaksma
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-13 16:25 UTC by Michael Kay
Modified: 2019-02-26 00:22 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2018-03-13 16:25:58 UTC
Test case square-array-040 uses the expression

<xsl:copy-of select="[$extraItem, /BOOKLIST/BOOKS/ITEM]?*!PRICE"/>

and expects this to be streamable. Until now, Saxon has been streaming it successfully. But I have now changed my code to match the spec more precisely, and I find that it fails streamability analysis.

The reason is that ยง19.8.8 says that the operands of a square-array-constructor have operand usage navigation, and selecting streamed nodes in a navigation context automatically gives you a free-ranging expression.

As far as I can see, the operand usage (for both square and curly array constructors) should be transmission.
Comment 1 Michael Kay 2018-03-13 16:41:41 UTC
I suspect the reasoning for using "navigation" here is basically that we don't define any machinery for streaming arrays member-by-member. The analysis therefore assumes that an array is assembled as a data structure in memory, and that means that it shouldn't contain any streamed nodes.

A test like square-array-040 is untypical, because if the array is immediately reduced to a sequence by applying the "?*" operator, it can be streamed in the same way as a sequence containing the same nodes; effectively the expression

[$extraItem, /BOOKLIST/BOOKS/ITEM]?*!PRICE

can be rewritten as

($extraItem, /BOOKLIST/BOOKS/ITEM)!PRICE

to make is streamable.

I think we should deem the spec correct here, in which case this and similar tests are incorrect. Changing this to a test suite bug.
Comment 2 Michael Kay 2018-03-13 17:17:25 UTC
I have now modified the Saxon treatment so it essentially rewrites

[A,B,C]?*

as

(A, B, C)

which is essentially what was going on before, and that makes these tests streamable again - but I think they shouldn't be streamable according to the spec.

There's one exception, test square-array-201 says in both the metadata and the comments within the stylesheet that it isn't streamable, but the expected result is successful execution. I think that's incorrect.
Comment 3 Abel Braaksma 2019-02-26 00:22:59 UTC
> but I think they shouldn't be streamable according to the spec.
I know this is a rather old bug, but do you propose we fix the spec? I think it allows processor leeway in making more constructs streamable if it can. But the tests should probably be more rigid and be written according to the rules of the spec (that is: they should not be considered streamable).