Validating large xml files with schematron

I use schematron to check large xml files (several megabytes). The check is performed quite quickly if the files are in order (if there are no errors). But when the number of errors increases, it increases the execution time of the circuit check.

Is there a way to stop checking XSLT schemas when, for example, 200 errors are found. This would help, because if there are large files containing hundreds of occurrences of the same error, it would be enough to report only the first errors and ask the user to check the file again after correction.

+4
source share
1 answer

You should be able to get closer to your requirement by combining the Schematron Terminator Validator with the Schematron Phase

The terminator check function makes a schematron check error on the first error.

Phases allow validation to be broken down into stages and performed gradually.

One or both of them in combination should bring you closer to what you want - perhaps by putting all your rule classes in phases, and then executing each phase with a terminator will give a good result, allowing users to report several errors at once.

+1
source

All Articles