schematron replace-curly-doublequotes
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 168
- Joined: Fri Feb 28, 2020 4:02 pm
schematron replace-curly-doublequotes
Post by vishwavaranasi »
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>
<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>
image.png
would you pleas help me here?You do not have the required permissions to view the files attached to this post.
Thanks,
vishwa
vishwa
-
- Posts: 388
- Joined: Thu Jul 01, 2004 12:29 pm
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
Return to “General XML Questions”
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