diff --git a/Makefile b/Makefile index 2e280b82a07f81d11ebb9d28fe339a5cf03f4569..42d3b0122049e045c856c9cb344238789012e25d 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,11 @@ SAXON = java -jar lib/saxon9he.jar %.sch: %.rng $(SAXON) -xsl:lib/rngsch.xsl -o:$@ $< -all: src/ruleset.xsd src/ruleset.rng src/ruleset.sch test +all: ruleset import test + +import: src/import.xsd src/import.rng + +ruleset: src/ruleset.xsd src/ruleset.rng src/ruleset.sch .PHONY: clean clean: diff --git a/src/import.rnc b/src/import.rnc new file mode 100644 index 0000000000000000000000000000000000000000..0b1e0721cda60224ec2d29cabac6d6d73ac117a3 --- /dev/null +++ b/src/import.rnc @@ -0,0 +1,89 @@ +# -*- mode: rnc; -*- +# +# RelaxNG Schema für Kitido.Production Importkonfiguration +# + +# Author: David Maus <maus@hab.de> +# + +namespace s = "http://purl.oclc.org/dsdl/schematron" + +start = opacCatalogues + +opacCatalogues = + element opacCatalogues { + doctypes + & catalogue+ + } + +doctypes = + element doctypes { + type+ + } + +catalogue = + element catalogue { + attribute title { text } + & config + & searchFields + & resolve* + } + +config = + element config { + attribute address { text } + & attribute database { text } + & attribute description { text } + & attribute port { xsd:integer } + & attribute ucnf { text }? + & empty + } + +searchFields = + element searchFields { + searchField+ + } + +searchField = + element searchField { + attribute label { text } + & attribute value { xsd:integer } + } + +resolve = + element resolve { + attribute tag { text } + & attribute subtag { text } + & map + } + +map = + element map { + attribute tag { text }, + attribute subtag { text }, + attribute asSubtag { text } + } + +type = + element type { + attribute isContainedWork { xsd:boolean } + & attribute isMultiVolume { xsd:boolean } + & attribute isPeriodical { xsd:boolean } + & attribute isNewspaper { xsd:boolean } + & attribute rulesetType { xsd:NMTOKEN } + & attribute tifHeaderType { text } + & attribute title { text } + & label* + & mapping+ + } + +label = + element label { + attribute language { xsd:language }, + text + } + +mapping = + element mapping { + text + } \ No newline at end of file