Configure project file to include validation using Schematron

Post here questions and problems related to editing and publishing DITA content.
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Configure project file to include validation using Schematron

Post 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
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Configure project file to include validation using Schematron

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: Configure project file to include validation using Schematron

Post 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
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Configure project file to include validation using Schematron

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: Configure project file to include validation using Schematron

Post 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
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Configure project file to include validation using Schematron

Post by Radu »

Hello Ann,
Great, I'm glad this works for you!
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply