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 27960 - [XSLT30] Grounded filter expressions appear to be roaming and free-ranging in the analysis
Summary: [XSLT30] Grounded filter expressions appear to be roaming and free-ranging in...
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Last Call drafts
Hardware: PC Windows NT
: 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: 2015-02-04 19:52 UTC by Abel Braaksma
Modified: 2015-02-26 21:34 UTC (History)
0 users

See Also:


Attachments

Description Abel Braaksma 2015-02-04 19:52:29 UTC
In section 19.8.7.8 Streamability of Filter Expressions, a filter expression B[P] is considered in situations (1) when B is crawling, (2) when P is motionless and otherwise, the rules state that it is roaming and free-ranging.

These rules seem to be incomplete. 

Consider $doc[child::foo]. $doc is a VarRef, which is grounded by default (except in functions). The expression should therefor be grounded and motionless.

I think it would work if we change:

"2. If P is motionless, then the posture and sweep of B;", 

such that we make sure that P is assessed with the context posture set to the posture of B, in which case $doc, which has grounded posture, would yield child::foo in the example above as motionless.

Alternatively or in addition, we could simply add a rule: "If B is grounded, B[P] is grounded and motionless".

In fact, it looks like we don't say at all what the context posture is in cases of filter expressions. And rule 5 of 19.8.7.7 Streamability of Axis Steps doesn't say it either for predicates in axis steps.
Comment 1 Michael Kay 2015-02-05 17:00:53 UTC
In your example, the predicate child::foo is motionless, because the context posture is grounded. So I think there is no bug.
Comment 2 Abel Braaksma 2015-02-05 17:26:55 UTC
I think the problem lies in the fact that it is unclear that P should be assessed with context posture of B. In (some?) other situations, we write stuff like (example from 19.8.7.5 Streamability of Simple Mapping Expressions):

"The posture and sweep of the expression are the posture and sweep of the right-hand operand, assessed with a context posture and type set to the posture and type of the left-hand operand."

I'm not sure if a change is needed, assuming this information is provided elsewhere, but it is not very clear that one need to analyze P this way (though intuitively one could say it is).
Comment 3 Michael Kay 2015-02-06 18:31:21 UTC
The WG agreed that the spec is correct but that some clarification would be helpful, for example a note under the streamability of filter expressions as to how the context posture for the predicate is determined, and the consequence that if the base expression is grounded then the whole expression is typically grounded.
Comment 4 Michael Kay 2015-02-26 21:34:09 UTC
A suitable clarification has been added to the section on streamability of filter expressions, as suggested.