[Bug 2500] Predicate list evaluation

http://www.w3.org/Bugs/Public/show_bug.cgi?id=2500

           Summary: Predicate list evaluation
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XPath
        AssignedTo: chamberl@almaden.ibm.com
        ReportedBy: boehme@informatik.uni-leipzig.de
         QAContact: public-qt-comments@w3.org


For my understanding the spec don't clearly specify how predicates of a
predicate list are evaluated. What we have is:
3.2.1
"The value of the step consists of those items that satisfy the predicates."

So i see two possibilities (C be the set of context nodes of a step without
applied predicates):
1) each predicate is applied to C and the intersection of these results will be 
   the result of the step
2) the predicates are applied left to right and the result of one predicate
   evaluation is the context for the following predicate
Both possibilities are equal as long as no positional filter (position(),
first(), last(), numeric item) is used.
The only indication that case 2 is the right one is given in 3.2.4 with the examples
para[@type="warning"][5] and
para[5][@type="warning"]

Furthermore 2.3.4 states
"An implementation is permitted, however, to reorder the predicates to achieve
better performance...". This however could be misleading interpreted as
supporting case 1.

Therefore I would propose to clearly state how predicate lists are to be
evaluated and give a warning/hint in 2.3.4 that reordering of predicates is
dangerous if predicates with references to context positions are included.


Kind regards
Timo

Received on Thursday, 10 November 2005 13:48:42 UTC