W3C home > Mailing lists > Public > public-qt-comments@w3.org > January 2004

RE: [XPath] Legal vaues for a satisfies expression in a quantifier?

From: Kay, Michael <Michael.Kay@softwareag.com>
Date: Fri, 30 Jan 2004 12:06:34 +0100
Message-ID: <37B64F4BA60E9E4FB9F60929E0598024287826@DAEMSG03.eur.ad.sag>
To: "Roger L. Costello" <costello@mitre.org>, <public-qt-comments@w3.org>

To try and amplify Scott's response, note that OrExpr is an expression
that *might* contain an "or" operator, not an expression that *must*
contain an "or" operator. To simplify the grammar, when you have a
series of rules such as:

OrExpr ::= AndExpr ("or" AndExpr)*
AndExpr ::= ArithExpr (("+"|"-") ArithExpr)*
ArithExpr ::= PathExpr

then every PathExpr is an ArithExpr, and every ArithExpr is an AndExpr,
and every AndExpr is an OrExpr, and therefore you can use a PathExpr
everywhere an OrExpr is allowed, which means you can use it in the
"satisfies" clause of a quantified expression.

Michael Kay



> -----Original Message-----
> From: public-qt-comments-request@w3.org 
> [mailto:public-qt-comments-request@w3.org] On Behalf Of Roger 
> L. Costello
> Sent: 29 January 2004 19:09
> To: public-qt-comments@w3.org; Costello,Roger L.
> Subject: [XPath] Legal vaues for a satisfies expression in a 
> quantifier?
> 
> 
> 
> Hi Folks,
> 
> [If this has already been answered, or this is not the 
> appropriate venue for the question then please direct me to 
> the  appropriate place.]
> 
> In the latest XPath 2.0 spec it defines a quantified expression as
> follows:
> 
> QuantifiedExpr ::= (("some" "$") | ("every" "$")) VarName 
> "in" ExprSingle ("," "$" VarName "in" ExprSingle)* 
> "satisfies" ExprSingle
> 
> And ExprSingle is defined as follows:
> 
>  ExprSingle ::= ForExpr
>               | QuantifiedExpr
>               | IfExpr
>               | OrExpr
> 
> I do not believe that this is correct.  Here is one of the 
> examples that is given in the discussion on quantified
> expressions:
> 
> every $part in //part satisfies $part/@discounted
> 
> The satisfies expression in the example is: $part/@discounted
> 
> Clearly, it is neither a ForExpr, a QuantifiedExpr, an 
> IfExpr, nor an OrExpr.
> 
> In fact, wherever SingleExpr appears in the quantified 
> expression it makes no sense.
> 
> Can someone provide the correct BNF for the quantified 
> expression? /Roger
> 
> 
> 
> 
> 
> 
> 
Received on Friday, 30 January 2004 06:07:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:04 GMT