Parameter substitution in global grouped SQF fixes

Hi, I've read in the Schematron Quick Fixes spec that a fix definition or fix group can be global inside <sqf:fixes> or it can be local inside a given Schematron <rule> element. I am seeing cases where a fix group with an abstract parameter works as expected when the fix is inside <rule>, but the parameter substitution does not happen when the fix is inside <sqf:fixes>. The Schematron part of the substitution works as expected, so the problem seems restricted to the quick-fix. The substitution also works when I don't group fixes inside <sqf:group>. The April 2015 draft of the SQF spec says "To be done" in the "Variables and parameter" section. I am not sure whether I'm doing something wrong, or whether the implementation is incomplete. I'm hoping someone on the list knows more. Here's a simple test case that you can put inside the DocBook 5.0 RelaxNG schema. (The "s" namespace is http://purl.oclc.org/dsdl/schematron and I also had to add the sqf namespace definition.) <sqf:fixes> <sqf:group id="testfix"> <sqf:fix id="testfix1"> <sqf:param name="expectedrolevalue" abstract="true"/> <sqf:description> <sqf:title>Set role=$expectedrolevalue</sqf:title> <sqf:p>Set the role attribute to the value '$expectedrolevalue'.</sqf:p> </sqf:description> <sqf:add node-type="attribute" target="role">$expectedrolevalue</sqf:add> </sqf:fix> </sqf:group> </sqf:fixes> <s:pattern abstract="true" id="testcase_ABSTRACT"> <s:rule context="db:para/db:$childname"> <s:assert test="@role='$expectedrolevalue'" sqf:fix="testfix">Expected role attribute to be set to $expectedrolevalue.</s:assert> </s:rule> </s:pattern> <s:pattern is-a="testcase_ABSTRACT"> <s:param name="childname" value="literal"/> <s:param name="expectedrolevalue" value="blah"/> </s:pattern> The quick fix doesn't properly substitute "blah" for $expectedrolevalue. But it does if you either remove <sqf:group> and change id="testfix1" to id="testfix", OR move the entire <sqf:group> element into <s:rule>. Thanks, Amanda

Hello Amanda, Yes, the quick fix groups with abstract parameters, that are defined globally, does not work in oXygen. Thank you for reporting this problem. I added an issue on our issue tracker regarding it. I can give you a patch when the problem will be fixed, if you want. Best Regards, Octavian -- Octavian Nadolu <oXygen/> XML Editor http://www.oxygenxml.com On 22.12.2015 19:29, Amanda Galtman wrote:
Hi,
I've read in the Schematron Quick Fixes spec that a fix definition or fix group can be global inside <sqf:fixes> or it can be local inside a given Schematron <rule> element. I am seeing cases where a fix group with an abstract parameter works as expected when the fix is inside <rule>, but the parameter substitution does not happen when the fix is inside <sqf:fixes>. The Schematron part of the substitution works as expected, so the problem seems restricted to the quick-fix. The substitution also works when I don't group fixes inside <sqf:group>.
The April 2015 draft of the SQF spec says "To be done" in the "Variables and parameter" section. I am not sure whether I'm doing something wrong, or whether the implementation is incomplete. I'm hoping someone on the list knows more.
Here's a simple test case that you can put inside the DocBook 5.0 RelaxNG schema. (The "s" namespace is http://purl.oclc.org/dsdl/schematron and I also had to add the sqf namespace definition.)
<sqf:fixes> <sqf:group id="testfix"> <sqf:fix id="testfix1"> <sqf:param name="expectedrolevalue" abstract="true"/> <sqf:description> <sqf:title>Set role=$expectedrolevalue</sqf:title> <sqf:p>Set the role attribute to the value '$expectedrolevalue'.</sqf:p> </sqf:description> <sqf:add node-type="attribute" target="role">$expectedrolevalue</sqf:add> </sqf:fix> </sqf:group> </sqf:fixes>
<s:pattern abstract="true" id="testcase_ABSTRACT"> <s:rule context="db:para/db:$childname"> <s:assert test="@role='$expectedrolevalue'" sqf:fix="testfix">Expected role attribute to be set to $expectedrolevalue.</s:assert> </s:rule> </s:pattern>
<s:pattern is-a="testcase_ABSTRACT"> <s:param name="childname" value="literal"/> <s:param name="expectedrolevalue" value="blah"/> </s:pattern>
The quick fix doesn't properly substitute "blah" for $expectedrolevalue. But it does if you either remove <sqf:group> and change id="testfix1" to id="testfix", OR move the entire <sqf:group> element into <s:rule>.
Thanks, Amanda _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user

Octavian, Thanks for adding this to the issue tracker. I can easily work around this problem in the short term, so I'll just keep an eye on Oxygen release notes to see when it gets fixed. Best regards, Amanda
-----Original Message----- From: oxygen-user-bounces@oxygenxml.com [mailto:oxygen-user- bounces@oxygenxml.com] On Behalf Of Oxygen XML Editor Support (Octavian Nadolu) Sent: Wednesday, December 23, 2015 4:55 AM To: oxygen-user@oxygenxml.com Subject: Re: [oXygen-user] Parameter substitution in global grouped SQF fixes
Hello Amanda,
Yes, the quick fix groups with abstract parameters, that are defined globally, does not work in oXygen. Thank you for reporting this problem. I added an issue on our issue tracker regarding it. I can give you a patch when the problem will be fixed, if you want.
Best Regards, Octavian -- Octavian Nadolu <oXygen/> XML Editor http://www.oxygenxml.com
Hi,
I've read in the Schematron Quick Fixes spec that a fix definition or fix group can be global inside <sqf:fixes> or it can be local inside a given Schematron <rule> element. I am seeing cases where a fix group with an abstract parameter works as expected when the fix is inside <rule>, but the
On 22.12.2015 19:29, Amanda Galtman wrote: parameter substitution does not happen when the fix is inside <sqf:fixes>. The Schematron part of the substitution works as expected, so the problem seems restricted to the quick-fix. The substitution also works when I don't group fixes inside <sqf:group>.
The April 2015 draft of the SQF spec says "To be done" in the "Variables and
parameter" section. I am not sure whether I'm doing something wrong, or whether the implementation is incomplete. I'm hoping someone on the list knows more.
Here's a simple test case that you can put inside the DocBook 5.0 RelaxNG
schema. (The "s" namespace is http://purl.oclc.org/dsdl/schematron and I also had to add the sqf namespace definition.)
<sqf:fixes> <sqf:group id="testfix"> <sqf:fix id="testfix1"> <sqf:param name="expectedrolevalue" abstract="true"/> <sqf:description> <sqf:title>Set role=$expectedrolevalue</sqf:title> <sqf:p>Set the role attribute to the value
'$expectedrolevalue'.</sqf:p>
</sqf:description> <sqf:add node-type="attribute"
target="role">$expectedrolevalue</sqf:add>
</sqf:fix> </sqf:group> </sqf:fixes>
<s:pattern abstract="true" id="testcase_ABSTRACT"> <s:rule context="db:para/db:$childname"> <s:assert test="@role='$expectedrolevalue'"
sqf:fix="testfix">Expected role attribute to be set to $expectedrolevalue.</s:assert>
</s:rule> </s:pattern>
<s:pattern is-a="testcase_ABSTRACT"> <s:param name="childname" value="literal"/> <s:param name="expectedrolevalue" value="blah"/> </s:pattern>
The quick fix doesn't properly substitute "blah" for $expectedrolevalue.
But it does if you either remove <sqf:group> and change id="testfix1" to id="testfix", OR move the entire <sqf:group> element into <s:rule>.
Thanks, Amanda _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (2)
-
Amanda Galtman
-
Oxygen XML Editor Support (Octavian Nadolu)