Xquery validation throws error when saving a module xqm

Oxygen general issues.
larsS
Posts: 18
Joined: Mon Sep 13, 2021 10:41 am

Xquery validation throws error when saving a module xqm

Post 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!
tavy
Posts: 365
Joined: Thu Jul 01, 2004 12:29 pm

Re: Xquery validation throws error when saving a module xqm

Post 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
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
larsS
Posts: 18
Joined: Mon Sep 13, 2021 10:41 am

Re: Xquery validation throws error when saving a module xqm

Post 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.
tavy
Posts: 365
Joined: Thu Jul 01, 2004 12:29 pm

Re: Xquery validation throws error when saving a module xqm

Post 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
Attachments
image.png
image.png (12.05 KiB) Viewed 677 times
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
larsS
Posts: 18
Joined: Mon Sep 13, 2021 10:41 am

Re: Xquery validation throws error when saving a module xqm

Post by larsS »

Dear Octavian,
thank you very much. This explanation helped a lot.
Now it works.

Best Regards,
Lars
Post Reply