diff --git a/src/xproc/publish.xpl b/src/xproc/publish.xpl index 3b1536e2dbe126d541dcc6c7add662f49ea217d4..c2501b3b9dd8417af11e78ce4401aa9bae4a1d5f 100644 --- a/src/xproc/publish.xpl +++ b/src/xproc/publish.xpl @@ -35,73 +35,60 @@ <d:uuid-source name="uuid-source"/> - <p:choose> - <p:when test="doc-available(resolve-uri($targetUri))"> - <p:error code="TargetFileExists"> - <p:input port="source"> - <p:empty/> - </p:input> - </p:error> - <p:sink/> - </p:when> - <p:otherwise> + <p:documentation>Schritt 1: Validieren der von Kitodo.Production erzeugten METS-Datei</p:documentation> + <p:validate-with-relax-ng name="validate-kitodo"> + <p:input port="source"> + <p:pipe step="main" port="source"/> + </p:input> + <p:input port="schema"> + <p:data href="../schema/kitodo.rnc"/> + </p:input> + </p:validate-with-relax-ng> - <p:validate-with-schematron name="validate-kitodo"> - <p:input port="source"> - <p:pipe step="main" port="source"/> - </p:input> - <p:input port="schema"> - <p:document href="../schema/kitodo.sch"/> - </p:input> - <p:input port="parameters"> - <p:empty/> - </p:input> - </p:validate-with-schematron> - <p:xslt name="normalize"> - <p:with-param name="objectId" select="$objectId"/> - <p:with-param name="eventCreateUUID" select="/uuid/@create"> - <p:pipe step="uuid-source" port="result"/> - </p:with-param> - <p:with-param name="eventNormalizeUUID" select="/uuid/@normalize"> - <p:pipe step="uuid-source" port="result"/> - </p:with-param> - <p:with-param name="eventNormalizeAgent" select="concat(p:system-property('p:product-name'), ' ', p:system-property('p:product-version'))"/> - <p:input port="source"> - <p:pipe step="validate-kitodo" port="result"/> - </p:input> - <p:input port="stylesheet"> - <p:document href="../xslt/mets.xsl"/> - </p:input> - </p:xslt> + <p:documentation>Schritt 2: METS-Datei normalisieren</p:documentation> + <p:xslt name="normalize"> + <p:with-param name="objectId" select="$objectId"/> + <p:with-param name="eventCreateUUID" select="/uuid/@create"> + <p:pipe step="uuid-source" port="result"/> + </p:with-param> + <p:with-param name="eventNormalizeUUID" select="/uuid/@normalize"> + <p:pipe step="uuid-source" port="result"/> + </p:with-param> + <p:with-param name="eventNormalizeAgent" select="concat(p:system-property('p:product-name'), ' ', p:system-property('p:product-version'))"/> + <p:input port="source"> + <p:pipe step="validate-kitodo" port="result"/> + </p:input> + <p:input port="stylesheet"> + <p:document href="../xslt/mets.xsl"/> + </p:input> + </p:xslt> - <p:validate-with-xml-schema assert-valid="true" name="validate-mets"> - <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:documentation>Schritt 3: Normalisierte METS-Datei validieren</p:documentation> + <p:validate-with-xml-schema assert-valid="true" name="validate-mets"> + <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:validate-with-schematron assert-valid="true"> - <p:input port="source"> - <p:pipe step="validate-mets" port="result"/> - </p:input> - <p:input port="schema"> - <p:document href="../schema/diglib.sch"/> - </p:input> - <p:input port="parameters"> - <p:empty/> - </p:input> - </p:validate-with-schematron> + <p:validate-with-schematron assert-valid="true"> + <p:input port="source"> + <p:pipe step="validate-mets" port="result"/> + </p:input> + <p:input port="schema"> + <p:document href="../schema/diglib.sch"/> + </p:input> + <p:input port="parameters"> + <p:empty/> + </p:input> + </p:validate-with-schematron> - <p:store> - <p:with-option name="href" select="$targetUri"/> - </p:store> - - </p:otherwise> - - </p:choose> + <p:documentation>Schritt 4: Normalisierte METS-Datei schreiben</p:documentation> + <p:store> + <p:with-option name="href" select="$targetUri"/> + </p:store> </p:declare-step>