Skip to content
Snippets Groups Projects
Commit db8e0c59 authored by Goik Martin's avatar Goik Martin
Browse files

Separate schematron rules

parent c276f144
No related branches found
No related tags found
No related merge requests found
<?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>
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