Custom Validation Rules with Schematron
Schematron is a language that you can use to create customized validation rules for your Paligo topics. This is useful when you want to add extra rules, for example, you could create a rule that each topic can only contain one procedure.
Note
Schematron rules are additional rules that you can apply to the Paligo XML content model, which is based on DocBook. You cannot use it to add custom elements that are not supported by Paligo XML/DocBook.
To use Schematron rules in Paligo:
-
Create a Schematron file named:
custom.sch
You can do this in any code editor or text editor, but you will need an understanding of how Schematron works. You can find out more at the official Schematron website. Note that the file must be named
custom.sch
or it will not work in Paligo.When you create a "custom.sch" Schematron file, you should consider:
-
The structure of your Paligo content and the patterns in that content
-
The Schematron rules you create are applied to each topic individually in Paligo.
-
When Schematron validation is enabled, Paligo checks the content of a topic against the rules in the Schematron file. This happens when the you attempt to save the topic. If the topic's content breaks the rules, Paligo will display an error notification and will not save. You can then:
-
Edit your topic and fix the problem that is breaking the rules in the Schematron file. To do this, you will need to find out what rules are set in the Schematron file.
You could ask whoever is responsible for uploading and maintaining the Schematron file. If that is not possible, you can ask someone with Schematron experience to view the Schematron file and figure out what rules are in place. The location of the Schematron file is explained in Upload Schematron Files to Paligo.
Note
It is possible to have multiple types of validation enabled at the same time, for example, Paligo XML Schema validation and Schematron validation. In this scenario, a topic will only save when it complies with all of the rules.