Page 1 of 1

Schematron validation: how to improve error reports?

Posted: Wed Apr 16, 2014 5:30 pm
by Pascale
Hi,

I have included a validation scenario based on several schematron files for my custom DTD.
That works perfectly well, but I would like to know if it is possible to improve reporting by:

- defining a different category for each set of rules.
For example, I would like to group the errors related to metadata, and have another group for errors related to table contents.

- hide the XPath expression used in the rule, and display only the defined error message.
For example, if I have the following rule

Code: Select all


<rule context="abstractrepeat" role="error">
<let name="repeats" value="count(//abstractrepeat)" />
<assert test="$repeats < 2">Element abstractrepeat cannot be used more than once.</assert>
</rule>
the error message is displayed as

Code: Select all

Element abstractrepeat cannot be used more than once. ($repeats < 2) [assert]
however I want to only show

Code: Select all

Element abstractrepeat cannot be used more than once.
Thanks for your help,
Pascale

Re: Schematron validation: how to improve error reports?

Posted: Fri Apr 18, 2014 9:03 am
by radu_pisoi
Hi,
- defining a different category for each set of rules.
For example, I would like to group the errors related to metadata, and have another group for errors related to table contents.
For grouping the rules defined in one or more patterns you can use the phase element. This element is defined in ISO Schematron specification, http://www.schematron.com/iso/P8.html#GEN12. When validating an XML document against a Schematron schema that defines one or more phases an input dialog will be displayed allowing the user to choose one of defined phase.
Is this enough for you or do you have another use case?
- hide the XPath expression used in the rule, and display only the defined error message.
This improvement is already available in oXygen 15.2 version.