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 29449 - [xslt 3.0] Streamability of $map($key) and $array($index)
Summary: [xslt 3.0] Streamability of $map($key) and $array($index)
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC All
: 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: 2016-02-11 22:35 UTC by Michael Kay
Modified: 2016-02-19 12:29 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2016-02-11 22:35:05 UTC
In 

19.8.8.10 Streamability of Dynamic Function Calls

It would be useful to explain the effect of these rules on dynamic function calls where the "function" in question is a map or an array.

Intuitively, if we know that the "base expression" (the function) is a map or an array, and the argument is motionless, then the dynamic function call itself is motionless; if we don't know (because the type analysis doesn't tell us), then we can't determine that the expression is guaranteed-streamable, and the user should be advised to write map:get($map, $key) or array:get($array, $index) instead; or perhaps to use the "?" lookup operator if XPath 3.1 is available.
Comment 1 Michael Kay 2016-02-15 16:27:17 UTC
Resolution: add a note to the spec along the following lines:

Note that in a dynamic function call $F($A), the operand usage of $F is inspection, so what is passed to $F has no direct bearing. As for $A, if we know that $F is a map or array, then we know that $A has usage absorption (because the inferred type is xs:anyAtomicType), and therefore passing a streamed node is OK (the result will be consuming), but if we don't know that $F is a map or array, then passing a streamed node will be roaming/free-ranging.

So advice is users is: if you want it to be streamable, make sure $F is declared to be a map or array, or use an alternative construct such as $F?($A) (3.1) or map:get($F, $A).
Comment 2 Michael Kay 2016-02-19 12:29:54 UTC
The spec has been updated along the lines agreed.