(how) does Oxygen add Schematron Quick Fixes dynamically?
Posted: Mon May 18, 2015 1:44 pm
Hi,
I've been toying with Oxygen's implementation of Schematron Quick Fixes (SQF), and discovered that Oxygen seems to generate SQF rules based on what's in a schema. As soon as I define a closed attribute list in my (RelaxNG) schema, like this:
If I validate a document against this schema, with a title such as <title type="first">, this is flagged, and two SQF options are proposed:

This is great, though a bit confusing at first (the schema itself doesn't contain any trace of a SQF). I'm wondering: where do these SQF'es come from, does Oxygen insert them automatically, and if so, are there other schema constructs besides closed attribute lists that trigger them? Or is this documented anywhere?
On a related note (and since there is no SQF mailing list I'm aware of), is it possible to create a similar SQF by hand? I mean, I have some Schematron rules that compute suggested values for an attribute from the content in a document. That's perfectly doable with a Schematron variable. Yet, say that variable contains two suggested values, "a" and "b", would it be possible to express in SQF that two possible fixes should be proposed, namely to:
The point is that I don't know in advance what the possible values are; those are computed from what's in the document. Can this be done dynamically with SQF, as seems to be the case for the closed attribute list example in the schema above?
Many thanks for your thoughts,
Ron
I've been toying with Oxygen's implementation of Schematron Quick Fixes (SQF), and discovered that Oxygen seems to generate SQF rules based on what's in a schema. As soon as I define a closed attribute list in my (RelaxNG) schema, like this:
Code: Select all
<element name="title">
<ref name="macro.paraContent"/>
<ref name="att.global.attributes"/>
<optional>
<attribute name="type">
<choice>
<value>main</value>
<value>sub</value>
</choice>
</attribute>
</optional>
</element>
This is great, though a bit confusing at first (the schema itself doesn't contain any trace of a SQF). I'm wondering: where do these SQF'es come from, does Oxygen insert them automatically, and if so, are there other schema constructs besides closed attribute lists that trigger them? Or is this documented anywhere?
On a related note (and since there is no SQF mailing list I'm aware of), is it possible to create a similar SQF by hand? I mean, I have some Schematron rules that compute suggested values for an attribute from the content in a document. That's perfectly doable with a Schematron variable. Yet, say that variable contains two suggested values, "a" and "b", would it be possible to express in SQF that two possible fixes should be proposed, namely to:
- set the value of the attribute in the XML source to "a"
- set the value of the attribute in the XML source to "b"
The point is that I don't know in advance what the possible values are; those are computed from what's in the document. Can this be done dynamically with SQF, as seems to be the case for the closed attribute list example in the schema above?
Many thanks for your thoughts,
Ron