Page 1 of 1

Unable to import module on eXist server

Posted: Wed Apr 10, 2013 12:57 pm
by odaata
Hi,

I'm using Oxygen to write XQuery 3.0 that is executed on an eXist 2.0 server. Everything works fine except I am unable to import other modules in my code.

Code: Select all

import module namespace example="http://example.com/xquery/example" at "example.xqm";
No matter what path I give it, I always get the error below (with a different location hint):

Code: Select all

err:XQST0059 error found while loading module moduleName: Source for module 'http://example.com/xquery/example' not found module location hint URI 'example.xqm.
I've tried the suggestions given here: http://www.oxygenxml.com/forum/post5147.html#p5147

But none of them have worked. I've tried the following:
  • relative path (since the module is in the same directory): "example.xqm"
  • "/db/modules/example.xqm"
  • "xmldb:exist///db/modules/example.xqm"
  • "xmldb:exist//localhost:8080/db/modules/example.xqm"
  • "xmldb:exist//user:pass@localhost:8080/db/modules/example.xqm"
  • "http://localhost:8080/exist/rest/db/modules/example.xqm"
The other oddity here is that the Outline view is able to load the module, because it shows all the variables and functions in imported modules and the intellisense typing works with imported modules, but when I try to execute it using the same data source that I'm using to edit it, I get the error above. Can anyone help me with this?

Thanks,
Mike

Re: Unable to import module on eXist server

Posted: Thu Apr 11, 2013 3:22 pm
by adrian
Hello,

Unfortunately this doesn't work with Oxygen v14.2 and older.
There's another topic on the forum that discusses this:
XQuery Validation problem with imported modules

However, we already have a solution for this in the current development stream (for Oxygen v15.0). If you are interested in testing a beta version of Oxygen that includes this, please write to our support email address: support AT oxygenxml DOT com

Regards,
Adrian

Re: Unable to import module on eXist server

Posted: Thu Apr 11, 2013 3:34 pm
by odaata
Ok, thanks for the info. I sent support an e-mail to try out version 15 beta. This one feature will make my life so much easier when writing XQuery...

Cheers,
Mike

Re: Unable to import module on eXist server

Posted: Fri Apr 12, 2013 6:04 pm
by odaata
I tried out version 15 beta on Ubuntu and I can confirm that is now working! It validates and properly executes XQueries with imported modules on an eXist 2.0 server.

Thanks for your help!

Re: Unable to import module on eXist server

Posted: Mon May 05, 2014 11:25 am
by stdu
Hi,

I still have this issue in Oxygen Editor 15.2: the module is loaded, because Oxygen offers me all variables and functions from the module by writing new code, but the the validation still fails (with the mentionend error notice). Have I configure something else?

Thx & Greets,
Stefan

Re: Unable to import module on eXist server

Posted: Mon May 05, 2014 12:39 pm
by adrian
Hello Stefan,

What version of eXist are you using?
Did you configure a native eXist data source and connection (or used the Create eXist-db XML connection dialog) in Oxygen or are you using a generic WebDAV connection to access eXist?

Note that the eXist validation only works with resources opened from a native eXist connection.
If the problem persists, please let me know what does the 'import module' line look like.

Regards,
Adrian