diff --git a/src/xproc/publish.xpl b/src/xproc/publish.xpl new file mode 100644 index 0000000000000000000000000000000000000000..ffb281068115cd0c1b31390132e61aab1b15b13b --- /dev/null +++ b/src/xproc/publish.xpl @@ -0,0 +1,28 @@ +<p:declare-step version="1.0" name="main" + xmlns:p="http://www.w3.org/ns/xproc"> + + <p:input port="source" primary="true" sequence="false"/> + <p:output port="result" primary="true" sequence="false"/> + + <p:xslt name="normalize"> + <p:input port="source"> + <p:pipe step="main" port="source"/> + </p:input> + <p:input port="stylesheet"> + <p:document href="../xslt/mets.xsl"/> + </p:input> + <p:input port="parameters"> + <p:empty/> + </p:input> + </p:xslt> + + <p:validate-with-xml-schema assert-valid="true"> + <p:input port="source"> + <p:pipe step="normalize" port="result"/> + </p:input> + <p:input port="schema"> + <p:document href="../schema/mets.xsd"/> + </p:input> + </p:validate-with-xml-schema> + +</p:declare-step> diff --git a/src/xslt/mets.xsl b/src/xslt/mets.xsl new file mode 100644 index 0000000000000000000000000000000000000000..6530acfb9eac7db24805f45d15b47b9ccdd02839 --- /dev/null +++ b/src/xslt/mets.xsl @@ -0,0 +1,27 @@ +<xsl:transform version="2.0" + exclude-result-prefixes="#all" + xpath-default-namespace="http://www.loc.gov/METS/" + xmlns="http://www.loc.gov/METS/" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <!-- Normalisiert die von Kitodo.Production erzeugte METS-Datei --> + + <xsl:template match="node() | @*"> + <xsl:copy><xsl:apply-templates select="node() | @*"/></xsl:copy> + </xsl:template> + + <xsl:template match="mets"> + <xsl:copy> + <xsl:apply-templates/> + </xsl:copy> + </xsl:template> + + <xsl:template match="metsHdr"> + <metsHdr CREATEDATE="{@CREATEDATE}" LASTMODDATE="{current-dateTime()}"> + <agent ROLE="CUSTODIAN" TYPE="ORGANIZATION"> + <name>Herzog August Bibliothek Wolfenbüttel</name> + </agent> + </metsHdr> + </xsl:template> + +</xsl:transform>