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 1848 - [XQuery] Module Imports
Summary: [XQuery] Module Imports
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 1.0 (show other bugs)
Version: Last Call drafts
Hardware: PC Windows XP
: P2 minor
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-08-16 10:15 UTC by Michael Kay
Modified: 2005-08-31 22:41 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2005-08-16 10:15:17 UTC
This is a minor technical point which can probably be handled editorially.

We allow a module to do an "import module" on its own namespace.

We say that the effect of this is to import all modules for that namespace. This
includes the importing module.

We say that it's an error if the imported module contains functions or variables
that clash with those defined in the importing module. But when a module imports
itself, there will always be such a clash.

Solution: we should specify that when a module does an "import module" on its
own namespace, it should import all modules for that namespace *other than itself*.

(We have a bit of a problem with module identity: how do we know whether two
URIs identify the same module? But I suggest we leave implementations to sort
that one out.)
Comment 1 Michael Kay 2005-08-16 18:01:38 UTC
While on the topic, it would be useful to clarify whether a module that imports
its own namespace is allowed to contain forwards references to its own global
variables. You can read the spec either way on this: on the one hand it says
forwards references to global variables aren't allowed; on the other hand it
says you can access all the global variables declared in a namespace that you've
imported.

It's a little odd if it isn't allowed: if cyclic references to variables are
allowed across modules, why not allow them within a module? It's also difficult
to explain (and implement!) that a module has access to all the global variables
in an imported namespace except those that are declared in the same module and
after the variable reference.
Comment 2 Don Chamberlin 2005-08-31 21:48:48 UTC
The original bug report, about a module importing its own namespace, was 
accepted by the Query working group on 31 Aug 2005, and the proposed change has 
been implemented. I will mark this bug as "fixed".

The working group felt that the additional comment about forward references to 
global variables required further discussion. Mike, it is suggested that you 
open a separate bug report for this issue.

--Don Chamberlin
Comment 3 Don Chamberlin 2005-08-31 22:41:07 UTC
(Done. The new bug report is number 1928.)