Skip to content

Commit

Permalink
RP - tweak aff-no-wrap check
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-atherden committed Dec 3, 2024
1 parent 1acf284 commit 3faedce
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/rp-schematron-base.sch
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@
role="error"
id="aff-multiple-ids">Affiliation contains more than one institution-id element: <value-of select="string-join(descendant::institution-id,'; ')"/> in <value-of select="."/></report>

<report test="ancestor::article/journal-meta/lower-case(journal-id[1])='elife' and count(institution-wrap) = 0"
<report test="ancestor::article//journal-meta/lower-case(journal-id[1])='elife' and count(institution-wrap) = 0"
role="warning"
id="aff-no-wrap">Affiliation doesn't have an institution-wrap element (the container for institution name and id). Is that correct?</report>

Expand Down
2 changes: 1 addition & 1 deletion src/rp-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@

<report test="count(descendant::institution-id) gt 1" role="error" id="aff-multiple-ids">[aff-multiple-ids] Affiliation contains more than one institution-id element: <value-of select="string-join(descendant::institution-id,'; ')"/> in <value-of select="."/></report>

<report test="ancestor::article/journal-meta/lower-case(journal-id[1])='elife' and count(institution-wrap) = 0" role="warning" id="aff-no-wrap">[aff-no-wrap] Affiliation doesn't have an institution-wrap element (the container for institution name and id). Is that correct?</report>
<report test="ancestor::article//journal-meta/lower-case(journal-id[1])='elife' and count(institution-wrap) = 0" role="warning" id="aff-no-wrap">[aff-no-wrap] Affiliation doesn't have an institution-wrap element (the container for institution name and id). Is that correct?</report>

<report test="institution-wrap[not(institution-id)] and not(ancestor::contrib-group[@content-type='section']) and not(ancestor::sub-article)" role="error" id="aff-has-wrap-no-id">[aff-has-wrap-no-id] aff contains institution-wrap, but that institution-wrap does not have a child institution-id. institution-wrap should only be used when there is an institution-id for the institution.</report>

Expand Down
4 changes: 2 additions & 2 deletions src/rp-schematron.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -2046,8 +2046,8 @@
</svrl:successful-report>
</xsl:if>
<!--REPORT warning-->
<xsl:if test="ancestor::article/journal-meta/lower-case(journal-id[1])='elife' and count(institution-wrap) = 0">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="ancestor::article/journal-meta/lower-case(journal-id[1])='elife' and count(institution-wrap) = 0">
<xsl:if test="ancestor::article//journal-meta/lower-case(journal-id[1])='elife' and count(institution-wrap) = 0">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="ancestor::article//journal-meta/lower-case(journal-id[1])='elife' and count(institution-wrap) = 0">
<xsl:attribute name="id">aff-no-wrap</xsl:attribute>
<xsl:attribute name="role">warning</xsl:attribute>
<xsl:attribute name="location">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
<pattern id="affiliation-checks-pattern">
<rule context="aff" id="affiliation-checks">
<let name="country-count" value="count(descendant::country)"/>
<report test="ancestor::article/journal-meta/lower-case(journal-id[1])='elife' and count(institution-wrap) = 0" role="warning" id="aff-no-wrap">[aff-no-wrap] Affiliation doesn't have an institution-wrap element (the container for institution name and id). Is that correct?</report>
<report test="ancestor::article//journal-meta/lower-case(journal-id[1])='elife' and count(institution-wrap) = 0" role="warning" id="aff-no-wrap">[aff-no-wrap] Affiliation doesn't have an institution-wrap element (the container for institution name and id). Is that correct?</report>
</rule>
</pattern>
<pattern id="root-pattern">
Expand Down
2 changes: 1 addition & 1 deletion test/tests/rp/affiliation-checks/aff-no-wrap/fail.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?oxygen SCHSchema="aff-no-wrap.sch"?>
<!--Context: aff
Test: report ancestor::article/journal-meta/lower-case(journal-id[1])='elife' and count(institution-wrap) = 0
Test: report ancestor::article//journal-meta/lower-case(journal-id[1])='elife' and count(institution-wrap) = 0
Message: Affiliation doesn't have an institution-wrap element (the container for institution name and id). Is that correct? -->
<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>
Expand Down
2 changes: 1 addition & 1 deletion test/tests/rp/affiliation-checks/aff-no-wrap/pass.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?oxygen SCHSchema="aff-no-wrap.sch"?>
<!--Context: aff
Test: report ancestor::article/journal-meta/lower-case(journal-id[1])='elife' and count(institution-wrap) = 0
Test: report ancestor::article//journal-meta/lower-case(journal-id[1])='elife' and count(institution-wrap) = 0
Message: Affiliation doesn't have an institution-wrap element (the container for institution name and id). Is that correct? -->
<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>
Expand Down
2 changes: 1 addition & 1 deletion test/xspec/rp-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
<report test="count(descendant::institution-id) gt 1" role="error" id="aff-multiple-ids">Affiliation contains more than one institution-id element: <value-of select="string-join(descendant::institution-id,'; ')"/> in <value-of select="."/>
</report>

<report test="ancestor::article/journal-meta/lower-case(journal-id[1])='elife' and count(institution-wrap) = 0" role="warning" id="aff-no-wrap">Affiliation doesn't have an institution-wrap element (the container for institution name and id). Is that correct?</report>
<report test="ancestor::article//journal-meta/lower-case(journal-id[1])='elife' and count(institution-wrap) = 0" role="warning" id="aff-no-wrap">Affiliation doesn't have an institution-wrap element (the container for institution name and id). Is that correct?</report>

<report test="institution-wrap[not(institution-id)] and not(ancestor::contrib-group[@content-type='section']) and not(ancestor::sub-article)" role="error" id="aff-has-wrap-no-id">aff contains institution-wrap, but that institution-wrap does not have a child institution-id. institution-wrap should only be used when there is an institution-id for the institution.</report>

Expand Down

0 comments on commit 3faedce

Please sign in to comment.