From db8e0c598b2b8f96d8e608fc2a8d0bb757c0fbed Mon Sep 17 00:00:00 2001
From: Martin Goik <goik@hdm-stuttgart.de>
Date: Tue, 19 Jul 2022 07:45:39 +0200
Subject: [PATCH] Separate schematron rules

---
 .../docbook51/rng/V5.1/goikDocbookExt.sch     | 61 +++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 ws/Xmlmind/Files/addon/config/docbook51/rng/V5.1/goikDocbookExt.sch

diff --git a/ws/Xmlmind/Files/addon/config/docbook51/rng/V5.1/goikDocbookExt.sch b/ws/Xmlmind/Files/addon/config/docbook51/rng/V5.1/goikDocbookExt.sch
new file mode 100644
index 000000000..1dae9c129
--- /dev/null
+++ b/ws/Xmlmind/Files/addon/config/docbook51/rng/V5.1/goikDocbookExt.sch
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Additional restrictions suitable for i.e. stable link generation, XsltNG workarounds etc.
+     -->
+<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron"
+          xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:rng="http://relaxng.org/ns/structure/1.0">
+   <s:ns prefix="db" uri="http://docbook.org/ns/docbook"/>
+   <s:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
+
+   <s:pattern>
+      <s:title>Element exclusion</s:title>
+      <s:rule context="db:mediaobject">
+         <s:assert test="not(.//db:calloutlist)">XsltNG as of July 2022 disallows calloutlist descendants of mediaobject, see https://github.com/docbook/xslTNG/issues/153</s:assert>
+      </s:rule>
+   </s:pattern>
+
+   <s:pattern>
+      <s:title>Mandatory title in exercise</s:title>
+      <s:rule context="db:qandaset">
+        <s:assert test="db:title or name(preceding-sibling::*[1])='db:title'">Must be IMMEDIATELY following title or contain a title itself.</s:assert>
+      </s:rule>
+   </s:pattern>
+
+   <s:pattern>
+      <s:title>Mandatory defaultlabel</s:title>
+       <s:rule context="db:qandaset">
+         <s:assert test="@defaultlabel">Attribute defaultlabel must be defined.</s:assert>
+       </s:rule>
+   </s:pattern>
+
+   <s:pattern>
+      <s:title>Mandatory @language</s:title>
+      <s:rule context="db:programlisting">
+        <s:assert test="@language">Attribute language must be defined.</s:assert>
+      </s:rule>
+   </s:pattern>
+
+   <s:pattern>
+      <s:title>Mandatory Id definition constraint</s:title>
+      <s:rule context="db:preface|db:chapter|db:section|db:appendix|db:figure|db:equation|db:table|db:qandaset">
+         <s:assert test="@xml:id">Each chapter,section, subection,... must have a unique id.</s:assert>
+      </s:rule>
+   </s:pattern>
+
+   <s:pattern>
+      <s:title>Mandatory coref target constraint</s:title>
+      <s:rule context="db:coref">
+         <s:assert test="//db:co[@xml:id=current()/@linkend]">coref target must be a co element.</s:assert>
+      </s:rule>
+   </s:pattern>
+
+  <s:pattern>
+      <s:title>Avoid nested slide annotations</s:title>
+     <s:rule context="*[contains(@annotations, 'slide')]">
+        <s:assert test="not(ancestor::*[contains(@annotations, 'slide')])">Existing »slide« annotated parent.</s:assert>
+     </s:rule>
+  </s:pattern>
+	   
+</s:schema>
+
-- 
GitLab