Schematron / schematron-enhancement-proposals

This repository collects proposals to enhance Schematron beyond the ISO specification
9 stars 0 forks source link

Fix incompatibilities between Schematron and SVRL #5

Open xatapult opened 3 years ago

xatapult commented 3 years ago

There are several incompatibilities between Schematron and SVRL. For instance:

If we're going to keep SVRL we at least must make sure it is compatible with the Schematron language.

dmj commented 3 years ago

See also #7

rjelliffe commented 2 years ago

It is not as simple as just transferring types.

In particular, ID types are supposed to be unique-per-document values. Therefore, if an sch:assert with a @id that is type xs:ID is reported as an svrl:failed-assert with an @id of xs:ID then the SVRL will be invalid everytime the same assertion fails.

This problem will affect every time there are SVRL elements caused by multiple failures, at least: for patterns, rules, asserts, report, property, diagnostic. None of these can have their @id be of type xs:ID. The "id" is not the identifier for the SVRL element, but the identifier of the Schematron element.

So what else can it be? It should not be an xs:IDREF because that implies it is a reference to an ID in the same document.

Therefore the only, and best, XSD Datatype for those is xs:NCNAME.

(And yes I understand that RELAX NG validators may only implement lexical only, and not check uniqueness. But using xs:ID (i.e the datatype defined in XSD with uniqueness semantics) is an assertion that uniqueness should somehow be checked, e.g. by Schematron: it is not saying that there is no uniqueness. )