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 30036 - [xslt30] Streamability of treat expressions
Summary: [xslt30] Streamability of treat expressions
Status: RESOLVED 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-12-20 13:12 UTC by Michael Kay
Modified: 2017-01-05 22:11 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2016-12-20 13:12:56 UTC
The expression

X treat as document-node(element(X))

has the same streaming difficulties as

X[. instance of document-node(element(X))]

We discuss these difficulties in the analysis for "instance of" expressions (19.8.8.5) but there is no mention under "treat as" expressions (which do not even merit a special section).
Comment 1 Michael Kay 2016-12-20 13:23:27 UTC
I think the rule for the streamability of treat expressions (B treat as T) is:

if the item type of T is document-node(E) where E is a node-test of the form element(N) or schema-element(N) node-test, then roaming and free-ranging

otherwise the posture and sweep of B.

This might seem a bit severe. But it's the same as the result we get for the (essentially) equivalent expression B[. instance of T]. (The instance of expression here is consuming, therefore the predicate is not motionless, therefore the filter expression is roaming and free-ranging.)
Comment 2 Michael Kay 2017-01-05 22:11:31 UTC
The changes were agreed and have been applied.