XQuery Validation problem with imported modules

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
joewiz
Posts: 56
Joined: Fri Jun 06, 2008 8:05 pm

XQuery Validation problem with imported modules

Post by joewiz » Wed Jan 06, 2010 9:01 pm

I am having problems validating XQuery files stored in eXist, if the XQuery file imports an XQuery module via a relative path. I believe this is an oXygen issue, not an eXist issue.

If I use a relative path, I can only get a red light during validation, not a green light. For example, this will give me a red light:

Code: Select all

import module namespace myns="http://mysite.com/myns" at "modules/mymodule.xqm";
The only way that oXygen will validate and give me the green light is if I provide an absolute URI, e.g.:

Code: Select all

import module namespace myns="http://mysite.com/myns" at "xmldb:exist:///db/site/modules/mymodule.xqm";
Wolfgang Meier (the creator of eXist) corroborated this issue: "oXygen does correctly resolve the import if the main XQuery was loaded from the file system, but *not* if you opened it using WebDAV. The error message indicates that Oxygen is looking for the module on the file system."

Thus, my bug/feature request: Add the ability for oXygen's XQuery Validation to resolve a relative path to a module imported by an XQuery file stored in eXist-db. In other words, relative paths should be evaluated relative to the location of the original XQuery file.

Note: I'm using oXygen XML Editor v11.1 with eXist 1.4.x-stable. By "validate" I mean open an XQuery file and select Document > Validate > Validate Document. I've selected my eXist instance as my XQuery validator via Preferences > XQuery > XQuery Validate with. Otherwise, XQuery validation and function auto completion work perfectly, so I know the connection with eXist works.

Please let me know if I can provide any other information.

Thank you,
Joe

joewiz
Posts: 56
Joined: Fri Jun 06, 2008 8:05 pm

Re: XQuery Validation problem with imported modules

Post by joewiz » Wed Jan 06, 2010 9:30 pm

Wolfgang added in a followup e-mail:
Sorry, I was mistaken. The error message is coming from eXist.

If I remember well, oXygen just sends the entire query to eXist for
validation. However, eXist has no idea where the query source was
loaded from. I guess we need to find a way for oXygen to pass a module
load path which can be used by eXist to resolve the imports correctly.

adrian
Posts: 2687
Joined: Tue May 17, 2005 4:01 pm

Re: XQuery Validation problem with imported modules

Post by adrian » Thu Jan 07, 2010 2:01 pm

Hello,

I can confirm what Wolfgang has mentioned, oXygen sends the entire query to eXist for validation. As far as I know there is no way to specify a server URI for the XQuery through the API so that's why the relative location of the module cannot be determined for XQuery validation or execution.

We will investigate and if the API has or will have the possibility to specify the XQuery URI we will support it in a future version.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

joewiz
Posts: 56
Joined: Fri Jun 06, 2008 8:05 pm

Re: XQuery Validation problem with imported modules

Post by joewiz » Sat Jan 09, 2010 4:34 am

Hi Adrian,

Thank you very much for your reply. I've passed your response on to the eXist developers. It would be great if the eXist & oXygen devs could find a way!

Joe

Radu
Posts: 7212
Joined: Fri Jul 09, 2004 5:18 pm

Re: XQuery Validation problem with imported modules

Post by Radu » Fri Sep 20, 2013 4:13 pm

Hi,

Just to update this thread, Oxygen 15.0 also sends to the server when validating a module the base URI of the module, thus allowing the server to properly resolve relative references.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Darin
Posts: 2
Joined: Sat Jul 18, 2020 6:15 pm

Re: XQuery Validation problem with imported modules

Post by Darin » Tue Jul 21, 2020 1:37 am

I am getting this same problem in oxygen 21.1 with a WebDAV datasource connection to eXist 5.1.1. I open an xquery from WebDAV and the relative path of the imported module cannot resolve. I open the same xquery using xmlrpc and it works fine.
Regression?

Radu
Posts: 7212
Joined: Fri Jul 09, 2004 5:18 pm

Re: XQuery Validation problem with imported modules

Post by Radu » Tue Jul 21, 2020 8:16 am

Hi Darin,

This is not a regression, in Oxygen 15 we fixed things to properly work with the xmlrpc API (API which is used to validate the XQuery), before it even when using the xmlrpc API you got a validation error when your XQuery imported a module.
When using Webdav, the XQuery validation is not done against the Exist server, it's done with the Saxon XSLT processor bundled with Oxygen which probably has a hard time finding the import if the reference is not relative to the current XQuery file.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply