Page 1 of 1

Xquery validation throws error when saving a module xqm

Posted: Wed Aug 16, 2023 12:31 pm
by larsS
Hello everyone,
I am currently working on a processing pipeline on a local file system of a more complex data structure. To keep everything clear, I have outsourced various parts into modules.
Since I have my Oxygen XML editor in the strict setting -> "Validate document before saving" every time I save the module I get an error message:

Code: Select all

XQuery module execution is not supported. Please execute the main XQuery file.
Unfortunately, I have not found a way to prevent this behaviour without turning off the above setting. Is there somewhere a setting or a parameter for Saxon, that the error message does not come up again and again?
Google does not help me.

Used Saxon processor:

Code: Select all

Saxon-EE XQuery 10.6
Thanks in advance!

Re: Xquery validation throws error when saving a module xqm

Posted: Wed Aug 16, 2023 2:36 pm
by tavy
Hello,

To validate an XQuery module, you need to have a main XQuery file that imports and calls the functions defined in the module. The main XQuery file is the entry point for executing the code.
You can create and associate a validation scenario for the modules, that sets the main file as the URL to validate, Similarly with XSLT case from our user manual:
https://www.oxygenxml.com/doc/versions/ ... nario.html


Best Regards,
Octavian

Re: Xquery validation throws error when saving a module xqm

Posted: Wed Aug 16, 2023 6:07 pm
by larsS
Hello Octavian,
if I am in the main.xq I have no problems and can validate.
The mentioned error message occurs when I am directly editing and saving the module. When I have made the setting as mentioned.
Since I can't set XQuery file as master files, it doesn't seem to form the link either.
I am using version 24.1. Is it possible to activate XQuery Master Files in a higher version?
It may also be that I didn't understand the validation configuration correctly, but the examples also don't indicate that I can somehow map an XQuery module chain.
The easiest way seems to be not to activate the "Validate on save". Too bad actually.
I think this is referred to the same problem.
Greets.

Re: Xquery validation throws error when saving a module xqm

Posted: Fri Aug 18, 2023 10:16 am
by tavy
Hello,

You need to create a validation scenario and set the main file (for example main.xqy) as the URL to validate. The you need to associate this scenario to all your modules. To do this you can select the files from the Project view, and use the contextual menu action "Validate->Configure Validation Scenario(s)".
For me the validation works fine.

Best Regards,
Octavian

Re: Xquery validation throws error when saving a module xqm

Posted: Wed Sep 06, 2023 4:43 pm
by larsS
Dear Octavian,
thank you very much. This explanation helped a lot.
Now it works.

Best Regards,
Lars