Skip to content
Snippets Groups Projects
Commit 21f13cdb authored by David Maus's avatar David Maus
Browse files

Validiere gegen Strukturdatentypologie

parent eb9b1bb8
No related branches found
No related tags found
No related merge requests found
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<ns prefix="mets" uri="http://www.loc.gov/METS/"/>
<ns prefix="rdf" uri="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<ns prefix="rdfs" uri="http://www.w3.org/2000/01/rdf-schema#"/>
<pattern>
<title>Strukturdatentypologie</title>
<rule context="mets:div[@TYPE]">
<assert test="concat('http://uri.hab.de/ontology/diglib-struct#', @TYPE) = doc('http://uri.hab.de/ontology/diglib-struct.rdf')//rdfs:Class/@rdf:about" id="structmap.unknown-type">
Das @TYPE-Attribut einer Struktur muss mit einem in der Strukturdatentypologie definierten Wert belegt
werden. Der Wert <value-of select="@TYPE"/> ist unbekannt.
</assert>
</rule>
</pattern>
</schema>
......@@ -75,7 +75,7 @@
</p:input>
</p:xslt>
<p:validate-with-xml-schema assert-valid="true">
<p:validate-with-xml-schema assert-valid="true" name="validate-mets">
<p:input port="source">
<p:pipe step="normalize" port="result"/>
</p:input>
......@@ -84,6 +84,18 @@
</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:store>
<p:with-option name="href" select="$targetUri"/>
</p:store>
......
<xspec:description schematron="../../src/schema/diglib.sch"
xmlns:mets="http://www.loc.gov/METS/"
xmlns:xspec="http://www.jenitennison.com/xslt/xspec">
<xspec:scenario label="Validating a structure with an unknown @TYPE">
<xspec:context>
<mets:mets>
<mets:structMap>
<mets:div TYPE="unkown"/>
</mets:structMap>
</mets:mets>
</xspec:context>
<xspec:expect-assert id="structmap.unknown-type"/>
</xspec:scenario>
<xspec:scenario label="Validating a structure with an known @TYPE">
<xspec:context>
<mets:mets>
<mets:structMap>
<mets:div TYPE="C0005"/>
</mets:structMap>
</mets:mets>
</xspec:context>
<xspec:expect-not-assert id="structmap.unknown-type"/>
</xspec:scenario>
</xspec:description>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment