Page 1 of 1

schematron phases: automated selection

Posted: Wed Oct 21, 2020 6:14 pm
by boiboi
Hello,

I want to use Schematron phases but don't want to select the phase manually. Is it possible to automatically select the schematron phases? In my scenario I want to use different phases depending on the file path. If the file is in a specific folder, it should be validated with a specific phase.

Thank you!

Re: schematron phases: automated selection

Posted: Thu Oct 22, 2020 3:34 pm
by tavy
Hello,

I think a solution for this is to create a validation scenario for each phase from Schematron.Then you can associate each scenario on the folder where the XML files are located, depending on the phase that you want to use for that folder.
For this you need to use the Configure Validation Scenario(s) action from the project contextual menu.

Best Regards,
Octavian

Re: schematron phases: automated selection

Posted: Thu Oct 22, 2020 6:27 pm
by boiboi
Thank you for your suggestion. Unfortunately, I don't know how that would solve the issue, but I may have misunderstood your suggestion. It seems to me, the suggestion would lead to batch validation of different folders.

I want to apply different phases (or validation scenarios) on the identical file, depending on its current file path. (The file paths reflect the workflow status of a file.)

Example:
If a file is located on the path "C:\user\name\folder_A" or subfolders (e.g."C:\user\name\folder\folder_A\subfolder") -> apply phase A/validation scenario A
If the file is located somewhere else (e.g. "C:\user\name\folder_B") -> apply phase B/validation scenario B

Thanks again!

Re: schematron phases: automated selection

Posted: Fri Oct 23, 2020 9:45 am
by tavy
Hello,

If you associate a validation scenario on a folder from Project view, the scenario will be automatically associated with all the files from that folder and subfolders. Then when you open a file from the folder the file will be validated with the associated scenario. You can use the Validate action from the editor toolbar menu, but you can also use the Validate action from the Project view if you want to validate all the files.

What you need to do is:
  • Right-click on the "C:\user\name\folder_A" folder from project view.
  • Select the Configure Validation Scenario(s) action from the contextual menu.
  • Create a new validation scenario, then select "XML Document" in the "File type" and in the Schema column add the Schematron schema with the phase that you want to use for the current folder.
Then you can do the same thing for the other folders.

This solution works if you have only XML files in those folders. If you have also other type of files, they will be validated with the same scenario.
When you add new files in the folders, they will have the scenario associated automatically.

Best Regards,
Octavian

Re: schematron phases: automated selection

Posted: Mon Oct 26, 2020 12:31 pm
by boiboi
Thank you, it works.