[Bug 29355] Modernize sequence filtering

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29355

Michael Kay <mike@saxonica.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mike@saxonica.com

--- Comment #5 from Michael Kay <mike@saxonica.com> ---
The decision not to allow SEQ[2 to 5] was made about 10 years ago so my
recollection of the exact rationale may be faulty. 

The biggest problem with A[B] is its overloading as both a filter expression
and a subscripting expression. To make it work as a filter expression, B must
be evaluated once for each item in A, with that item as the context item. That
rule can't depend on the type of B, because we can't assume static typing.
Hence the convoluted rule whereby A[3] is interpreted as the filter expression
A[position() = 3].

If you extend this kind of logic to handle predicates with a type other than a
single integer, then things get increasingly complicated, because you have to
define how things like A[. to 15] should be interpreted: evaluating the
predicate once for each item in A no longer works.

It's very intuitive what A[2 to 5] should mean, but defining the semantics in a
way that covers all edge cases and still remains comprehensible (and
implementable) for more complex cases proves quite difficult.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Sunday, 10 January 2016 22:11:21 UTC