Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Compiler does not terminate when called with undefined phase #87

Open
dmj opened this issue May 19, 2020 · 3 comments
Open

Compiler does not terminate when called with undefined phase #87

dmj opened this issue May 19, 2020 · 3 comments
Labels
bug Description of a bug

Comments

@dmj
Copy link
Member

dmj commented May 19, 2020

If the Schematron compiler is called with a phase and this phase is not defined, it reports an error via xml:message but still compiles the validation stylesheet.

I was thinking about a use case where this behavior is neccessary or helpful to no avail.

@dmj
Copy link
Member Author

dmj commented May 19, 2020

If I follow the 2006 spec closely then the behavior of the Skeleton is clearly wrong. In section 6.3 (Schema Semantics) it requires the active phase to be a member of the schema.

The note on 6.3 reads:

In natural language, a document is valid against a schema in a phase if:
There exists an instance, schema and active-phase combination where, for each context, pattern, rule and assertion (the context being a member of that instance, the active phase being a member of the schema, the pattern being a member of that active phase, the rule being a member of that pattern, the assertion being a member of that rule), the following is true: if the context of an instance matches the rule, and that context has not been matched by a previous rule in the same pattern, then the particular assertion evaluates to true when evaluated with the particular context and instance.

@tgraham-antenna
Copy link
Member

Yes, but if we're quoting the spec, Clause 6.1 of the 2016 spec says:

A Schematron validator is a function over the following:
...
a phase name, or #ALL if all patterns shall be active patterns, or #DEFAULT if the defaultPhase
attribute on the schema element shall be used;

So, in 2016, the consequence of an undefined phase name was just an empty function.

On the face of it, an undefined phase name should just terminate the compilation, but I'd have to look to see if it's currently possible to later run the compiled stylesheet starting from a different phase.

@dmj
Copy link
Member Author

dmj commented May 20, 2020

So, in 2016, the consequence of an undefined phase name was just an empty function.

Ok, missed this part.

On the face of it, an undefined phase name should just terminate the compilation, but I'd have to look to see if it's currently possible to later run the compiled stylesheet starting from a different phase.

It isn't. The Skeleton (as well as SchXslt) compiles a validation stylesheet for a specific phase.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Description of a bug
Projects
None yet
Development

No branches or pull requests

2 participants