Importing two modules from the same package -> "Module is declared twice"

Friday, 24 February 2012 · 3 messages · last reply 5 Mar 2012
CD
Charles Duffy24 Feb 2012 19:06 #
Howdy -- please see the following example:
=== expath-pkg.xml
<?xml version="1.0"?>
<package xmlns="http://expath.org/ns/pkg" spec="1.0" name="
http://dyfis.net/example/ns-test" abbrev="ns-test"
version="0.1.136892+build.20120224.105428">
  <title>Namespace Trouble Test</title>
  <xquery>
    <namespace>http://dyfis.net/example/ns-test/foo</namespace>
    <file>foo.xq</file>
  </xquery>
  <xquery>
    <namespace>http://dyfis.net/example/ns-test/bar</namespace>
    <file>bar.xq</file>
  </xquery>
</package>
=== ns-test/foo.xq
module namespace foo = "http://dyfis.net/example/ns-test/foo";

declare function foo:test() {
  1 + 1
};
=== ns-test/bar.xq
module namespace bar = "http://dyfis.net/example/ns-test/bar";
declare function bar:test() { 1 + 1 }; === ...in the basex-gui buffer... import module namespace foo="http://dyfis.net/example/ns-test/foo"; import module namespace bar="http://dyfis.net/example/ns-test/bar"; 1+1 === ...results in... Error: [XQST0047] Module is declared twice: ' http://dyfis.net/example/ns-test/bar'.
CG
Christian Grün26 Feb 2012 16:29 #
...noted and added as GitHub issue: https://github.com/BaseXdb/basex/issues/402 Thanks, Christian
Quoted text · Charles Duffy · 43 lines
On Fri, Feb 24, 2012 at 6:06 PM, Charles Duffy <charles at dyfis.net> wrote: > Howdy -- please see the following example: > > === expath-pkg.xml > <?xml version="1.0"?> > <package xmlns="http://expath.org/ns/pkg" spec="1.0" > name="http://dyfis.net/example/ns-test" abbrev="ns-test" > version="0.1.136892+build.20120224.105428"> > <title>Namespace Trouble Test</title> > <xquery> > <namespace>http://dyfis.net/example/ns-test/foo</namespace> > <file>foo.xq</file> > </xquery> > <xquery> > <namespace>http://dyfis.net/example/ns-test/bar</namespace> > <file>bar.xq</file> > </xquery> > </package> > === ns-test/foo.xq > module namespace foo = "http://dyfis.net/example/ns-test/foo"; > > declare function foo:test() { > 1 + 1 > }; > === ns-test/bar.xq > module namespace bar = "http://dyfis.net/example/ns-test/bar"; > > declare function bar:test() { > 1 + 1 > }; > === ...in the basex-gui buffer... > import module namespace foo="http://dyfis.net/example/ns-test/foo"; > import module namespace bar="http://dyfis.net/example/ns-test/bar"; > 1+1 > === ...results in... > Error: [XQST0047] Module is declared twice: > 'http://dyfis.net/example/ns-test/bar'. > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
CD
Charles Duffy5 Mar 2012 22:04 #
This is something I'm quite interested in seeing resolved -- if you could provide some guidance (either here or via discussion attached to the github issue) on what an proper fix would look like, I'd be happy to try my hand at a patch if that would help get it into the next point release. Thanks!
Quoted text · Christian Grün · 52 lines
On 02/26/2012 09:29 AM, Christian Grün wrote: > ...noted and added as GitHub issue: > > https://github.com/BaseXdb/basex/issues/402 > > Thanks, > Christian > ___________________________ > > On Fri, Feb 24, 2012 at 6:06 PM, Charles Duffy<charles at dyfis.net> wrote: >> Howdy -- please see the following example: >> >> === expath-pkg.xml >> <?xml version="1.0"?> >> <package xmlns="http://expath.org/ns/pkg" spec="1.0" >> name="http://dyfis.net/example/ns-test" abbrev="ns-test" >> version="0.1.136892+build.20120224.105428"> >> <title>Namespace Trouble Test</title> >> <xquery> >> <namespace>http://dyfis.net/example/ns-test/foo</namespace> >> <file>foo.xq</file> >> </xquery> >> <xquery> >> <namespace>http://dyfis.net/example/ns-test/bar</namespace> >> <file>bar.xq</file> >> </xquery> >> </package> >> === ns-test/foo.xq >> module namespace foo = "http://dyfis.net/example/ns-test/foo"; >> >> declare function foo:test() { >> 1 + 1 >> }; >> === ns-test/bar.xq >> module namespace bar = "http://dyfis.net/example/ns-test/bar"; >> >> declare function bar:test() { >> 1 + 1 >> }; >> === ...in the basex-gui buffer... >> import module namespace foo="http://dyfis.net/example/ns-test/foo"; >> import module namespace bar="http://dyfis.net/example/ns-test/bar"; >> 1+1 >> === ...results in... >> Error: [XQST0047] Module is declared twice: >> 'http://dyfis.net/example/ns-test/bar'. >> >> _______________________________________________ >> BaseX-Talk mailing list >> BaseX-Talk at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >>

⚡Generated with XQuery