Providing the same sqf:fix for multiple reports
Posted: Fri Jun 26, 2015 12:16 pm
Hi,
I have following schematron rule with quick-fixes:
Now when validating this input:
I get this list of quick-fixes:
I'm wondering if there is a way to make more clear the the fix "Normalize spaces" solves all three issues. This could be even more useful when you have very different isues but want to provide a fix that solves as much issues as possible with just one click. An attempt would be to add a horizontal seperator and invert the relation. That is: list the fixes together with the issues the would solve. In this case it would look like this:
Regards,
Patrik
I have following schematron rule with quick-fixes:
Code: Select all
<sch:rule context="Element[text()]">
<sch:report test="matches(text(), '^\s')" sqf:fix="remove-leading-spaces normalize-spaces">
Leading spaces!
</sch:report>
<sch:report test="matches(text(), '\s+')" sqf:fix="remove-multiple-spaces normalize-spaces">
Multiple spaces!
</sch:report>
<sch:report test="matches(text(), '\s$')" sqf:fix="remove-trailing-spaces normalize-spaces">
Trailing spaces!
</sch:report>
<sqf:fix id="remove-leading-spaces">
<sqf:description>
<sqf:title>Remove leading spaces.</sqf:title>
</sqf:description>
<sqf:stringReplace regex="^\s+" select="''"/>
</sqf:fix>
<sqf:fix id="remove-trailing-spaces">
<sqf:description>
<sqf:title>Remove trailing spaces.</sqf:title>
</sqf:description>
<sqf:stringReplace regex="^\s+" select="''"/>
</sqf:fix>
<sqf:fix id="remove-multiple-spaces">
<sqf:description>
<sqf:title>Remove leading spaces.</sqf:title>
</sqf:description>
<sqf:stringReplace regex="^\s\s+" select="' '"/>
</sqf:fix>
<sqf:fix id="normalize-spaces">
<sqf:description>
<sqf:title>Normalize spaces.</sqf:title>
</sqf:description>
<sqf:replace match="text()" select="normalize-space(.)"/>
</sqf:fix>
</sch:rule>
Code: Select all
<Element> Text Text </Element>
- Issue: Leading spaces!
- Fix: Remove leading spaces.
- Issue: Trailing spaces!
- Fix: Normalize spaces.
- Issue: Multiple spaces!
- Fix: Remove leading spaces.
- Issue: Trailing spaces!
- Fix: Normalize spaces.
- Fix: Remove trailing spaces.
- Fix: Normalize spaces.
I'm wondering if there is a way to make more clear the the fix "Normalize spaces" solves all three issues. This could be even more useful when you have very different isues but want to provide a fix that solves as much issues as possible with just one click. An attempt would be to add a horizontal seperator and invert the relation. That is: list the fixes together with the issues the would solve. In this case it would look like this:
- Issue: Leading spaces!
- Fix: Remove leading spaces.
- Issue: Multiple spaces!
- Fix: Remove multiple spaces.
- Issue: Trailing spaces!
- Fix: Remove trailing spaces.
- Fix: Normalize spaces.
- Issue: Leading spaces!
- Issue: Multiple spaces!
- Issue: Trailing spaces!
Regards,
Patrik