[Bug 5722] [XQuery] Importing the same module from different modules.

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





------- Comment #2 from jmdyck@ibiblio.org  2008-06-03 19:28 -------
[personal response:]
I don't think the spec supports the notion of "importing a *copy* of a module".
So, in the first scenario, where there's only one module implementing the
imported namespace, A and B do import the same module, and "A:f() is B:f()"
evaluates to true.

In the second scenario, if the user attempts to have A import M and B import
M', then I believe each of (1), (2), and (4) is a justifiable outcome. Re (3),
the implementation is certainly free to ignore location hints, but it's still
obliged to define which set of modules is imported in each case, which would
then result in an outcome such as (1), (2), or (4) (or others).

I think (2) vs (4) hinges on an ambiguity in the spec. For example, 4.11 says:
    It is a static error if the expanded QName of a
    variable declared in an imported module is equal
    ... to the expanded QName of a variable declared 
    in the importing module or in another imported module ...
Where it says "another import module", does it mean
    another module imported by the importing module
or
    another module imported anywhere in the universe of the query
? The former interpretation allows outcome (2) but not (4); the latter allows
(4) but not (2).

Anyhow, I agree that the spec is fairly vague on the matter.

Received on Tuesday, 3 June 2008 19:29:20 UTC