[xquery-talk] Modules and duplicate declarations

Michael Kay mike at saxonica.com
Sat Jul 21 12:44:47 PDT 2007


It seems to work fine on Saxon 8.9.0.4

8.6.1 is pretty old (Nov 2005), and both the product and the spec have moved
on since it was released.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: talk-bounces at x-query.com 
> [mailto:talk-bounces at x-query.com] On Behalf Of Ronald Bourret
> Sent: 21 July 2007 05:40
> To: talk at xquery.com
> Subject: [xquery-talk] Modules and duplicate declarations
> 
> Hello,
> 
> I am having trouble understanding how to import the same 
> module in multiple places.
> 
> The test query requires modules A and B, and module A 
> requires module B. 
> Therefore, test imports A and B, and A imports B:
> 
> alib.xqy
> --------
> module namespace a = "a";
> import module namespace b = "b" at "..."; declare variable 
> $a:a1 := fn:concat("a", $b:b1);
> 
> blib.xqy
> --------
> module namespace b = "b";
> declare variable $b:b1 := "b";
> 
> test.xqy
> --------
> import module namespace a = "a" at "..."; import module 
> namespace b = "b" at "..."; ($a:a1, $b:b1)
> 
> Running test returns XQST0049, stating that $b:b1 was 
> declared twice. If test doesn't import blib.xqy, it returns 
> XPST0008, stating that prefix b has not been declared.
> 
> I don't understand the first error. The XQuery spec states 
> that module imports are not transitive. That is, if A imports 
> B and B imports C, C is not visible to A. Thus, $b:b1 should 
> be visible to test only by directly importing blib.xqy and 
> not by importing alib.xqy.
> 
> Is this a bug in the processor (Saxon 8.6.1) or am I 
> misreading the spec?
> 
> Thanks,
> 
> -- Ron
> 
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk



More information about the talk mailing list