From 4431ff2b36146b024a7af4b5ae35cc5042a163f4 Mon Sep 17 00:00:00 2001
From: David Maus <maus@hab.de>
Date: Tue, 17 Oct 2017 08:55:11 +0200
Subject: [PATCH] =?UTF-8?q?Grammatik=20f=C3=BCr=20Konfiguration=20der=20OP?=
 =?UTF-8?q?AC-Anbindung?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Makefile       |  6 +++-
 src/import.rnc | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 94 insertions(+), 1 deletion(-)
 create mode 100644 src/import.rnc

diff --git a/Makefile b/Makefile
index 2e280b8..42d3b01 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 0000000..0b1e072
--- /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
-- 
GitLab