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 2546 - [XQuery] Type constraints on module import
Summary: [XQuery] Type constraints on module import
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 1.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Don Chamberlin
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-21 21:11 UTC by Michael Kay
Modified: 2006-02-14 01:02 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2005-11-21 21:11:16 UTC
Section 4.11 says:

<quote>
It is a static error [err:XQST0036] to import a module if the importing module's
in-scope schema types do not include definitions for the schema type names that
appear in variable declarations, function parameters, or function returns found
in the imported module.
</quote>

This constraint seems over-severe in relation to functions and variables that
are declared in the imported module but are not referenced in the importing
module. The rule as written means that when extra functions or variables are
added to an existing library module, an importing module may be invalidated even
though it has not changed and makes no reference to the new functions or
variables. For vendors of function libraries, this will create quite unnecessary
problems in keeping successive releases of the library module backwards
compatible with existing client code.

(This assumes that "found in" is to be interpreted as "present in". One could
argue that the compiler doesn't find functions and variables unless it looks for
them, and that there's no requirement to look for functions and variables that
aren't referenced. But that seems to be wriggling.)

Proposed change: replace the quoted paragraph by:

<quote>
It is a static error [err:XQST0036] to import a module if the importing module's
in-scope schema types do not include definitions for the schema type names that
appear in the declarations of variables and functions (whether in an argument
type or return type) that are present in the imported module and are referenced
in the importing module.
</quote>

Michael Kay
Comment 1 Don Chamberlin 2006-02-14 01:01:43 UTC
Mike,
On 01 Feb 2006 the Query working group agreed to adopt your suggestion. It will 
be reflected in the next version of the XQuery language specification. Since 
you were present at the discussion, I have marked this Bugzilla entry as closed.
Regards,
Don Chamberlin (for the XQuery working group)