This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
>cat ./Queries/XQuery/ParenthesizedExpressions/parenthesized-expr-03.xq (: Name: parenthesized-expr-03 :) (: Description: Parenthesized vacuous expression. :) (: insert-start :) declare variable $input-context external; (: insert-end :) for $var in ( for $var in $input-context/works[1]/employee[1]/hours[1] return () ) return $var Using vacuous expression definition of XQUF AS IS, we can only infer that the inner FLWOR clause is vacuous expression because () is used as return value. Implementation may or may not be able to infer the outer FLWOR clause is vacuous expression depending on how sophisticated the static analysis is. If we use the vacuous expression defintion of XQUF AS IS, then we can not infer that the outer FLWOR clause is vacuous expression. However, I think the intent of this test case is really: ( for $var in $input-context/works[1]/employee[1]/hours[1] return () )
I agree that the outer for clause is not seen by XQUF as vacuous, but I believe that this is not relevant. This is the third in a sequence of test cases: parenthesized-expr-01 - the inner for returns $var, the inner for is a simple expression, and the query does not raise a static error. parenthesized-expr-02 - the inner for return clause contains a delete, the inner for is an updating expression, and the query raises a static error. parenthesized-expr-03 - the inner for returns (), the inner for is a vacuous expression, and the query does not raise a static error. If you agree with this resolution, then please close this bug report.
ok, close this bug