Schematron / schematron

Schematron "skeleton" - XSLT implementation
MIT License
93 stars 45 forks source link

sch:include and attribute detection #28

Open rjelliffe opened 7 years ago

rjelliffe commented 7 years ago

Ken Holman reported

The auto-detect of the use of attributes in context expressions does not accommodate rules that are incorporated in the schema using the directive ... it appears to only look at the rules found in the base schema:

true false The away around the above is to assemble all of the fragments into a single Schematron schema, and then the "//iso:rule" will visit all of the rules in the full schema. But the above will not work if the schema stays in fragments.
rjelliffe commented 7 years ago

This seems plausible from looking at the code.

However, in the most recent pipeline, the iso_dsdl_include.xsl pipeline should have expanded the references.

So I think the simple fix is to switch off optimization if there is any sch:include/@href or sch:extends/@href elements, which indicates that the iso_dsdl_include.xsl stage was not run. It will continue to work for the simple case of single file schemas.