Skip to content

Commit

Permalink
#541 Improved processing of mods:dateIssued element
Browse files Browse the repository at this point in the history
  • Loading branch information
Possommi committed May 6, 2024
1 parent 6799087 commit 135579e
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions common/src/main/resources/xsl/import/dbt2mods.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,25 @@
<xsl:template match="mods:originInfo[@eventType='publication']">
<mods:originInfo>
<xsl:copy-of select="mods:place"/>
<xsl:choose>
<!-- check for year -->
<xsl:when test="string-length(mods:dateIssued/text()) = 4">
<xsl:copy-of select="mods:dateIssued"/>
</xsl:when>
<!-- UBO supports only year of publication, full ISO dates must be converted -->
<xsl:when test="string-length(mods:dateIssued/text()) &gt; 4 ">
<mods:dateIssued encoding="{mods:dateIssued/@encoding}">
<xsl:value-of select="substring-before(mods:dateIssued/text(), '-')"/>
</mods:dateIssued>
</xsl:when>
</xsl:choose>
<xsl:apply-templates select="mods:dateIssued"/>
</mods:originInfo>
</xsl:template>

<xsl:template match="mods:dateIssued">
<xsl:choose>
<!-- check for year -->
<xsl:when test="string-length(text()) = 4">
<xsl:copy-of select="."/>
</xsl:when>
<!-- UBO supports only year of publication, full ISO dates must be converted -->
<xsl:when test="string-length(text()) &gt; 4 ">
<mods:dateIssued encoding="{@encoding}">
<xsl:value-of select="substring-before(text(), '-')"/>
</mods:dateIssued>
</xsl:when>
</xsl:choose>
</xsl:template>

<xsl:template match="mods:originInfo[@eventType='creation']">
<xsl:apply-templates select="mods:dateOther[@type='accepted']"/>
</xsl:template>
Expand Down

0 comments on commit 135579e

Please # to comment.