Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add service mark house style checks #599

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/final-JATS-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -6228,6 +6228,8 @@
<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#h7s38-copyright-symbol" test="contains(.,'©')" role="error" id="copyright-symbol">[copyright-symbol] <name/> element contains the copyright symbol, '©', which is not allowed.</report>

<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#h7s38-trademark-symbol" test="contains(.,'™')" role="error" id="trademark-symbol">[trademark-symbol] <name/> element contains the trademark symbol, '™', which is not allowed.</report>

<report test="contains(.,'℠')" role="error" id="service-mark-symbol">[service-mark-symbol] <name/> element contains the service mark symbol, '℠', which is not allowed.</report>

<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#h7s38-reg-trademark-symbol" test="contains(.,'®')" role="error" id="reg-trademark-symbol">[reg-trademark-symbol] <name/> element contains the registered trademark symbol, '®', which is not allowed.</report>

Expand Down Expand Up @@ -6285,6 +6287,10 @@
<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#he2sr-ring-op-symbol-sup" test="contains(.,'∘')" role="warning" id="ring-op-symbol-sup">[ring-op-symbol-sup] '<name/>' element contains the Ring Operator symbol, '∘'. Should this be a (non-superscript) degree symbol - ° - instead?</report>

<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#he2sr-ring-diacritic-symbol-sup" test="contains(.,'˚')" role="warning" id="ring-diacritic-symbol-sup">[ring-diacritic-symbol-sup] '<name/>' element contains the ring above symbol, '∘'. Should this be a (non-superscript) degree symbol - ° - instead?</report>

<report test="contains(.,'℠')" role="error" id="service-mark-symbol-1-sup">[service-mark-symbol-1-sup] '<name/>' element contains the service mark symbol, '℠', which is not allowed.</report>

<report test=". = 'SM'" role="warning" id="service-mark-symbol-2-sup">[service-mark-symbol-2-sup] '<name/>' element contains the text 'SM', which means that it resembles the service mark symbol. The service mark symbol is not allowed.</report>
</rule></pattern><pattern id="underline-tests-pattern"><rule context="underline" id="underline-tests">

<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#hd9o3-underline-test-1" test="matches(.,'^\p{P}*$')" role="warning" id="underline-test-1">[underline-test-1] '<name/>' element only contains punctuation - <value-of select="."/> - Should it have underline formatting?</report>
Expand Down
42 changes: 42 additions & 0 deletions src/final-JATS-schematron.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -37404,6 +37404,20 @@
</svrl:successful-report>
</xsl:if>

<!--REPORT error-->
<xsl:if test="contains(.,'℠')">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="contains(.,'℠')">
<xsl:attribute name="id">service-mark-symbol</xsl:attribute>
<xsl:attribute name="role">error</xsl:attribute>
<xsl:attribute name="location">
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
</xsl:attribute>
<svrl:text>[service-mark-symbol] <xsl:text/>
<xsl:value-of select="name(.)"/>
<xsl:text/> element contains the service mark symbol, '℠', which is not allowed.</svrl:text>
</svrl:successful-report>
</xsl:if>

<!--REPORT error-->
<xsl:if test="contains(.,'®')">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="contains(.,'®')">
Expand Down Expand Up @@ -37858,6 +37872,34 @@
<xsl:text/>' element contains the ring above symbol, '∘'. Should this be a (non-superscript) degree symbol - ° - instead?</svrl:text>
</svrl:successful-report>
</xsl:if>

<!--REPORT error-->
<xsl:if test="contains(.,'℠')">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="contains(.,'℠')">
<xsl:attribute name="id">service-mark-symbol-1-sup</xsl:attribute>
<xsl:attribute name="role">error</xsl:attribute>
<xsl:attribute name="location">
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
</xsl:attribute>
<svrl:text>[service-mark-symbol-1-sup] '<xsl:text/>
<xsl:value-of select="name(.)"/>
<xsl:text/>' element contains the service mark symbol, '℠', which is not allowed.</svrl:text>
</svrl:successful-report>
</xsl:if>

<!--REPORT warning-->
<xsl:if test=". = 'SM'">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test=". = 'SM'">
<xsl:attribute name="id">service-mark-symbol-2-sup</xsl:attribute>
<xsl:attribute name="role">warning</xsl:attribute>
<xsl:attribute name="location">
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
</xsl:attribute>
<svrl:text>[service-mark-symbol-2-sup] '<xsl:text/>
<xsl:value-of select="name(.)"/>
<xsl:text/>' element contains the text 'SM', which means that it resembles the service mark symbol. The service mark symbol is not allowed.</svrl:text>
</svrl:successful-report>
</xsl:if>
<xsl:apply-templates select="*" mode="M495"/>
</xsl:template>
<xsl:template match="text()" priority="-1" mode="M495"/>
Expand Down
6 changes: 6 additions & 0 deletions src/final-package-JATS-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -6234,6 +6234,8 @@
<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#h7s38-copyright-symbol" test="contains(.,'©')" role="error" id="copyright-symbol"><name/> element contains the copyright symbol, '©', which is not allowed.</report>

<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#h7s38-trademark-symbol" test="contains(.,'™')" role="error" id="trademark-symbol"><name/> element contains the trademark symbol, '™', which is not allowed.</report>

<report test="contains(.,'℠')" role="error" id="service-mark-symbol"><name/> element contains the service mark symbol, '℠', which is not allowed.</report>

<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#h7s38-reg-trademark-symbol" test="contains(.,'®')" role="error" id="reg-trademark-symbol"><name/> element contains the registered trademark symbol, '®', which is not allowed.</report>

Expand Down Expand Up @@ -6291,6 +6293,10 @@
<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#he2sr-ring-op-symbol-sup" test="contains(.,'∘')" role="warning" id="ring-op-symbol-sup">'<name/>' element contains the Ring Operator symbol, '∘'. Should this be a (non-superscript) degree symbol - ° - instead?</report>

<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#he2sr-ring-diacritic-symbol-sup" test="contains(.,'˚')" role="warning" id="ring-diacritic-symbol-sup">'<name/>' element contains the ring above symbol, '∘'. Should this be a (non-superscript) degree symbol - ° - instead?</report>

<report test="contains(.,'℠')" role="error" id="service-mark-symbol-1-sup">'<name/>' element contains the service mark symbol, '℠', which is not allowed.</report>

<report test=". = 'SM'" role="warning" id="service-mark-symbol-2-sup">'<name/>' element contains the text 'SM', which means that it resembles the service mark symbol. The service mark symbol is not allowed.</report>
</rule></pattern><pattern id="underline-tests-pattern"><rule context="underline" id="underline-tests">

<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#hd9o3-underline-test-1" test="matches(.,'^\p{P}*$')" role="warning" id="underline-test-1">'<name/>' element only contains punctuation - <value-of select="."/> - Should it have underline formatting?</report>
Expand Down
6 changes: 6 additions & 0 deletions src/pre-JATS-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -6173,6 +6173,8 @@
<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#h7s38-copyright-symbol" test="contains(.,'©')" role="error" id="copyright-symbol">[copyright-symbol] <name/> element contains the copyright symbol, '©', which is not allowed.</report>

<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#h7s38-trademark-symbol" test="contains(.,'™')" role="error" id="trademark-symbol">[trademark-symbol] <name/> element contains the trademark symbol, '™', which is not allowed.</report>

<report test="contains(.,'℠')" role="error" id="service-mark-symbol">[service-mark-symbol] <name/> element contains the service mark symbol, '℠', which is not allowed.</report>

<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#h7s38-reg-trademark-symbol" test="contains(.,'®')" role="error" id="reg-trademark-symbol">[reg-trademark-symbol] <name/> element contains the registered trademark symbol, '®', which is not allowed.</report>

Expand Down Expand Up @@ -6230,6 +6232,10 @@
<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#he2sr-ring-op-symbol-sup" test="contains(.,'∘')" role="warning" id="ring-op-symbol-sup">[ring-op-symbol-sup] '<name/>' element contains the Ring Operator symbol, '∘'. Should this be a (non-superscript) degree symbol - ° - instead?</report>

<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#he2sr-ring-diacritic-symbol-sup" test="contains(.,'˚')" role="warning" id="ring-diacritic-symbol-sup">[ring-diacritic-symbol-sup] '<name/>' element contains the ring above symbol, '∘'. Should this be a (non-superscript) degree symbol - ° - instead?</report>

<report test="contains(.,'℠')" role="error" id="service-mark-symbol-1-sup">[service-mark-symbol-1-sup] '<name/>' element contains the service mark symbol, '℠', which is not allowed.</report>

<report test=". = 'SM'" role="warning" id="service-mark-symbol-2-sup">[service-mark-symbol-2-sup] '<name/>' element contains the text 'SM', which means that it resembles the service mark symbol. The service mark symbol is not allowed.</report>
</rule></pattern><pattern id="underline-tests-pattern"><rule context="underline" id="underline-tests">

<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#hd9o3-underline-test-1" test="matches(.,'^\p{P}*$')" role="warning" id="underline-test-1">[underline-test-1] '<name/>' element only contains punctuation - <value-of select="."/> - Should it have underline formatting?</report>
Expand Down
42 changes: 42 additions & 0 deletions src/pre-JATS-schematron.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -37163,6 +37163,20 @@
</svrl:successful-report>
</xsl:if>

<!--REPORT error-->
<xsl:if test="contains(.,'℠')">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="contains(.,'℠')">
<xsl:attribute name="id">service-mark-symbol</xsl:attribute>
<xsl:attribute name="role">error</xsl:attribute>
<xsl:attribute name="location">
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
</xsl:attribute>
<svrl:text>[service-mark-symbol] <xsl:text/>
<xsl:value-of select="name(.)"/>
<xsl:text/> element contains the service mark symbol, '℠', which is not allowed.</svrl:text>
</svrl:successful-report>
</xsl:if>

<!--REPORT error-->
<xsl:if test="contains(.,'®')">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="contains(.,'®')">
Expand Down Expand Up @@ -37617,6 +37631,34 @@
<xsl:text/>' element contains the ring above symbol, '∘'. Should this be a (non-superscript) degree symbol - ° - instead?</svrl:text>
</svrl:successful-report>
</xsl:if>

<!--REPORT error-->
<xsl:if test="contains(.,'℠')">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="contains(.,'℠')">
<xsl:attribute name="id">service-mark-symbol-1-sup</xsl:attribute>
<xsl:attribute name="role">error</xsl:attribute>
<xsl:attribute name="location">
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
</xsl:attribute>
<svrl:text>[service-mark-symbol-1-sup] '<xsl:text/>
<xsl:value-of select="name(.)"/>
<xsl:text/>' element contains the service mark symbol, '℠', which is not allowed.</svrl:text>
</svrl:successful-report>
</xsl:if>

<!--REPORT warning-->
<xsl:if test=". = 'SM'">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test=". = 'SM'">
<xsl:attribute name="id">service-mark-symbol-2-sup</xsl:attribute>
<xsl:attribute name="role">warning</xsl:attribute>
<xsl:attribute name="location">
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
</xsl:attribute>
<svrl:text>[service-mark-symbol-2-sup] '<xsl:text/>
<xsl:value-of select="name(.)"/>
<xsl:text/>' element contains the text 'SM', which means that it resembles the service mark symbol. The service mark symbol is not allowed.</svrl:text>
</svrl:successful-report>
</xsl:if>
<xsl:apply-templates select="*" mode="M493"/>
</xsl:template>
<xsl:template match="text()" priority="-1" mode="M493"/>
Expand Down
12 changes: 12 additions & 0 deletions src/schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -11971,6 +11971,10 @@ else self::*/local-name() = $allowed-p-blocks"
test="contains(.,'™')"
role="error"
id="trademark-symbol"><name/> element contains the trademark symbol, '™', which is not allowed.</report>

<report test="contains(.,'℠')"
role="error"
id="service-mark-symbol"><name/> element contains the service mark symbol, '℠', which is not allowed.</report>

<report see="https://elifeproduction.slab.com/posts/house-style-yi0641ob#h7s38-reg-trademark-symbol"
test="contains(.,'®')"
Expand Down Expand Up @@ -12105,6 +12109,14 @@ else self::*/local-name() = $allowed-p-blocks"
test="contains(.,'˚')"
role="warning"
id="ring-diacritic-symbol-sup">'<name/>' element contains the ring above symbol, '∘'. Should this be a (non-superscript) degree symbol - ° - instead?</report>

<report test="contains(.,'℠')"
role="error"
id="service-mark-symbol-1-sup">'<name/>' element contains the service mark symbol, '℠', which is not allowed.</report>

<report test=". = 'SM'"
role="warning"
id="service-mark-symbol-2-sup">'<name/>' element contains the text 'SM', which means that it resembles the service mark symbol. The service mark symbol is not allowed.</report>
</rule>

<rule context="underline" id="underline-tests">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?oxygen SCHSchema="service-mark-symbol-1-sup.sch"?>
<!--Context: sup
Test: report contains(.,'℠')
Message: '' element contains the service mark symbol, '℠', which is not allowed. -->
<root xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<article>
<sup>℠</sup>
</article>
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?oxygen SCHSchema="service-mark-symbol-1-sup.sch"?>
<!--Context: sup
Test: report contains(.,'℠')
Message: '' element contains the service mark symbol, '℠', which is not allowed. -->
<root xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<article>
<sup>S or M</sup>
</article>
</root>
Loading
Loading