![](https://secure.gravatar.com/avatar/8b97b5aad24c30e4a1357b38cc39aeaa.jpg?s=120&d=mm&r=g)
Holger Joukl schrieb am 27.02.2015 um 08:46:
thank you for the helpful answer. It works flawlessly. Still I think that a master switch in the Schematron constructor to let it fail on report would be useful. I updated the code, docstring and tests and sent a pull request to make it happen.
I vaguely remember that it really was a conscious decision to not count report results as errors.
That said it might (?) be practical to allow changing behaviour without subclassing but I'd probably prefer to use the standard error-counting XPath as a default argument, rather than a switch.
I think a switch is ok here. It's a "strict" mode that means "if there's any report at all, I want validation to fail". Requiring to pass in an XPath for that means that people will have to take care to properly build or find the right expression. It's too simple a case for that overhead, and tighter error counting can still be achieved by subclassing if a user really needs that. Both options are not contradictory.
svrl_validation_errors_complete should imho then be added as a class attribute, otherwise a subclass can not provide customized "complete" (in lack of a better word) error validation.
I renamed it to "svrl_validation_errors_and_reports" because that's what it finds. And subclasses that provide their own selection can simply remove the "fail_on_report" option from their constructor and pass False to their superclass. Stefan