Skip to content

Commit

Permalink
Add removed pub-dates
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-atherden committed Mar 5, 2024
1 parent fcde037 commit de7a664
Show file tree
Hide file tree
Showing 16 changed files with 4,116 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/final-JATS-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,12 @@
<assert test="@publication-format" role="error" id="pub-date-test-6">[pub-date-test-6] pub-date must have the attribute publication-format.</assert>

<assert test="@date-type" role="error" id="pub-date-test-7">[pub-date-test-7] pub-date must have the attribute date-type.</assert>

<assert test="matches(day[1],'^[0-9]{2}$')" role="error" id="final-pub-date-test-8">[final-pub-date-test-8] pub-date must contain day in the format 00. Currently it is '<value-of select="day"/>'.</assert>

<assert test="matches(month[1],'^[0-9]{2}$')" role="error" id="final-pub-date-test-9">[final-pub-date-test-9] pub-date must contain month in the format 00. Currently it is '<value-of select="month"/>'.</assert>

<assert test="matches(year[1],'^[0-9]{4}$')" role="error" id="final-pub-date-test-10">[final-pub-date-test-10] pub-date must contain year in the format 0000. Currently it is '<value-of select="year"/>'.</assert>

</rule></pattern><pattern id="pub-date-child-tests-pattern"><rule context="pub-date/*" id="pub-date-child-tests">
<let name="allowed-children" value="('day','month','year')"/>
Expand Down
51 changes: 51 additions & 0 deletions src/final-JATS-schematron.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -9680,6 +9680,57 @@
</svrl:failed-assert>
</xsl:otherwise>
</xsl:choose>

<!--ASSERT error-->
<xsl:choose>
<xsl:when test="matches(day[1],'^[0-9]{2}$')"/>
<xsl:otherwise>
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="matches(day[1],'^[0-9]{2}$')">
<xsl:attribute name="id">final-pub-date-test-8</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>[final-pub-date-test-8] pub-date must contain day in the format 00. Currently it is '<xsl:text/>
<xsl:value-of select="day"/>
<xsl:text/>'.</svrl:text>
</svrl:failed-assert>
</xsl:otherwise>
</xsl:choose>

<!--ASSERT error-->
<xsl:choose>
<xsl:when test="matches(month[1],'^[0-9]{2}$')"/>
<xsl:otherwise>
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="matches(month[1],'^[0-9]{2}$')">
<xsl:attribute name="id">final-pub-date-test-9</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>[final-pub-date-test-9] pub-date must contain month in the format 00. Currently it is '<xsl:text/>
<xsl:value-of select="month"/>
<xsl:text/>'.</svrl:text>
</svrl:failed-assert>
</xsl:otherwise>
</xsl:choose>

<!--ASSERT error-->
<xsl:choose>
<xsl:when test="matches(year[1],'^[0-9]{4}$')"/>
<xsl:otherwise>
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="matches(year[1],'^[0-9]{4}$')">
<xsl:attribute name="id">final-pub-date-test-10</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>[final-pub-date-test-10] pub-date must contain year in the format 0000. Currently it is '<xsl:text/>
<xsl:value-of select="year"/>
<xsl:text/>'.</svrl:text>
</svrl:failed-assert>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="*" mode="M112"/>
</xsl:template>
<xsl:template match="text()" priority="-1" mode="M112"/>
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 @@ -1937,6 +1937,12 @@
<assert test="@publication-format" role="error" id="pub-date-test-6">pub-date must have the attribute publication-format.</assert>

<assert test="@date-type" role="error" id="pub-date-test-7">pub-date must have the attribute date-type.</assert>

<assert test="matches(day[1],'^[0-9]{2}$')" role="error" id="final-pub-date-test-8">pub-date must contain day in the format 00. Currently it is '<value-of select="day"/>'.</assert>

<assert test="matches(month[1],'^[0-9]{2}$')" role="error" id="final-pub-date-test-9">pub-date must contain month in the format 00. Currently it is '<value-of select="month"/>'.</assert>

<assert test="matches(year[1],'^[0-9]{4}$')" role="error" id="final-pub-date-test-10">pub-date must contain year in the format 0000. Currently it is '<value-of select="year"/>'.</assert>

</rule></pattern><pattern id="pub-date-child-tests-pattern"><rule context="pub-date/*" id="pub-date-child-tests">
<let name="allowed-children" value="('day','month','year')"/>
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 @@ -1876,6 +1876,12 @@
<assert test="@publication-format" role="error" id="pub-date-test-6">[pub-date-test-6] pub-date must have the attribute publication-format.</assert>

<assert test="@date-type" role="error" id="pub-date-test-7">[pub-date-test-7] pub-date must have the attribute date-type.</assert>







</rule></pattern><pattern id="pub-date-child-tests-pattern"><rule context="pub-date/*" id="pub-date-child-tests">
<let name="allowed-children" value="('day','month','year')"/>
Expand Down
12 changes: 12 additions & 0 deletions src/schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -2561,6 +2561,18 @@
<assert test="@date-type"
role="error"
id="pub-date-test-7">pub-date must have the attribute date-type.</assert>

<assert test="matches(day[1],'^[0-9]{2}$')"
role="error"
id="final-pub-date-test-8">pub-date must contain day in the format 00. Currently it is '<value-of select="day"/>'.</assert>

<assert test="matches(month[1],'^[0-9]{2}$')"
role="error"
id="final-pub-date-test-9">pub-date must contain month in the format 00. Currently it is '<value-of select="month"/>'.</assert>

<assert test="matches(year[1],'^[0-9]{4}$')"
role="error"
id="final-pub-date-test-10">pub-date must contain year in the format 0000. Currently it is '<value-of select="year"/>'.</assert>

</rule>

Expand Down
15 changes: 15 additions & 0 deletions test/tests/gen/pub-date-tests/final-pub-date-test-10/fail.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?oxygen SCHSchema="final-pub-date-test-10.sch"?>
<!--Context: pub-date
Test: assert matches(year[1],'^[0-9]{4}$')
Message: pub-date must contain year in the format 0000. Currently it is ''. -->
<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>
<article-meta>
<pub-date publication-format="electronic" date-type="publication">
<day>22</day>
<month>10</month>
<year>The year of our Lord and Saviour</year>
</pub-date>
</article-meta>
</article>
</root>
Loading

0 comments on commit de7a664

Please sign in to comment.