This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
A.1.1 grammar-note: occurrence-indicators [See a later comment for suggested alternate wording.] "Any occurrence of '+' and '*', as well as '?', following a sequence type is assumed to be an occurrence indicator." Even when the only possible derivation says it's not an occurrence indicator? So in 4 treat as item() + 5 the '+' is assumed to be an occurrence indicator, which would then lead to a syntax error? Probably yes, but might be good to say so.
> Even when the only possible derivation says it's not an occurrence > indicator? So in > 4 treat as item() + 5 > the '+' is assumed to be an occurrence indicator, which would then lead to a > syntax error? Probably yes, but might be good to say so. Yes, and it does say so. But it could be clarified, along with an example.
Here is a proposed rewording to make clearer that the priority rule applies in all cases, not just cases of ambiguity. As written, the grammar in A.1 is ambiguous for some forms using the '+' and '*' Kleene operators. The ambiguity is resolved as follows: these operators are tightly bound to the SequenceType expression, and have higher precedence than other uses of these symbols. Any occurrence of '+' and '*', as well as '?', following a sequence type is assumed to be an occurrence indicator. That is, a "+", "*", or "?" immediately following an ItemType MUST be an OccurrenceIndicator. Thus, "4 treat as item() + - 5" MUST be interpreted as (4 treat as item()+) - 5, taking the '+' as an OccurrenceIndicator and the '-' as a subtraction operator. To force the interpretation of "+" as an addition operator (and the corresponding interpretation of the "-" as a unary minus), parentheses may be used: the form "(4 treat as item()) + -5" surrounds the SequenceType expression with parentheses and leads to the desired interpretation. This rule has as a consequence that certain forms which would otherwise be legal and unambiguous are not recognized: in "4 treat as item() + 5", the "+" is taken as an OccurrenceIndicator, and not as an operator, which means this is not a legal expression.
(In reply to comment #2) > Here is a proposed rewording to make clearer that the > priority rule applies in all cases, not just cases of > ambiguity. I've adapted your rewording.
A joint meeting of the Query and XSLT working groups considered this comment on July 20, 2005. The WGs agreed to resolve these editorial issues as listed in my previous comment. If you do not agree with this resolution, please add a comment explaining why. If you wish to appeal the WG's decision to the Director, then change the Status of the record to Reopened. If we do not hear from you in the next two weeks, we will assume you agree with the WG decision.
Closing bug because commenter has not objected to the resolution posted and more than two weeks have passed.