Providing the same sqf:fix for multiple reports
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 280
- Joined: Thu Nov 28, 2013 9:32 am
- Location: Hamburg/Germany
- Contact:
Providing the same sqf:fix for multiple reports
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
-
- Posts: 388
- Joined: Thu Jul 01, 2004 12:29 pm
Re: Providing the same sqf:fix for multiple reports
Hi Patrik,
The quick fixes are grouped by the error message, and in your case for each error you should have 2 quick fixes.
About grouping of the fixes in other way, I don't know, I think it is better to see the problem and the fixes for problem grouped.
By the way the quick fixes that you created are not correct. The sqf:stringReplace operation should match a text node, but in your example matches an element. You need to add the match="text()" on the sqf:stringReplace operation.
Best Regards,
Octavian
The quick fixes are grouped by the error message, and in your case for each error you should have 2 quick fixes.
- Issue: Leading spaces!
- Fix: Remove leading spaces.
- Fix: Normalize spaces.
Issue: Multiple spaces! - Fix: Remove leading spaces.
- Fix: Normalize spaces.
Issue: Trailing spaces! - Fix: Remove trailing spaces.
- Fix: Normalize spaces.
About grouping of the fixes in other way, I don't know, I think it is better to see the problem and the fixes for problem grouped.
By the way the quick fixes that you created are not correct. The sqf:stringReplace operation should match a text node, but in your example matches an element. You need to add the match="text()" on the sqf:stringReplace operation.
Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service