Hello team , we have implemented a schematron rule for replacing curly double quotes.
<sch:pattern id="isTopicContainsCurlyDoubleQuotes">
<sch:rule context="/*[contains(@class, ' topic/topic ')]">
<sch:let name="text" value="normalize-space(.)"/>
<sch:report test=".//text()[contains(., '“')]" role="error" sqf:fix="replace-curly-doublequotes">Replace curly double
quotes ” with <q> your text goes here </q> . </sch:report>
<sqf:fix id="replace-curly-doublequotes">
<sqf:description>
<sqf:title>Replace curly double quotes</sqf:title>
</sqf:description>
<!-- <sqf:stringReplace match="//text()[contains(., '”')]" regex="”" select="</q>"/>
<sqf:stringReplace match="//text()[contains(., '“')]" regex="“" select="<q>"/> -->
<sqf:stringReplace match="//text()[contains(., '”')]" regex="”" select=" '</q>' "/>
<sqf:stringReplace match="//text()[contains(., '“')]" regex="“" select=" '<q>' "/>
</sqf:fix>
</sch:rule>
</sch:pattern>
the <sqf:fix> for example it replaces
“test1 test2 - Success” to <q>test1 test2 - Success</q>
in author mode it's treating like a normal text only <q>test1 test2 - Success</q>
would you pleas help me here?
schematron replace-curly-doublequotes
-
- Posts: 33
- Joined: Fri Feb 28, 2020 4:02 pm
schematron replace-curly-doublequotes
Thanks,
vishwa
vishwa
Re: schematron replace-curly-doublequotes
Hello,
In Author mode we automatically render "<" with "<", and ">" with ">". But if you switch to Text page you will notice that is correct, based on your replace.
How do you want the result to bein text, like this " <q>test1 test2 - Success</q>" or like this " <q>test1 test2 - Success</q>"?
Best Regards,
Octavian
In Author mode we automatically render "<" with "<", and ">" with ">". But if you switch to Text page you will notice that is correct, based on your replace.
How do you want the result to bein text, like this " <q>test1 test2 - Success</q>" or like this " <q>test1 test2 - Success</q>"?
Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com