Skip to content

Commit

Permalink
TUBS-79 fix issues in mods2metsmods.xsl
Browse files Browse the repository at this point in the history
- fixed 2.8.1 Das Attribut source fehlt in mods:recordIdentifier
- fixed 2.5.1 mods:recordIdentifier fehlt im mods:relatedItem\[@type='host'\] der primären mets:dmdSec
  • Loading branch information
sebhofmann committed Nov 4, 2024
1 parent c6da85c commit dfafefd
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions src/main/resources/xslt/mods2metsmods.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,37 @@

<xsl:template match="mods:mods">
<xsl:copy>
<xsl:apply-templates select="*|@*" />
<xsl:apply-templates select="*|@*"/>
<mods:recordInfo>
<mods:recordIdentifier><xsl:value-of select="$objectID" /></mods:recordIdentifier>
<mods:recordIdentifier source="leopard">
<xsl:value-of select="$objectID"/>
</mods:recordIdentifier>
</mods:recordInfo>
</xsl:copy>
</xsl:template>

<xsl:template match="mods:recordInfo">
<xsl:comment>removed original recordInfo</xsl:comment>
</xsl:template>

<xsl:template match="mods:relatedItem">
<xsl:variable name="relatedItemCount" select="number()"/>
<xsl:copy>
<xsl:apply-templates select="*[not(mods:recordInfo)]|@*"/>
<mods:recordInfo>
<xsl:variable name="parentID">
<xsl:choose>
<xsl:when test="@xlink:href">
<xsl:value-of select="@xlink:href"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($objectID, '_related_', $relatedItemCount)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<mods:recordIdentifier source="leopard">
<xsl:value-of select="$parentID"/>
</mods:recordIdentifier>
</mods:recordInfo>
</xsl:copy>
</xsl:template>
Expand Down

0 comments on commit dfafefd

Please sign in to comment.