I have created a schematron rule that searches for a particular text given by a variable in a case-insensitive manner (provided by "i" flag):
Code: Select all
<sch:report test="matches(.,concat('(^|\W)',$phrase,'(\W|$)'),'i')" role="error" sqf:fix="replaceWithKey">...</sch:report>
where $phrase = '(phrase)'
I want a user to be able to use a quick fix and replace the text, but I don't know how to provide a case-insensitive solution in the quick fix. My initial version looks like this:
Code: Select all
<sqf:fix id="replaceWithKey">
<sqf:stringReplace regex="{$phrase}">
...
</sqf:stringReplace>
the quick fix works only if the part of the text has exactly the same capitalization as $phrase, though the rule violation is recognized in every case. Is there a way to utilize the "i" flag functionality in the regex attribute?