Re: multiple modules with same namespace

Hello Per,
Thanks for your comment on importing modules. The Query Working Group 
discussed your comment at a recent meeting and arrived at the following 
resolution:

Both the  "import schema" and "import module" clauses will be modified so 
that they take a single "target namespace" (a URI) and zero or more 
"location hints" (also URIs). It will be an error for two "import schema" 
clauses, or two "import module" clauses, to specify the same target 
namespace. The location hints may be interpreted (or ignored) in an 
implementation-dependent way. Thus, for example, if a module with target 
namespace "A" is defined by two physical resources at locations "B" and 
"C", a user might write:

import module "A" at "B", "C";

Each of the physical resources imported must contain a syntactically valid 
module definition that specifies the expected target namespace. However, 
if two different resources define the same qualified name (for example, 
two definitions for an element named a:foo), an error is raised.

The new rules will appear in the next XQuery Working Draft. Please let us 
know if you are satisfied with this resolution of your issue.

Best regards,
--Don Chamberlin




Per Bothner <per@bothner.com> 
Sent by: public-qt-comments-request@w3.org
12/31/2003 02:49 PM

To
public-qt-comments@w3.org
cc

Subject
multiple modules with same namespace







I asked this before, but even the latest drafts don't seem to have
a clear answer for whether there can be multiple library modules
with the same namespace.

Assume mod1.xql:

module namespace m = "M";
declare function m:f() { 1 }

and mod2.xql:

module namespace m = "M";
declare function m:g() { 2 }

Is the following main module allowed?

import module namespace m1 = "M" at "mod1.xql";
import module namespace m2 = "M" at "mod2.xql";
m1:f()+m2:g()

How about this?

import module namespace m = "M";
m:f()+m:g()

The statement in 4.7 that "The module import identifies the module
to be imported by its target namespace" implies neither are allowed
because in this case you cannot identify the module by its target
namespace.  But phrasing is sufficiently imprecise that I can't be
sure what's intended.

It would be nice to clarify this, either:
A. The target namespace must match a single library module; it is
a static error if multiple modules have the same namespace.
or:
B. If multiple modules match the target namespace, then they
are all imported.

My assumption (and strong recommendation) is that A is intended.
-- 
                 --Per Bothner
per@bothner.com   http://per.bothner.com/

Received on Friday, 6 February 2004 13:07:31 UTC