From 3aaf98269bac70b3164e8f4b4a90de2b820f5989 Mon Sep 17 00:00:00 2001
From: Martin Goik <goik@hdm-stuttgart.de>
Date: Wed, 18 Nov 2015 21:33:06 +0100
Subject: [PATCH] schematron rules

---
 Doc/Sda1/schema.xml | 48 +++++++++++++++++++++++----------------------
 1 file changed, 25 insertions(+), 23 deletions(-)

diff --git a/Doc/Sda1/schema.xml b/Doc/Sda1/schema.xml
index 509d8e550..7338d6b23 100644
--- a/Doc/Sda1/schema.xml
+++ b/Doc/Sda1/schema.xml
@@ -81,7 +81,8 @@
 );</programlisting>
       </figure>
 
-      <qandaset defaultlabel="qanda">
+      <qandaset defaultlabel="qanda"
+                xml:id="sda1QandaImplicitSchemaConstraints">
         <title>Implicit model parameters</title>
 
         <qandadiv>
@@ -172,7 +173,7 @@
     &lt;/employee&gt;
 &lt;/employeeList&gt;</programlisting>
 
-      <qandaset defaultlabel="qanda">
+      <qandaset defaultlabel="qanda" xml:id="sda1QandaWellFormed">
         <title>Well-formed XML data questions</title>
 
         <qandadiv>
@@ -195,7 +196,7 @@
               ?&gt;</code></emphasis> defines this header as being optional
               (<emphasis role="bold">should</emphasis>). In addition the <link
               linkend="gloss_EBNF">EBNF</link> diagram
-              contains:<programlisting>22]  prolog   ::=   XMLDecl<emphasis
+              contains:<programlisting language="none">22]  prolog   ::=   XMLDecl<emphasis
                     role="bold">?</emphasis> <co xml:id="co_XmlDeclOptional"/>...</programlisting>The
               <quote>?</quote> <coref linkend="co_XmlDeclOptional"/> tells us
               that the header in question may appear once or may be
@@ -242,7 +243,7 @@
         </qandadiv>
       </qandaset>
 
-      <qandaset>
+      <qandaset defaultlabel="qanda" xml:id="sda1QandaMediaStore">
         <title>Building up a media store software</title>
 
         <qandadiv>
@@ -364,7 +365,7 @@ WHERE ID=1</programlisting>
         <figure xml:id="fig_XsdEmployee">
           <title>A schema describing an employee's data structure</title>
 
-          <programlisting>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+          <programlisting language="xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" &gt;
     
     &lt;xs:element name="employee"&gt;
@@ -472,7 +473,7 @@ WHERE ID=1</programlisting>
         <para>This allows for an arbitrary number of employee data
         sets:</para>
 
-        <programlisting>&lt;employeeList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        <programlisting language="xml">&lt;employeeList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="employee.xsd"&gt;
     
     &lt;employee&gt;
@@ -497,7 +498,7 @@ WHERE ID=1</programlisting>
     
 &lt;/employeeList&gt;</programlisting>
 
-        <qandaset>
+        <qandaset defaultlabel="qanda" xml:id="sda1QandaMediaFormatGrammar">
           <title>Adding a grammar to <tag
           class="starttag">mediaFormat</tag>.</title>
 
@@ -807,11 +808,11 @@ WHERE ID=1</programlisting>
         <para>A validating parser thus yields a corresponding error
         message:</para>
 
-        <programlisting>cvc-minInclusive-valid: Value '21' is not facet-valid with respect to minInclusive '200'
+        <programlisting language="none">cvc-minInclusive-valid: Value '21' is not facet-valid with respect to minInclusive '200'
   for type <emphasis role="bold">'#AnonType_idemployee'</emphasis> <co
             xml:id="co_ErrAnonTypeEmployee"/></programlisting>
 
-        <qandaset>
+        <qandaset defaultlabel="qanda" xml:id="sda1QandamMessageErrorType">
           <title>The type error message in detail</title>
 
           <qandadiv>
@@ -856,7 +857,7 @@ WHERE ID=1</programlisting>
               <title>Two identical and thus redundant anonymous type
               definitions</title>
 
-              <programlisting>...
+              <programlisting language="xml">...
 <emphasis role="bold">&lt;xs:element name="employee"&gt;</emphasis>
     &lt;xs:complexType&gt;
         &lt;xs:sequence&gt;
@@ -930,7 +931,7 @@ WHERE ID=1</programlisting>
             ...</programlisting>
         </figure>
 
-        <qandaset>
+        <qandaset defaultlabel="qanda" xml:id="sda1QandaEncFormats">
           <title>Predefined set of track encoding formats</title>
 
           <qandadiv>
@@ -971,7 +972,7 @@ WHERE ID=1</programlisting>
                 <para>This new type replaces our current
                 <code>xs:string</code> data type:</para>
 
-                <programlisting>&lt;xs:element name="track"&gt;
+                <programlisting language="xml">&lt;xs:element name="track"&gt;
     &lt;xs:complexType&gt;
         &lt;xs:sequence&gt;
            ...
@@ -992,7 +993,7 @@ WHERE ID=1</programlisting>
         <para>Elements may be optional. We allow an element <tag
         class="starttag">middleInitial</tag> in employee instances:</para>
 
-        <programlisting>&lt;employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        <programlisting language="xml">&lt;employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="employee.xsd"&gt;
     &lt;id&gt;21&lt;/id&gt;
     &lt;givenName&gt;John&lt;/givenName&gt;
@@ -1005,7 +1006,7 @@ WHERE ID=1</programlisting>
         to be optional. This may be achieved by defining
         <code>minOccurs="0"</code> and <code>maxOccurs="1"</code>:</para>
 
-        <programlisting>&lt;xs:element name="employee"&gt;
+        <programlisting language="xml">&lt;xs:element name="employee"&gt;
     &lt;xs:complexType&gt;
         &lt;xs:sequence&gt;
             &lt;xs:element name="id" type="xs:unsignedInt"/&gt;
@@ -1017,7 +1018,8 @@ WHERE ID=1</programlisting>
     &lt;/xs:complexType&gt;
 &lt;/xs:element&gt;</programlisting>
 
-        <qandaset>
+        <qandaset defaultlabel="qanda"
+                  xml:id="sda1QandaMutualExclusiveElemens">
           <title>Mutual exclusive elements</title>
 
           <qandadiv>
@@ -1132,7 +1134,7 @@ WHERE ID=1</programlisting>
                 <para>An <tag class="starttag">xs:choice</tag> element
                 implements the rule in question:</para>
 
-                <programlisting>&lt;xs:element name="employee"&gt;
+                <programlisting language="xml">&lt;xs:element name="employee"&gt;
     &lt;xs:complexType&gt;
         &lt;xs:sequence&gt;
            ...
@@ -1150,7 +1152,7 @@ WHERE ID=1</programlisting>
                 starting with element 'phone'. No child element is expected at
                 this point</quote></emphasis>:</para>
 
-                <programlisting>&lt;employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="addressChoice.xsd"&gt;
+                <programlisting language="xml">&lt;employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="addressChoice.xsd"&gt;
     &lt;id&gt;25&lt;/id&gt;
     &lt;givenName&gt;Laura&lt;/givenName&gt;
     &lt;surname&gt;Anderson&lt;/surname&gt;
@@ -1182,7 +1184,7 @@ WHERE ID=1</programlisting>
         linkend="fig_XsdEmployee"/> may be replaced by <tag
         class="emptytag">xs:attribute</tag> definitions:</para>
 
-        <programlisting>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" &gt;
+        <programlisting language="xml">&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" &gt;
     
     &lt;xs:element name="employee"&gt;
         &lt;xs:complexType&gt;
@@ -1282,7 +1284,7 @@ WHERE ID=1</programlisting>
         <para><tag class="starttag">xs:attribute</tag> declarations offer an
         optional attribute <code>use</code>:</para>
 
-        <programlisting>&lt;xs:element name="employee"&gt;
+        <programlisting language="xml">&lt;xs:element name="employee"&gt;
    &lt;xs:complexType&gt;
    ...
       &lt;xs:attribute name="email" type="xs:string" use="required"/&gt;
@@ -1290,7 +1292,7 @@ WHERE ID=1</programlisting>
    &lt;/xs:complexType&gt;
 &lt;/xs:element&gt;</programlisting>
 
-        <qandaset>
+        <qandaset defaultlabel="qanda" xml:id="sda1QandaAttDefaultChoices">
           <title>Attribute default choices</title>
 
           <qandadiv>
@@ -1341,7 +1343,7 @@ WHERE ID=1</programlisting>
           <title>Duplicate value <code>id=21</code> for different
           employees</title>
 
-          <programlisting>&lt;employeeList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          <programlisting language="xml">&lt;employeeList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="employee.xsd"&gt;
     
     &lt;employee&gt;
@@ -1363,7 +1365,7 @@ WHERE ID=1</programlisting>
         class="starttag">xs:key</tag> and <tag
         class="starttag">xs:unique</tag> declarations for this purpose:</para>
 
-        <programlisting>&lt;xs:element name="employee"&gt;
+        <programlisting language="xml">&lt;xs:element name="employee"&gt;
     &lt;xs:complexType&gt;
         &lt;xs:sequence&gt;
             &lt;xs:element name="id" type="xs:unsignedInt"/&gt;
@@ -1774,5 +1776,5 @@ WHERE ID=1</programlisting>
     </glossary>
   </appendix>
 
-  <xi:include href="bibliography.xml" xpointer="element(/1)"/>
+  <xi:include href="../Common/bibliography.xml" xpointer="element(/1)"/>
 </book>
-- 
GitLab