Skip to content

Commit

Permalink
Merge pull request #583 from elifesciences/pr-583
Browse files Browse the repository at this point in the history
add empty mrow error
  • Loading branch information
fred-atherden authored Feb 5, 2024
2 parents 1b8d1fc + 378b72b commit 0290026
Show file tree
Hide file tree
Showing 12 changed files with 5,787 additions and 4,375 deletions.
4 changes: 4 additions & 0 deletions src/final-JATS-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -2941,6 +2941,10 @@

<assert test="@mathvariant" role="error" id="math-descendant-test-1">[math-descendant-test-1] Equation has character(s) - <value-of select="."/> - which have a font in a class element - <value-of select="@class"/> - but the element does not have a mathvariant attribute. This means that while the font will display in the PDF, it will not display on continuum. Either it needs a mathvariant attribute, or the specific unicode for that character in the script/font should be used.</assert>

</rule></pattern><pattern id="mrow-tests-pattern"><rule context="mml:mrow" id="mrow-tests">

<report test="not(*) and (normalize-space(.)='')" role="error" id="final-mrow-test-1">[final-mrow-test-1] mrow cannot be empty.</report>

</rule></pattern><pattern id="disp-formula-child-tests-pattern"><rule context="disp-formula/*" id="disp-formula-child-tests">

<report see="https://elifeproduction.slab.com/posts/maths-0gfptlyl#disp-formula-child-test-1" test="not(local-name()=('label','math'))" role="error" id="disp-formula-child-test-1">[disp-formula-child-test-1] <name/> element is not allowed as a child of disp-formula.</report>
Expand Down
4,413 changes: 2,223 additions & 2,190 deletions src/final-JATS-schematron.xsl

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/final-package-JATS-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -2947,6 +2947,10 @@

<assert test="@mathvariant" role="error" id="math-descendant-test-1">Equation has character(s) - <value-of select="."/> - which have a font in a class element - <value-of select="@class"/> - but the element does not have a mathvariant attribute. This means that while the font will display in the PDF, it will not display on continuum. Either it needs a mathvariant attribute, or the specific unicode for that character in the script/font should be used.</assert>

</rule></pattern><pattern id="mrow-tests-pattern"><rule context="mml:mrow" id="mrow-tests">

<report test="not(*) and (normalize-space(.)='')" role="error" id="final-mrow-test-1">mrow cannot be empty.</report>

</rule></pattern><pattern id="disp-formula-child-tests-pattern"><rule context="disp-formula/*" id="disp-formula-child-tests">

<report see="https://elifeproduction.slab.com/posts/maths-0gfptlyl#disp-formula-child-test-1" test="not(local-name()=('label','math'))" role="error" id="disp-formula-child-test-1"><name/> element is not allowed as a child of disp-formula.</report>
Expand Down
4 changes: 4 additions & 0 deletions src/pre-JATS-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -2886,6 +2886,10 @@

<assert test="@mathvariant" role="error" id="math-descendant-test-1">[math-descendant-test-1] Equation has character(s) - <value-of select="."/> - which have a font in a class element - <value-of select="@class"/> - but the element does not have a mathvariant attribute. This means that while the font will display in the PDF, it will not display on continuum. Either it needs a mathvariant attribute, or the specific unicode for that character in the script/font should be used.</assert>

</rule></pattern><pattern id="mrow-tests-pattern"><rule context="mml:mrow" id="mrow-tests">



</rule></pattern><pattern id="disp-formula-child-tests-pattern"><rule context="disp-formula/*" id="disp-formula-child-tests">

<report see="https://elifeproduction.slab.com/posts/maths-0gfptlyl#disp-formula-child-test-1" test="not(local-name()=('label','math'))" role="error" id="disp-formula-child-test-1">[disp-formula-child-test-1] <name/> element is not allowed as a child of disp-formula.</report>
Expand Down
4,389 changes: 2,205 additions & 2,184 deletions src/pre-JATS-schematron.xsl

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -4738,6 +4738,14 @@ else self::*/local-name() = $allowed-p-blocks"
id="math-descendant-test-1">Equation has character(s) - <value-of select="."/> - which have a font in a class element - <value-of select="@class"/> - but the element does not have a mathvariant attribute. This means that while the font will display in the PDF, it will not display on continuum. Either it needs a mathvariant attribute, or the specific unicode for that character in the script/font should be used.</assert>

</rule>

<rule context="mml:mrow" id="mrow-tests">

<report test="not(*) and (normalize-space(.)='')"
role="error"
id="final-mrow-test-1">mrow cannot be empty.</report>

</rule>

<rule context="disp-formula/*" id="disp-formula-child-tests">

Expand Down
8 changes: 8 additions & 0 deletions test/tests/gen/mrow-tests/final-mrow-test-1/fail.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?oxygen SCHSchema="final-mrow-test-1.sch"?><!--Context: mml:mrow
Test: report not(*) and (normalize-space(.)='')
Message: mrow cannot be empty. -->
<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>
<mml:mrow class="MJX-TeXAtom-ORD"/>
</article>
</root>
Loading

0 comments on commit 0290026

Please sign in to comment.