[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Modules and duplicate declarations

Ronald Bourret rpbourret at rpbourret.com
Fri Jul 20 22:39:41 PDT 2007


  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



Purchase Stylus Studio Online Today!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.