This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3646 - Test results should be err:XQST0054
Summary: Test results should be err:XQST0054
Status: CLOSED INVALID
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 1.0
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-01 15:09 UTC by John Snelson
Modified: 2006-09-04 11:48 UTC (History)
1 user (show)

See Also:


Attachments

Description John Snelson 2006-09-01 15:09:57 UTC
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].
Comment 1 Michael Kay 2006-09-01 15:25:09 UTC
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.
Comment 2 Frans Englich 2006-09-04 11:21:48 UTC
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
Comment 3 John Snelson 2006-09-04 11:36:35 UTC
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.
Comment 4 Frans Englich 2006-09-04 11:48:07 UTC
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