Skip to content

Commit

Permalink
chore: change scope of given-names and surname checks
Browse files Browse the repository at this point in the history
To include these elements in ref lists and elsewhere, not just in contribs
  • Loading branch information
fred-atherden committed Sep 27, 2023
1 parent fadb173 commit d98ec7d
Show file tree
Hide file tree
Showing 52 changed files with 68 additions and 68 deletions.
2 changes: 1 addition & 1 deletion src/final-JATS-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -1845,7 +1845,7 @@
</rule>
</pattern>
<pattern id="given-names-tests-pattern">
<rule context="contrib-group//name/given-names" id="given-names-tests">
<rule context="name/given-names" id="given-names-tests">

<report test="not(*) and (normalize-space(.)='')" role="error" id="given-names-test-3">[given-names-test-3] given-names must not be empty.</report>

Expand Down
2 changes: 1 addition & 1 deletion src/final-JATS-schematron.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -8437,7 +8437,7 @@


<!--RULE given-names-tests-->
<xsl:template match="contrib-group//name/given-names" priority="1000" mode="M92">
<xsl:template match="name/given-names" priority="1000" mode="M92">

<!--REPORT error-->
<xsl:if test="not(*) and (normalize-space(.)='')">
Expand Down
2 changes: 1 addition & 1 deletion src/final-package-JATS-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -1866,7 +1866,7 @@
</rule>
</pattern>
<pattern id="given-names-tests-pattern">
<rule context="contrib-group//name/given-names" id="given-names-tests">
<rule context="name/given-names" id="given-names-tests">

<report test="not(*) and (normalize-space(.)='')" role="error" id="given-names-test-3">given-names must not be empty.</report>

Expand Down
2 changes: 1 addition & 1 deletion src/pre-JATS-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -1790,7 +1790,7 @@
</rule>
</pattern>
<pattern id="given-names-tests-pattern">
<rule context="contrib-group//name/given-names" id="given-names-tests">
<rule context="name/given-names" id="given-names-tests">

<report test="not(*) and (normalize-space(.)='')" role="error" id="given-names-test-3">[given-names-test-3] given-names must not be empty.</report>

Expand Down
2 changes: 1 addition & 1 deletion src/pre-JATS-schematron.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -8322,7 +8322,7 @@


<!--RULE given-names-tests-->
<xsl:template match="contrib-group//name/given-names" priority="1000" mode="M90">
<xsl:template match="name/given-names" priority="1000" mode="M90">

<!--REPORT error-->
<xsl:if test="not(*) and (normalize-space(.)='')">
Expand Down
2 changes: 1 addition & 1 deletion src/schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -2159,7 +2159,7 @@

</rule>

<rule context="contrib-group//name/given-names" id="given-names-tests">
<rule context="name/given-names" id="given-names-tests">

<report test="not(*) and (normalize-space(.)='')"
role="error"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="final-given-names-test-16.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report matches(.,'[\(\)\[\]]')
Message: given-names contains brackets - ''. This will be flagged by Crossref (although will not actually cause any significant problems). -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0/">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1282,13 +1282,13 @@

</xsl:function>
<pattern id="article-metadata">
<rule context="contrib-group//name/given-names" id="given-names-tests">
<rule context="name/given-names" id="given-names-tests">
<report test="matches(.,'[\(\)\[\]]')" role="warning" id="final-given-names-test-16">given-names contains brackets - '<value-of select="."/>'. This will be flagged by Crossref (although will not actually cause any significant problems).</report>
</rule>
</pattern>
<pattern id="root-pattern">
<rule context="root" id="root-rule">
<assert test="descendant::contrib-group//name/given-names" role="error" id="given-names-tests-xspec-assert">contrib-group//name/given-names must be present.</assert>
<assert test="descendant::name/given-names" role="error" id="given-names-tests-xspec-assert">name/given-names must be present.</assert>
</rule>
</pattern>
</schema>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="final-given-names-test-16.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report matches(.,'[\(\)\[\]]')
Message: given-names contains brackets - ''. This will be flagged by Crossref (although will not actually cause any significant problems). -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0/">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="given-names-test-10.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report matches(.,'[A-Za-z] [Dd]e[rn]?$')
Message: given-names ends with de, der, or den - should this be captured as the beginning of the surname instead? - ''. -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1282,13 +1282,13 @@

</xsl:function>
<pattern id="article-metadata">
<rule context="contrib-group//name/given-names" id="given-names-tests">
<rule context="name/given-names" id="given-names-tests">
<report test="matches(.,'[A-Za-z] [Dd]e[rn]?$')" role="warning" id="given-names-test-10">given-names ends with de, der, or den - should this be captured as the beginning of the surname instead? - '<value-of select="."/>'.</report>
</rule>
</pattern>
<pattern id="root-pattern">
<rule context="root" id="root-rule">
<assert test="descendant::contrib-group//name/given-names" role="error" id="given-names-tests-xspec-assert">contrib-group//name/given-names must be present.</assert>
<assert test="descendant::name/given-names" role="error" id="given-names-tests-xspec-assert">name/given-names must be present.</assert>
</rule>
</pattern>
</schema>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="given-names-test-10.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report matches(.,'[A-Za-z] [Dd]e[rn]?$')
Message: given-names ends with de, der, or den - should this be captured as the beginning of the surname instead? - ''. -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="given-names-test-11.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report matches(.,'[A-Za-z] [Vv]an$')
Message: given-names ends with ' van' - should this be captured as the beginning of the surname instead? - ''. -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1282,13 +1282,13 @@

</xsl:function>
<pattern id="article-metadata">
<rule context="contrib-group//name/given-names" id="given-names-tests">
<rule context="name/given-names" id="given-names-tests">
<report test="matches(.,'[A-Za-z] [Vv]an$')" role="warning" id="given-names-test-11">given-names ends with ' van' - should this be captured as the beginning of the surname instead? - '<value-of select="."/>'.</report>
</rule>
</pattern>
<pattern id="root-pattern">
<rule context="root" id="root-rule">
<assert test="descendant::contrib-group//name/given-names" role="error" id="given-names-tests-xspec-assert">contrib-group//name/given-names must be present.</assert>
<assert test="descendant::name/given-names" role="error" id="given-names-tests-xspec-assert">name/given-names must be present.</assert>
</rule>
</pattern>
</schema>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="given-names-test-11.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report matches(.,'[A-Za-z] [Vv]an$')
Message: given-names ends with ' van' - should this be captured as the beginning of the surname instead? - ''. -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="given-names-test-12.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report matches(.,'[A-Za-z] [Vv]on$')
Message: given-names ends with ' von' - should this be captured as the beginning of the surname instead? - ''. -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1282,13 +1282,13 @@

</xsl:function>
<pattern id="article-metadata">
<rule context="contrib-group//name/given-names" id="given-names-tests">
<rule context="name/given-names" id="given-names-tests">
<report test="matches(.,'[A-Za-z] [Vv]on$')" role="warning" id="given-names-test-12">given-names ends with ' von' - should this be captured as the beginning of the surname instead? - '<value-of select="."/>'.</report>
</rule>
</pattern>
<pattern id="root-pattern">
<rule context="root" id="root-rule">
<assert test="descendant::contrib-group//name/given-names" role="error" id="given-names-tests-xspec-assert">contrib-group//name/given-names must be present.</assert>
<assert test="descendant::name/given-names" role="error" id="given-names-tests-xspec-assert">name/given-names must be present.</assert>
</rule>
</pattern>
</schema>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="given-names-test-12.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report matches(.,'[A-Za-z] [Vv]on$')
Message: given-names ends with ' von' - should this be captured as the beginning of the surname instead? - ''. -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="given-names-test-13.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report matches(.,'[A-Za-z] [Ee]l$')
Message: given-names ends with ' el' - should this be captured as the beginning of the surname instead? - ''. -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1282,13 +1282,13 @@

</xsl:function>
<pattern id="article-metadata">
<rule context="contrib-group//name/given-names" id="given-names-tests">
<rule context="name/given-names" id="given-names-tests">
<report test="matches(.,'[A-Za-z] [Ee]l$')" role="warning" id="given-names-test-13">given-names ends with ' el' - should this be captured as the beginning of the surname instead? - '<value-of select="."/>'.</report>
</rule>
</pattern>
<pattern id="root-pattern">
<rule context="root" id="root-rule">
<assert test="descendant::contrib-group//name/given-names" role="error" id="given-names-tests-xspec-assert">contrib-group//name/given-names must be present.</assert>
<assert test="descendant::name/given-names" role="error" id="given-names-tests-xspec-assert">name/given-names must be present.</assert>
</rule>
</pattern>
</schema>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="given-names-test-13.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report matches(.,'[A-Za-z] [Ee]l$')
Message: given-names ends with ' el' - should this be captured as the beginning of the surname instead? - ''. -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="given-names-test-14.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report matches(.,'[A-Za-z] [Tt]e[rn]?$')
Message: given-names ends with te, ter, or ten - should this be captured as the beginning of the surname instead? - ''. -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0/">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1282,13 +1282,13 @@

</xsl:function>
<pattern id="article-metadata">
<rule context="contrib-group//name/given-names" id="given-names-tests">
<rule context="name/given-names" id="given-names-tests">
<report test="matches(.,'[A-Za-z] [Tt]e[rn]?$')" role="warning" id="given-names-test-14">given-names ends with te, ter, or ten - should this be captured as the beginning of the surname instead? - '<value-of select="."/>'.</report>
</rule>
</pattern>
<pattern id="root-pattern">
<rule context="root" id="root-rule">
<assert test="descendant::contrib-group//name/given-names" role="error" id="given-names-tests-xspec-assert">contrib-group//name/given-names must be present.</assert>
<assert test="descendant::name/given-names" role="error" id="given-names-tests-xspec-assert">name/given-names must be present.</assert>
</rule>
</pattern>
</schema>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="given-names-test-14.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report matches(.,'[A-Za-z] [Tt]e[rn]?$')
Message: given-names ends with te, ter, or ten - should this be captured as the beginning of the surname instead? - ''. -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0/">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="given-names-test-15.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report matches(normalize-space(.),'[A-Za-z]\p{Zs}[A-za-z]\p{Zs}[A-za-z]\p{Zs}[A-za-z]|[A-Za-z]\p{Zs}[A-za-z]\p{Zs}[A-za-z]$|^[A-za-z]\p{Zs}[A-za-z]$')
Message: given-names contains initials with spaces. Ensure that the space(s) is removed between initials - ''. -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0/">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1282,13 +1282,13 @@

</xsl:function>
<pattern id="article-metadata">
<rule context="contrib-group//name/given-names" id="given-names-tests">
<rule context="name/given-names" id="given-names-tests">
<report test="matches(normalize-space(.),'[A-Za-z]\p{Zs}[A-za-z]\p{Zs}[A-za-z]\p{Zs}[A-za-z]|[A-Za-z]\p{Zs}[A-za-z]\p{Zs}[A-za-z]$|^[A-za-z]\p{Zs}[A-za-z]$')" role="info" id="given-names-test-15">given-names contains initials with spaces. Ensure that the space(s) is removed between initials - '<value-of select="."/>'.</report>
</rule>
</pattern>
<pattern id="root-pattern">
<rule context="root" id="root-rule">
<assert test="descendant::contrib-group//name/given-names" role="error" id="given-names-tests-xspec-assert">contrib-group//name/given-names must be present.</assert>
<assert test="descendant::name/given-names" role="error" id="given-names-tests-xspec-assert">name/given-names must be present.</assert>
</rule>
</pattern>
</schema>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="given-names-test-15.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report matches(normalize-space(.),'[A-Za-z]\p{Zs}[A-za-z]\p{Zs}[A-za-z]\p{Zs}[A-za-z]|[A-Za-z]\p{Zs}[A-za-z]\p{Zs}[A-za-z]$|^[A-za-z]\p{Zs}[A-za-z]$')
Message: given-names contains initials with spaces. Ensure that the space(s) is removed between initials - ''. -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0/">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="given-names-test-3.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report not(*) and (normalize-space(.)='')
Message: given-names must not be empty. -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1282,13 +1282,13 @@

</xsl:function>
<pattern id="article-metadata">
<rule context="contrib-group//name/given-names" id="given-names-tests">
<rule context="name/given-names" id="given-names-tests">
<report test="not(*) and (normalize-space(.)='')" role="error" id="given-names-test-3">given-names must not be empty.</report>
</rule>
</pattern>
<pattern id="root-pattern">
<rule context="root" id="root-rule">
<assert test="descendant::contrib-group//name/given-names" role="error" id="given-names-tests-xspec-assert">contrib-group//name/given-names must be present.</assert>
<assert test="descendant::name/given-names" role="error" id="given-names-tests-xspec-assert">name/given-names must be present.</assert>
</rule>
</pattern>
</schema>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="given-names-test-3.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report not(*) and (normalize-space(.)='')
Message: given-names must not be empty. -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="given-names-test-4.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report descendant::bold or descendant::sub or descendant::sup or descendant::italic or descendant::sc
Message: given-names must not contain any formatting (bold, or italic emphasis, or smallcaps, superscript or subscript) - ''. -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1282,13 +1282,13 @@

</xsl:function>
<pattern id="article-metadata">
<rule context="contrib-group//name/given-names" id="given-names-tests">
<rule context="name/given-names" id="given-names-tests">
<report test="descendant::bold or descendant::sub or descendant::sup or descendant::italic or descendant::sc" role="error" id="given-names-test-4">given-names must not contain any formatting (bold, or italic emphasis, or smallcaps, superscript or subscript) - '<value-of select="."/>'.</report>
</rule>
</pattern>
<pattern id="root-pattern">
<rule context="root" id="root-rule">
<assert test="descendant::contrib-group//name/given-names" role="error" id="given-names-tests-xspec-assert">contrib-group//name/given-names must be present.</assert>
<assert test="descendant::name/given-names" role="error" id="given-names-tests-xspec-assert">name/given-names must be present.</assert>
</rule>
</pattern>
</schema>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="given-names-test-4.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: report descendant::bold or descendant::sub or descendant::sup or descendant::italic or descendant::sc
Message: given-names must not contain any formatting (bold, or italic emphasis, or smallcaps, superscript or subscript) - ''. -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?oxygen SCHSchema="given-names-test-5.sch"?>
<!--Context: contrib-group//name/given-names
<!--Context: name/given-names
Test: assert matches(.,"^[\p{L}\p{M}\(\)\s'’-]*$")
Message: given-names should usually only contain letters, spaces, or hyphens. contains other characters. -->
<root xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1282,13 +1282,13 @@

</xsl:function>
<pattern id="article-metadata">
<rule context="contrib-group//name/given-names" id="given-names-tests">
<rule context="name/given-names" id="given-names-tests">
<assert test="matches(.,&quot;^[\p{L}\p{M}\(\)\s'’-]*$&quot;)" role="error" id="given-names-test-5">given-names should usually only contain letters, spaces, or hyphens. <value-of select="."/> contains other characters.</assert>
</rule>
</pattern>
<pattern id="root-pattern">
<rule context="root" id="root-rule">
<assert test="descendant::contrib-group//name/given-names" role="error" id="given-names-tests-xspec-assert">contrib-group//name/given-names must be present.</assert>
<assert test="descendant::name/given-names" role="error" id="given-names-tests-xspec-assert">name/given-names must be present.</assert>
</rule>
</pattern>
</schema>
Loading

0 comments on commit d98ec7d

Please sign in to comment.