This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
4.8.1 FLWOR expressions Norm [[ FLWORClause ]]_FLWOR(Expr) I don't understand why you're using a parameterized []-form. I can see how you might need it if you were normalizing the 4.8 syntax, but since you're assuming an easier syntax, the parameter shouldn't be necessary. If we define FLWORExpr_or_return ::= FLWORExpr | "return" Expr (find a better name if you like) then we can express the assumed EBNF as: FLWORExpr ::= (ForClause | LetClause | WhereClause | OrderByClause) FLWORExpr_or_return Then you can: (a) drop Norm / rule (2|3) (b) recast rule (4|5|6) (and 4.8.4 / Norm / rule 1) as non-parameterized rules: rule 4: [[ <one many-variable ForClause> FLWORExpr_or_return ]]_Expr == <many single-var Forclauses> return [[ FLWORExpr_or_return ]]_Expr rule 5: (very similar) rule 6: [[ where Expr FLWORExpr_or_return ]]_Expr == if ( [[ Expr ]]_Expr ) then [[ FLWORExpr_or_return ]]_Expr else () 4.8.4 / Norm / rule 1: [[ stable? order by OrderSpecList FLWORExpr_or_return ]]_Expr == [[ OrderSpecList ]]_OrderSpecList return [[ FLWORExpr_or_return ]]_Expr (c) provide a "base case" rule: [[ return Expr ]]_Expr == [[ Expr ]]_Expr
This proposed change looks editorial to me. It looks like a valuable simplification to the existing rules. - Jerome
The WGs have decided to reclassify that comment as editorial. The specific solution is left to the discretion of the editors, considering the solution proposed by the commenter. - Jerome Simeon On behalf of the XML Query and XSL WGs
Fixed as suggested. This is a great simplification for that part of the spec. - Jerome
The 2006-06 CR has a few errors relative to my suggestion: In Norm / rule (1|2), *above* the '==', [[ FormalReturnClause ]]_Expr should be just FormalReturnClause In Norm / rule 1, below the '==', after [[ Exprn ]]_Expr insert "return". In Norm / rule 2, below the '==', in return Expr [[ FormalReturnClause ]]_Expr delete the first 'Expr'. Also: You replaced my suggested symbol name 'FLWORExpr_or_return' with 'FormalReturnClause', which I don't think is an improvement. It would be a good name for the "return" Expr phrase (if that needed a name), so isn't that great for the more general FormalFLWORExpr | ("return" Expr) How about 'FormalInnerFLWORExpr' or 'FormalFLWORExprInner'? In [66 (Formal)] and throughout 4.8.*, each 'Expr' should really be an 'ExprSingle' (not including 'Expr' in []_Expr subscripts).
Corrected the errors, but left the grammar and non-terminals unchanged. - Jerome