Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XQuery: Module imports are not transitive #2048

Open
ChristianGruen opened this issue Nov 24, 2021 · 1 comment
Open

XQuery: Module imports are not transitive #2048

ChristianGruen opened this issue Nov 24, 2021 · 1 comment
Labels

Comments

@ChristianGruen
Copy link
Member

The following function should raise an error:

(: b.xqm :)
module namespace b  = 'b';
import module namespace c  = 'c'   at 'c.xqm';

(: c.xqm :)
module namespace c  = 'c';
declare function c:hello(){
  "can you see me now"
};

(: main.xq :)
import module namespace b  = 'b'   at 'b.xqm';
declare namespace c='c';
c:hello()

Original message: https://www.mail-archive.com/basex-talk@mailman.uni-konstanz.de/msg13873.html

@apb2006
Copy link

apb2006 commented Apr 24, 2022

Example from https://www.mail-archive.com/basex-talk@mailman.uni-konstanz.de/msg14507.html

In this case it appears an error, [XQST0049] Duplicate declaration of static variable, is raised by BaseX 9.7 when it should not be.

(: main.xq  :)
import module namespace u = "u" at 'u.xqm'; 
import module namespace c = "c" at 'data/c.xqm';
$u:path

(: u.xqm :)
module  namespace u="u";
declare variable $u:path:="somewhere";

(: data/c.xqm :)
module  namespace c="c";
import module namespace u = "u" at 'u.xqm'; (: cf '../u.xqm' :)
declare function c:foo(){
  "foo"
};

(: data/u.xqm:)
module  namespace u="u";
declare variable $u:path:="somewhere";

Saxon does not raise an error
java -cp "%SAXON_HOME%/saxon9he-9.1.5.jar" net.sf.saxon.Query main.xq

issue.2048.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants