diff --git a/src/xslt/mets.xsl b/src/xslt/mets.xsl index 814cb31fd5d52a6dcf51b622b64a8499c643cdcf..49ecdf77ab8dbb318a00a1dcdaf9648dcb429e8a 100644 --- a/src/xslt/mets.xsl +++ b/src/xslt/mets.xsl @@ -107,6 +107,16 @@ </metsHdr> </xsl:template> + <xsl:template match="@ID[parent::div/fptr][ancestor::structMap/@TYPE = 'PHYSICAL']"> + <xsl:variable name="fileId" select="fun:normalize-fileId(key('files', ../fptr/@FILEID))"/> + <xsl:attribute name="ID" select="fun:normalize-physId($fileId)"/> + </xsl:template> + + <xsl:template match="@xlink:to[parent::smLink]"> + <xsl:variable name="fileId" select="fun:normalize-fileId(key('files', /mets/structMap/div/div[@ID = current()]/fptr/@FILEID))"/> + <xsl:attribute name="xlink:to" select="fun:normalize-physId($fileId)"/> + </xsl:template> + <xsl:template match="@ID[parent::file]"> <xsl:attribute name="ID" select="fun:normalize-fileId(..)"/> </xsl:template>