[Bug 14439] [XQuery 3.0] technical: is this a name clash?

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

--- Comment #1 from Jonathan Robie <jonathan.robie@gmail.com> 2011-10-12 21:09:40 UTC ---
(In reply to comment #0)

> Consider the query:
>     main module:
>         import module "NEAR";
>         declare namespace far = "FAR";
>         declare variable $far:v := "foo";
>         $far:v

The above import brings in the names in module NEAR, but not those in module
FAR. Import is not transitive.

>     library module:
>         module namespace near = "NEAR";
>         import module "FAR";

No variables here to clash.

>     library module:
>         module namespace far = "FAR";
>         declare variable $far:v := 42;
>         declare variable $far:x := $far:v;

$far:x in this module shouldn't be imported.

> Note that the global variable name $"FAR":v is declared in two places with two
> different values. I know of at least one XQuery implementation that claims this
> is a static error (XQST0049), but I believe doing so is non-conformant, because
> the two declarations do not "come into contact": there isn't a module that
> declares/imports both.

I agree. And I know at least one other XQuery processor has the same problem.

> If it doesn't raise an error, then it would be good to add this example to the
> test suite(s).
> 
> If it does raise an error, then please point out the rules that cause this.

I don't think the spec says it raises an error. Allowing an error here would be
backwards incompatible, at least with the spec. I'm wondering how many
implementations get this one right.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 12 October 2011 21:09:46 UTC