This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Resolving bug 2447 in XQTS seems to have unwanted side-effects. Apparently all references to XPST0008 have been replaced by XPST0081 we believe this is incorrect. Take for example ForExpr002 for $folder in $folder/File return <file name="{$folder/File/FileName}"/> XQTS 0.9.0 expects XPST0081, where we believe it should still eb XPST0008. In paragraph "3.1.2 Variable References" of the XQuery spec (including the latest May 10 version) we read: Every variable binding has a static scope. The scope defines where references to the variable can validly occur. It is a static error [err:XPST0008] to reference a variable that is not in scope. If a variable is bound in the static context for an expression, that variable is in scope for the entire expression. In addition, note that the query above doesn't specify any prefix. As such XQST0081 can definitely not apply as it reads: err:XPST0081: It is a static error if a QName used in a query contains a namespace prefix that cannot be expanded into a namespace URI by using the statically known namespaces. Here is the complete list of tests for which the switchfrom XPST0008 to XPST0081 is incorrect: ForExpr002 ForExpr009 LetExpr021 ReturnExpr014 WhereExpr002 WhereExpr018 vardeclwithtype-15 statictyping-21 Thanks, Marc
As additional information, note that this was already reported and fixed with bug 3267. However, the list of tests in that bug seems to be incomplete.
Marc: I am reassigning the bug to Microsoft as most of the test are theirs. I did looked at my tests,vardeclwithtype-15 and statictyping-21. I do not see how this bug pertains to those two tests. Please comment. Thanks, Carmelo
Let's take a closer look at vardeclwithtype-15 declare variable $var as xs:integer := $e +1; declare variable $e as xs:integer := 10; $var $e is used before being declared. In http://www.w3.org/TR/xquery/#id-variables we read: It is a static error [err:XPST0008] to reference a variable that is not in scope. Does this helps? Marc
to complete comment #3, let me add a reference to http://www.w3.org/TR/xquery/#id-variable-declarations It says: The static context for an initializing expression includes all functions that are declared or imported anywhere in the Prolog, but it includes only those variables and namespaces that are declared or imported earlier in the Prolog than the variable that is being initialized. I hope this helps, Marc
Marc: Correct. I updated the catalog file for all the tests (NIST's and Microsoft's) to expect code XPST0008. Please close the bug if in agreement. Thanks, Carmelo
In XQTS 0.9.4, one query does't seem tio be fixed. Expressions\FLWORExpr\LetExpr\LetExpr021.xq
Marc: All tests should now have the correct expected code. Thanks, Carmelo
Yes, all are OK now! Closing. Thanks, Tom.