Page 1 of 1

Configure project file to include validation using Schematron

Posted: Tue Jan 23, 2024 8:54 pm
by ann.jensen
Hi,
I want to configure a basic Oxygen project file that can be shared with others so that it auto applies a Schematron file that they will have stored in a set location on their machines.
Is there documentation that I can follow to configure this in Oxygen Editor?
Thanks,
Ann

Re: Configure project file to include validation using Schematron

Posted: Wed Jan 24, 2024 10:08 am
by Radu
Hi Ann,

How about if you create a custom DITA framework which adds the extra Schematron validation schema?
https://blog.oxygenxml.com/topics/shari ... rules.html
And then copy the custom frameworks folder inside the project folder.
In the Preferences->"Document Type Association / Locations" you can refer to the custom frameworks folder using the "${pd}" editor variable and switch the entire "Locations" page to project level options so that its contents is saved in the project ".xpr" file.
As an end result if someone opens the custom project ".xpr" in the Oxygen Project view they should get the custom Schematron applied for all opened DITA XML documents.

For example this startup DITA project:
https://github.com/oxygenxml/DITA-Startup-Project
Once you open the "project.xpr" in the Oxygen Project view you get a bunch of project level options applied including the custom DITA framework extension which is defined in the folder: https://github.com/oxygenxml/DITA-Start ... frameworks

Regards,
Radu

Re: Configure project file to include validation using Schematron

Posted: Wed Jan 24, 2024 3:19 pm
by ann.jensen
Hi Radu,
Thank you for all that information. I have followed the instructions and created a custom framework with a new Scenario under Document type--> Validation that has my custom Schematron file configured. I have also created a custom Validation Scenario under Configure Validation Scenarios...but am unsure what role these 2 different configurations play i.e. 1) The validation under my custom Document type and 2) The validation scenario that I can select to associate with my open topic.
Either way I seem to have to select the Validations menu button followed by Configure Validation Scenarios... and then select the checkbox beside my custom validation in order to get the associated Schematron rules to execute.
However, if I open a different topic, then the Validation Scenario is not automatically associated with it and so Schematron rules don't automatically execute. Instead I have to again select Configure Validation Scenarios... and select the checkbox beside my custom validation.
Is there a way to force this validation scenario to be selected and therefore executed when this project is opened?
Thanks again,
Ann

Re: Configure project file to include validation using Schematron

Posted: Thu Jan 25, 2024 8:26 am
by Radu
Hi Ann,
So:
I have followed the instructions and created a custom framework with a new Scenario under Document type--> Validation that has my custom Schematron file configured.
If you edit your custom DITA framework configuration in the Oxygen Preferences->"Document Type Association" and go to the "Validation" tab you should see there both the "DITA" scenario and your extra validation scenario. Both of them should be checked. There is a "Default" column in that table of validation scenarios and both of them should be selected as default scenarios, which should apply by default when a DITA XML topic is opened.
You should also open Oxygen's main menu "Window->Show view->Properties" view which shows what framework is used for editing for an opened DITA XML topic, just to make sure your custom configured framework is being used when the topic is opened.
I have also created a custom Validation Scenario under Configure Validation Scenarios...
This should not be necessary, maybe you should delete this custom validation scenario for now just to make sure the one from the document type configuration starts to get used by default.
Regards,
Radu

Re: Configure project file to include validation using Schematron

Posted: Mon Jan 29, 2024 3:29 pm
by ann.jensen
Thanks again Radu, that all seems to be working as expected now and using the Properties pane is very helpful for confirming Document Type.
Regards,
Ann

Re: Configure project file to include validation using Schematron

Posted: Mon Jan 29, 2024 3:31 pm
by Radu
Hello Ann,
Great, I'm glad this works for you!
Regards,
Radu