This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
There are 4 tests which I believe should have an expected error result of err:XQST0054. They are: vardeclwithtype-15 K-InternalVariablesWith-6 K-InternalVariablesWith-9 K-InternalVariablesWith-15 As an example, vardeclwithtype-15 is this: declare variable $var as xs:integer := $e +1; declare variable $e as xs:integer := 10; $var And currently expects an error result of err:XPST0008. This doesn't seem to agree with section 4.14 of the XQuery specification which states: 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. If an initializing expression cannot be evaluated because of a circularity (for example, it depends on a function that in turn depends on the value of the variable that is being initialized), a static error is raised [err:XQST0054].
I don't agree. Certainly in the example quoted (I haven't checked the others) there is no circularity (you can't follow a chain of references from a variable back to itself). There is simply a forward reference, which (though I don't like the reasons) isn't allowed. The static context for the variable doesn't include a variable declared later in the module, so this is XPST0008.
Hi John, I believe Michael's comment is correct here, and therefore believe no changes needs to be done and closes this report as INVALID. No recursion can occur in the quoted example because variables appearing after a variable declaration are not in scope. So the variable reference, $e, is dangling and hence XPST0008 is issued. After having looked at the K-* tests, I think they trigger the same issue. If this resolution is not satisfactory, feel free to re-open this report. Otherwise feel free to change status to CLOSED. Frans
I understand what you mean, and on reflection I think I agree with you. However, could I suggest that the sentence in the specification that details err:XQST0054 be made it's own paragraph? I think that would probably have avoided my confusions in the first place, since it seems like the sentences before it relate to the error code in some way.
For changing the specification, you should submit a separate report on the XQuery specification(sorry for the bureaucracy!). It will be dealt with by the XQuery working group. Because the specifications have advanced far in their development, it may be that some suggestions are considered "minor" and not sufficient to justify changes at this point. Frans