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 @@ </employee> </employeeList></programlisting> - <qandaset defaultlabel="qanda"> + <qandaset defaultlabel="qanda" xml:id="sda1QandaWellFormed"> <title>Well-formed XML data questions</title> <qandadiv> @@ -195,7 +196,7 @@ ?></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><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > <xs:element name="employee"> @@ -472,7 +473,7 @@ WHERE ID=1</programlisting> <para>This allows for an arbitrary number of employee data sets:</para> - <programlisting><employeeList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + <programlisting language="xml"><employeeList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="employee.xsd"> <employee> @@ -497,7 +498,7 @@ WHERE ID=1</programlisting> </employeeList></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"><xs:element name="employee"></emphasis> <xs:complexType> <xs:sequence> @@ -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><xs:element name="track"> + <programlisting language="xml"><xs:element name="track"> <xs:complexType> <xs:sequence> ... @@ -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><employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + <programlisting language="xml"><employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="employee.xsd"> <id>21</id> <givenName>John</givenName> @@ -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><xs:element name="employee"> + <programlisting language="xml"><xs:element name="employee"> <xs:complexType> <xs:sequence> <xs:element name="id" type="xs:unsignedInt"/> @@ -1017,7 +1018,8 @@ WHERE ID=1</programlisting> </xs:complexType> </xs:element></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><xs:element name="employee"> + <programlisting language="xml"><xs:element name="employee"> <xs:complexType> <xs:sequence> ... @@ -1150,7 +1152,7 @@ WHERE ID=1</programlisting> starting with element 'phone'. No child element is expected at this point</quote></emphasis>:</para> - <programlisting><employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="addressChoice.xsd"> + <programlisting language="xml"><employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="addressChoice.xsd"> <id>25</id> <givenName>Laura</givenName> <surname>Anderson</surname> @@ -1182,7 +1184,7 @@ WHERE ID=1</programlisting> linkend="fig_XsdEmployee"/> may be replaced by <tag class="emptytag">xs:attribute</tag> definitions:</para> - <programlisting><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > + <programlisting language="xml"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > <xs:element name="employee"> <xs:complexType> @@ -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><xs:element name="employee"> + <programlisting language="xml"><xs:element name="employee"> <xs:complexType> ... <xs:attribute name="email" type="xs:string" use="required"/> @@ -1290,7 +1292,7 @@ WHERE ID=1</programlisting> </xs:complexType> </xs:element></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><employeeList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + <programlisting language="xml"><employeeList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="employee.xsd"> <employee> @@ -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><xs:element name="employee"> + <programlisting language="xml"><xs:element name="employee"> <xs:complexType> <xs:sequence> <xs:element name="id" type="xs:unsignedInt"/> @@ -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