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

Initialer Commit

parents
No related branches found
No related tags found
No related merge requests found
*.xsd
*.rng
*.sch
/test/*-compiled.xspec
/test/xspec
\ No newline at end of file
Makefile 0 → 100644
XSPEC = xspec.cmd
TRANG = java -jar lib/trang.jar
SAXON = java -jar lib/saxon9he.jar
%.rng: %.rnc
$(TRANG) -I rnc -O rng $< $@
%.xsd: %.rnc
$(TRANG) -I rnc -O xsd $< $@
%.sch: %.rng
$(SAXON) -xsl:lib/rngsch.xsl -o:$@ $<
test: src/ruleset.sch
$(XSPEC) -s test/ruleset.xspec
all: src/ruleset.xsd src/ruleset.rng src/ruleset.sch test
Schemata für Kitodo.Production
==
<xsl:transform version="2.0"
xmlns:sch="http://purl.oclc.org/dsdl/schematron"
xmlns:rng="http://relaxng.org/ns/structure/1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="rng:grammar">
<sch:schema queryBinding="xslt2">
<xsl:apply-templates/>
</sch:schema>
</xsl:template>
<xsl:template match="sch:*">
<xsl:sequence select="."/>
</xsl:template>
<xsl:template match="text()"/>
</xsl:transform>
File added
File added
# -*- mode: rnc; -*-
#
# RelaxNG Schema für Kitido.Production Regelsatz
#
# Author: David Maus <maus@hab.de>
# Timestamp: <2017-10-10 15:16:42 maus>
#
namespace s = "http://purl.oclc.org/dsdl/schematron"
start = Preferences
Preferences =
element Preferences {
element debug { "0" | "1" }?,
MetadataTypeDef*
}
MetadataTypeDef =
element Metadata {
attribute type { "person" | "identifier" }?,
(
Name
& NameTranslation*
)
}
Name =
## Interner Name des Metadaten- oder Strukturtyps. Der Name wird zur Referenzierung benutzt und muss daher dokumentweit eindeutig sein.
element Name { xsd:NMTOKEN }
NameTranslation =
## Übersetzung eines Namens in die über das Attribut @name spezifizierte Sprache.
element language {
attribute name { xsd:language },
text
}
StructTypeDef =
element DocStrctType {
attribute anchor { "true" }?
& Name
& NameTranslation
& AllowedChildStruct*
& AllowedMetadata*
}
AllowedChildStruct =
[
s:pattern [
s:rule [
context = "allowedchildtype" s:assert [
test = "/Preferences/DocStrctType[Name = .]"
"Der Strukturtyp '" s:value-of [ select = "." ] "' muss definiert werden."
]
]
]
]
element allowedchildtype {
xsd:NMTOKEN
}
AllowedMetadata =
[
s:pattern [
s:rule [
context = "metadata[parent::DocStrctType]" s:assert [
test = "/Preferences/MetadataType[Name = .]"
"Das Metadatum '" s:value-of [ select = "." ] "' muss definiert werden."
]
]
]
]
element metadata {
attribute num { "*" | "+" | "1o" | "1m" }?,
attribute DefaultDisplay { text }?,
xsd:NMTOKEN
}
\ No newline at end of file
<description xmlns="http://www.jenitennison.com/xslt/xspec" schematron="../src/ruleset.sch">
<scenario label="Definition der Strukturtypen">
<scenario label="Untergeordneter Strukturtyp ist definiert">
<context>
<Preferences xmlns="">
<DocStrctType>
<Name>is-defined</Name>
</DocStrctType>
<DocStrctType>
<allowedchildtype>is-defined</allowedchildtype>
</DocStrctType>
</Preferences>
</context>
<expect-assert/>
</scenario>
<scenario label="Untergeordneter Strukturtyp ist nicht definiert">
<context>
<Preferences xmlns="">
<DocStrctType>
<allowedchildtype>is-not-defined</allowedchildtype>
</DocStrctType>
</Preferences>
</context>
<expect-assert/>
</scenario>
</scenario>
</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