Skip to content

Commit

Permalink
UBO-339 Prevent ArrayIndexOutOfBoundException caused in mods-dc.xsl (#…
Browse files Browse the repository at this point in the history
…400)

* UBO-339 Prevent ArrayIndexOutOfBoundException caused in mods-dc.xsl

* UBO-339 Added null check to avoid empty dc:language elements
  • Loading branch information
Possommi authored Jun 21, 2024
1 parent addccd5 commit 98583c2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ubo-common/src/main/resources/xsl/mods-dc.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,13 @@
<!-- DC.Language -->

<xsl:template match="mods:languageTerm[@authority='rfc5646'][@type='code']" mode="dc">
<dc:language>
<xsl:value-of select="document(concat('language:',.))/language/@termCode" />
</dc:language>
<xsl:variable name="lang" select="document(concat('notnull:language:',.))/language/@termCode"/>

<xsl:if test="string-length($lang) &gt; 0 and not($lang = 'null')">
<dc:language>
<xsl:value-of select="$lang"/>
</dc:language>
</xsl:if>
</xsl:template>

<!-- DC.Identifier -->
Expand Down

0 comments on commit 98583c2

Please sign in to comment.