[Bug 2546] [XQuery] Type constraints on module import

http://www.w3.org/Bugs/Public/show_bug.cgi?id=2546

           Summary: [XQuery] Type constraints on module import
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery
        AssignedTo: chamberl@almaden.ibm.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org


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

Received on Monday, 21 November 2005 21:11:35 UTC