Wrapping text() with a Quick Fix not working as expected. Why?
Posted: Tue Jul 25, 2017 2:00 am
Hi,
The following Quick Fix does wrap the text() in a paragraph but puts it as a next sibling to the section.
How could I fix this? I've tried many variations all afternoon but nothing worked! Using Oxygen 18.
TIA,
Raymond
The following Quick Fix does wrap the text() in a paragraph but puts it as a next sibling to the section.
How could I fix this? I've tried many variations all afternoon but nothing worked! Using Oxygen 18.
Code: Select all
<rule context="*[contains(@class, ' topic/section ')]/text()[string-length(normalize-space(.)) > 0]">
<report test="true()" role="warn" subject="child::node()[1]" sqf:fix="wrapInParagraph">
The text in a section element should be in a paragraph.</report>
<!-- Wrap the current element in a paragraph. -->
<sqf:fix id="wrapInParagraph">
<sqf:description>
<sqf:title>Wrap text in a paragraph</sqf:title>
</sqf:description>
<sqf:replace node-type="element" target="p">
<xsl:apply-templates mode="copyExceptClass" select="."/>
</sqf:replace>
<sqf:delete/>
</sqf:fix>
</rule>
Raymond