Schematron / schematron-enhancement-proposals

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

Overrides on sch:include[@href] & sch:extends[@href] #67

Open rjelliffe opened 9 months ago

rjelliffe commented 9 months ago

Status quo

Characterization I think Schematron's sch:extend's and sch:include's simplicity is a strength for implementators and ease of understanding, and contrasts with the complexity and lack of bang-per-buck of XSD's mechanisms. But I think it is skewed to modularity (to divide a large schema into smaller parts) rather than construction (making a new schema from parts) or abstraction (exposing some pattern in the schema that is conceptually useful.)

Nevertheless, it would be possible to keep the inclusion model and add a measure of include-time errors or warnings.

Examples Lets look at some kind of easily-detectable potential failure situations. Lets say schema A extends schema B at the top level

  1. there are duplicate but incompatible declarations for the same named sch:ns, sch:param, sch:phase
  2. there are duplicate named sch:let and sch:pattern
  3. the QLB for schema B requires xslt3 but schema A wants to limit to xslt2
  4. the default phase for schema A could be different than the default phase for schema B.

I would say that we are missing a good or clear system (unless this has changed??) of overriding.

Suggestion: If schema A extends schema B (i.e. B's /sch:schema/sch:* are notionally included into A's /sch:schema ) then

Overriding Schematron elements

Overriding sch:schema attributes

Overriding xmlns namespace declarations

When importing or extending a schema, the in-scope namespace declarations for the elements in schema B need to be brought into schema A on the elements being imported or included. This does not affect XPaths, but:

Rick