Open rjelliffe opened 8 months ago
This is a proposal to add a specific element to SVRL that implementers can use to convey compile-time and run-time errors in a Schematron schema.
+1 for this.
The standard characterizes a Schematron validator as a function returning three possibles values: "valid", "invalid", or "error" (Section 6.1). We currently have no way of expressing the value "error" in SVRL.
The modified schema allows a SVRL error-element as child of the SVRL active-pattern element. However: An error might also occur outside an active pattern, e.g. while calculating the value of a variable.I would thus make the SVRL error element a child of SVRL schematron-output, not of active-pattern.
I would thus make the SVRL error element a child of SVRL schematron-output, not of active-pattern.
I think it's still worth retaining it in the context of svrl:active-pattern
, to meet the requirements of #47, but agree it's useful as a child of svrl:schematron-output
: see https://github.com/Schematron/schema/commit/bb9066275559bff2fecd31d1a266d34e3ce32653.
I think there are two different situations:
1) The Schematron schema or engine has a problem.
Some are dynamic: Nan number, or function not allows list as parameter, etc.
2) The resource to be validated has a problem. Runtime error.
I think there are two different situations:
So I've changed the issue title.
I'll add a mapping for /svrl:schematron-output/svrl:error
to the table in Annex D.
This is a proposal to add a specific element to SVRL that implementers can use to convey compile-time and run-time errors in a Schematron schema.
E.g. we have rule with bad xpath....
This would be allowed anywhere in SVRL, and is aimed at XPath and missing IDs reports.
It allows a Schematron implementation to take advantage of the newer XSLT try/catch blocks so that a programming error does not necessary cause a complete abort of the validation, and so that appropriate user-oriented messages can be generated rather than relying on the logging or exception-reporting chain (which often have no user-facing visibility and consequently no way to handle problems in-band by consuming applications in an XML pipeline. It allows all-XML pipelines.
It obviously allows run-time dynamic reporting of programming errors (e.g. for an XSLT engine that only reports XPath errors when they are evaluated) but it allows a runtime SVRL report to be generated even when loading and initializing the compiled program (e.g. for an XSLT engine that checks Xpaths at load-time.)
Indeed, an implementation could generate an SVRL report at compile time, reporting only the sch:problem elements.
For example, an implementation might do this:
Currently, an implementation might be struggling to know whether to use failed-assert or whatever, which might cause tag abuse.