From 77a3f24689e52704b64cf552c51a58afdbe3dece Mon Sep 17 00:00:00 2001
From: Martin Goik <goik@hdm-stuttgart.de>
Date: Wed, 8 Oct 2014 00:05:51 +0200
Subject: [PATCH] Eradicating DTDs

---
 Doc/Ref/Fig/attribInElement.fig    |   34 +-
 Doc/Ref/Fig/wellformedandvalid.fig |   60 +-
 Doc/course.xml                     | 1639 +++++-----------------------
 3 files changed, 335 insertions(+), 1398 deletions(-)

diff --git a/Doc/Ref/Fig/attribInElement.fig b/Doc/Ref/Fig/attribInElement.fig
index b1dc7e7d4..2d2ae32ff 100644
--- a/Doc/Ref/Fig/attribInElement.fig
+++ b/Doc/Ref/Fig/attribInElement.fig
@@ -35,18 +35,34 @@ Single
 -6
 2 2 0 2 7 7 900 -1 -1 0.000 0 0 -1 0 0 5
 	 0 0 10800 0 10800 6300 0 6300 0 0
-4 0 0 840 -1 14 26 0.0000 4 390 7395 2160 3285 type="xs:ID" use="optional"/>\001
+2 2 0 0 2 7 830 -1 -1 0.000 0 0 -1 0 0 5
+	 5895 1215 6705 1215 6705 1530 5895 1530 5895 1215
+2 2 0 0 2 2 830 -1 20 0.000 0 0 -1 0 0 5
+	 6750 1575 5850 1575 5850 1215 6750 1215 6750 1575
+2 2 0 0 5 5 820 -1 20 0.000 0 0 -1 0 0 5
+	 3645 1800 6030 1800 6030 2250 3645 2250 3645 1800
+2 2 0 0 1 1 810 -1 20 0.000 0 0 -1 0 0 5
+	 9810 2160 7605 2160 7605 1665 9810 1665 9810 2160
+2 2 0 0 2 2 830 -1 20 0.000 0 0 -1 0 0 5
+	 5940 2430 6750 2430 6750 2745 5940 2745 5940 2430
+2 2 0 0 5 5 820 -1 20 0.000 0 0 -1 0 0 5
+	 3645 2925 4995 2925 4995 3375 3645 3375 3645 2925
+2 2 0 0 1 1 810 -1 20 0.000 0 0 -1 0 0 5
+	 8775 3375 6750 3375 6750 2880 8775 2880 8775 3375
 4 0 0 900 -1 14 26 0.0000 4 345 3315 0 4770 </xs:element>\001
 4 0 0 900 -1 14 26 0.0000 4 360 5865 0 270 <xs:element name="img">\001
 4 0 4 899 -1 14 26 0.0000 4 360 765 4590 270 img\001
 4 0 0 880 -1 14 26 0.0000 4 390 4335 360 4050 </xs:complexType>\001
-4 0 0 860 -1 14 26 0.0000 4 270 6120 810 1485 <xs:attribute name="src"\001
 4 0 0 880 -1 14 26 0.0000 4 360 4080 270 855 <xs:complexType>\001
-4 0 2 830 -1 14 26 0.0000 4 195 765 5895 1485 src\001
 4 0 0 840 -1 14 26 0.0000 4 270 5865 810 2700 <xs:attribute name="id"\001
-4 0 2 830 -1 14 26 0.0000 4 270 510 5895 2700 id\001
-4 0 5 820 -1 14 26 0.0000 4 255 1275 3690 3285 xs:ID\001
-4 0 5 820 -1 14 26 0.0000 4 360 2295 3690 2070 xs:string\001
-4 0 1 810 -1 14 26 0.0000 4 360 2040 6750 3285 optional\001
-4 0 0 860 -1 14 26 0.0000 4 390 8415 2160 2070 type="xs:string" use="required"/>\001
-4 0 1 810 -1 14 26 0.0000 4 360 2040 7785 2070 required\001
+4 0 0 860 -1 14 26 0.0000 4 360 4080 2160 2070 type="xs:string"\001
+4 0 0 860 -1 14 26 0.0000 4 270 6120 810 1485 <xs:attribute name="src"\001
+4 0 0 829 -1 14 26 0.0000 4 270 6120 810 1485 <xs:attribute name="src"\001
+4 0 0 860 -1 14 26 0.0000 4 390 4080 6390 2070 use="required"/>\001
+4 0 0 819 -1 14 26 0.0000 4 360 4080 2160 2070 type="xs:string"\001
+4 0 0 809 -1 14 26 0.0000 4 390 4080 6390 2070 use="required"/>\001
+4 0 0 840 -1 14 26 0.0000 4 345 3060 2160 3285 type="xs:ID"\001
+4 0 0 840 -1 14 26 0.0000 4 390 4080 5445 3240 use="optional"/>\001
+4 0 0 829 -1 14 26 0.0000 4 270 5865 810 2700 <xs:attribute name="id"\001
+4 0 0 819 -1 14 26 0.0000 4 345 3060 2160 3285 type="xs:ID"\001
+4 0 0 809 -1 14 26 0.0000 4 390 4080 5445 3240 use="optional"/>\001
diff --git a/Doc/Ref/Fig/wellformedandvalid.fig b/Doc/Ref/Fig/wellformedandvalid.fig
index d70c55066..a9317e50a 100644
--- a/Doc/Ref/Fig/wellformedandvalid.fig
+++ b/Doc/Ref/Fig/wellformedandvalid.fig
@@ -1,4 +1,4 @@
-#FIG 3.2  Produced by xfig version 3.2.5
+#FIG 3.2  Produced by xfig version 3.2.5c
 Landscape
 Center
 Metric
@@ -125,26 +125,14 @@ Single
 6 7605 0 10800 1485
 2 4 0 3 0 3 876 -1 20 0.000 0 0 7 0 0 5
 	 10755 1440 10755 45 7650 45 7650 1440 10755 1440
-4 0 0 875 -1 2 24 0.0000 4 285 2865 7785 1125 well-formedness\001
-4 0 0 875 -1 2 24 0.0000 4 285 2520 7785 585 Constraints of\001
--6
--6
-6 8550 1755 10305 2745
-6 8550 1755 10305 2745
-2 4 0 3 0 6 851 -1 20 0.000 0 0 7 0 0 5
-	 10260 2700 8595 2700 8595 1800 10260 1800 10260 2700
-4 0 0 850 -1 2 24 0.0000 4 285 870 8775 2340 DTD\001
+4 0 0 875 -1 2 24 0.0000 4 270 2865 7785 1125 well-formedness\001
+4 0 0 875 -1 2 24 0.0000 4 270 2520 7785 585 Constraints of\001
 -6
 -6
 6 0 3690 2115 4320
 2 4 0 3 0 7 830 -1 -1 0.000 0 0 7 0 0 5
 	 2070 4275 2070 3735 45 3735 45 4275 2070 4275
-4 0 0 830 -1 2 24 0.0000 4 285 1890 135 4095 XML-Doc.\001
--6
-6 315 5895 1530 6615
-2 4 0 3 0 4 765 -1 -1 0.000 0 0 7 0 0 5
-	 1485 6570 1485 5940 360 5940 360 6570 1485 6570
-4 0 0 765 -1 2 24 0.0000 4 285 870 495 6345 DTD\001
+4 0 0 830 -1 2 24 0.0000 4 270 1890 135 4095 XML-Doc.\001
 -6
 1 1 0 3 0 3 881 -1 20 0.000 1 0.0000 2712 1130 2688 1075 2712 1130 5400 1130
 1 1 0 3 0 6 871 -1 20 0.000 1 0.0000 2520 1575 1890 405 2520 1575 4410 1575
@@ -190,20 +178,26 @@ Single
 2 1 0 3 0 4 730 -1 -1 6.000 0 0 -1 1 0 3
 	2 1 6.00 60.00 120.00
 	 3330 6075 3330 6345 6075 6345
-4 0 0 850 -1 2 24 6.1436 4 285 1935 5445 2295 conform to\001
-4 0 0 875 -1 2 24 0.0873 4 375 825 5985 720 obey\001
-4 0 0 800 -1 2 24 0.0000 4 285 2310 6885 4050 Wellformed?\001
-4 0 0 770 -1 2 24 0.0000 4 285 300 10170 4365 Y\001
-4 0 0 760 -1 2 24 0.0000 4 285 1185 8730 4995 Valid?\001
-4 0 0 750 -1 2 24 0.0000 4 285 300 7740 5265 N\001
-4 0 0 750 -1 2 24 0.0000 4 285 960 7695 5940 Well-\001
-4 0 0 750 -1 2 24 0.0000 4 285 1275 7695 6435 formed\001
-4 0 0 870 -1 2 24 0.0000 4 285 3075 990 1710 Valid documents \001
-4 0 0 880 -1 2 24 0.0000 4 285 4230 585 900 Well-formed documents\001
-4 0 0 740 -1 2 24 0.0000 4 285 300 10350 5310 Y\001
-4 0 0 740 -1 2 24 0.0000 4 285 1290 9360 5940 Wellf.+\001
-4 0 0 740 -1 2 24 0.0000 4 285 975 9405 6390 Valid\001
-4 0 0 775 -1 2 24 0.0000 4 285 300 6255 4320 N\001
-4 0 0 820 -1 2 24 0.0000 4 285 1170 2745 5715 Parser\001
-4 0 0 763 -1 2 24 0.0000 4 375 1785 2475 5310 validating\001
-4 0 0 730 -1 2 24 0.0000 4 285 1110 4365 6165 Result\001
+2 4 0 3 0 6 851 -1 20 0.000 0 0 7 0 0 5
+	 10260 2700 8595 2700 8595 1800 10260 1800 10260 2700
+2 4 0 3 0 4 765 -1 -1 0.000 0 0 7 0 0 5
+	 1980 6570 1980 5940 360 5940 360 6570 1980 6570
+4 0 0 850 -1 2 24 6.1436 4 270 1935 5445 2295 conform to\001
+4 0 0 875 -1 2 24 0.0873 4 360 825 5985 720 obey\001
+4 0 0 800 -1 2 24 0.0000 4 270 2310 6885 4050 Wellformed?\001
+4 0 0 770 -1 2 24 0.0000 4 270 300 10170 4365 Y\001
+4 0 0 760 -1 2 24 0.0000 4 270 1185 8730 4995 Valid?\001
+4 0 0 750 -1 2 24 0.0000 4 270 300 7740 5265 N\001
+4 0 0 750 -1 2 24 0.0000 4 270 960 7695 5940 Well-\001
+4 0 0 750 -1 2 24 0.0000 4 270 1275 7695 6435 formed\001
+4 0 0 870 -1 2 24 0.0000 4 270 3075 990 1710 Valid documents \001
+4 0 0 880 -1 2 24 0.0000 4 270 4230 585 900 Well-formed documents\001
+4 0 0 740 -1 2 24 0.0000 4 270 300 10350 5310 Y\001
+4 0 0 740 -1 2 24 0.0000 4 270 1290 9360 5940 Wellf.+\001
+4 0 0 740 -1 2 24 0.0000 4 270 975 9405 6390 Valid\001
+4 0 0 775 -1 2 24 0.0000 4 270 300 6255 4320 N\001
+4 0 0 820 -1 2 24 0.0000 4 270 1170 2745 5715 Parser\001
+4 0 0 763 -1 2 24 0.0000 4 360 1785 2475 5310 validating\001
+4 0 0 730 -1 2 24 0.0000 4 270 1125 4365 6165 Result\001
+4 0 0 850 -1 2 24 0.0000 4 270 1305 8775 2340 schema\001
+4 0 0 765 -1 2 24 0.0000 4 270 1305 495 6345 schema\001
diff --git a/Doc/course.xml b/Doc/course.xml
index a3432aa15..b5cd0ad3a 100644
--- a/Doc/course.xml
+++ b/Doc/course.xml
@@ -1334,17 +1334,35 @@ terminated by the matching end-tag "&lt;/to&gt;". parsing error</computeroutput>
           <figure xml:id="figure_memo_dtd">
             <title>A DTD to describe memo documents.</title>
 
-            <programlisting language="none">&lt;!ELEMENT memo     (from, to+, subject, content)&gt; <co
-                xml:id="memodtd_memodef"/>
-            
-&lt;!ATTLIST memo  <co xml:id="memodtd_memo_attribs"/>
-  date     CDATA             #REQUIRED
-  priority (low|medium|high) #IMPLIED&gt;
-            
-&lt;!ELEMENT from     (#PCDATA)&gt; <co xml:id="memodtd_elem_from"/>
-&lt;!ELEMENT to       (#PCDATA)&gt;
-&lt;!ELEMENT subject  (#PCDATA)&gt;
-&lt;!ELEMENT content  (#PCDATA)&gt;</programlisting>
+            <programlisting language="xml">&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+   xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified"
+   vc:minVersion="1.0" vc:maxVersion="1.1"&gt;
+
+   &lt;xs:element name="memo"&gt;
+      &lt;xs:complexType&gt;
+         &lt;xs:sequence&gt; <co xml:id="memodtd_memodef"/>
+            &lt;xs:element name="from" type="xs:string"/&gt; <co
+                xml:id="memodtd_elem_from"/>
+            &lt;xs:element name="to" minOccurs="1" maxOccurs="unbounded" type="xs:string"/&gt;
+            &lt;xs:element name="subject" type="xs:string"/&gt;
+            &lt;xs:element name="content" type="xs:string"/&gt;
+         &lt;/xs:sequence&gt;
+         &lt;xs:attribute name="date" type="xs:date" use="required"/&gt; <co
+                xml:id="memodtd_memo_attribs"/>
+         &lt;xs:attribute name="priority" type="Priority" use="optional"/&gt;
+      &lt;/xs:complexType&gt;
+
+   &lt;/xs:element&gt;
+
+   &lt;xs:simpleType name="Priority"&gt;
+      &lt;xs:restriction base="xs:string"&gt;
+         &lt;xs:enumeration value="low"/&gt;
+         &lt;xs:enumeration value="medium"/&gt;
+         &lt;xs:enumeration value="high"/&gt;
+      &lt;/xs:restriction&gt;
+   &lt;/xs:simpleType&gt;
+
+&lt;/xs:schema&gt;</programlisting>
 
             <calloutlist>
               <callout arearefs="memodtd_memodef">
@@ -1358,7 +1376,8 @@ terminated by the matching end-tag "&lt;/to&gt;". parsing error</computeroutput>
                 <varname>priority</varname> being restricted to the three
                 allowed values <tag class="attvalue">low</tag>, <tag
                 class="attvalue">medium</tag> and <tag
-                class="attvalue">high</tag>.</para>
+                class="attvalue">high</tag> being defined by a separate <tag
+                class="starttag">xs:simpleType</tag> directive.</para>
               </callout>
 
               <callout arearefs="memodtd_elem_from">
@@ -1372,35 +1391,25 @@ terminated by the matching end-tag "&lt;/to&gt;". parsing error</computeroutput>
                 using the predefined entity <tag class="genentity">amp</tag>
                 as an escape sequence for the ampersand.</para>
 
-                <para>The term <code>#PCDATA</code> is an acronym for
-                <emphasis>P</emphasis><foreignphrase>arsed</foreignphrase>
-                <emphasis>C</emphasis><foreignphrase>haracter</foreignphrase>
-                <emphasis>Data</emphasis>, an abbreviation for a restricted
-                version of ordinary strings. Without digging into details a
-                <code>#PCDATA</code> string must not contain any markup code
-                like e.g. <tag class="starttag">msqrt</tag>. This ensures that
-                a string does not interfere with the document's XML markup.
-                Parsed Character Data also means that from the viewpoint of
-                XML the element's content is <emphasis>atomic</emphasis> so it
-                can't be divided into substructures by an XML parser.</para>
+                <para><code>type="xs:string"</code> is a built in XML Schema
+                type representing a restricted version of ordinary strings.
+                Without digging into details a <code>xs:string</code> string
+                must not contain any markup code like e.g. <tag
+                class="starttag">msqrt</tag>. This ensures that a string does
+                not interfere with the document's XML markup.</para>
               </callout>
             </calloutlist>
           </figure>
 
-          <para>We notice the non-XML syntax of a DTD. It looks similar to an
-          XML document (&lt;!ELEMENT ...&gt;) but in fact it is not even
-          well-formed due to e.g. the exclamation mark in front of the
-          <code>ELEMENT</code> keyword. <abbrev
-          xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>'s
-          use a different syntax which has been specified in order to describe
-          an XML document's grammar.</para>
+          <para>We notice our schema's syntax itself is an XML
+          document.</para>
 
-          <para>From the viewpoint of software modeling a DTD is a
-          <emphasis>schema</emphasis>. In the context of XML technologies the
-          term <emphasis>schema</emphasis> refers to <link
-          xlink:href="http://www.w3.org/XML/Schema">XML Schema</link> being an
-          alternative language to describe the structure of XML
-          documents.</para>
+          <para>From the viewpoint of software modeling an XML Schema instance
+          is a <emphasis>schema</emphasis> describing the syntax of a class of
+          XML document instances adhering to it. In the context of XML
+          technologies <link xlink:href="http://www.w3.org/XML/Schema">XML
+          Schema</link> is one of several language alternatives which allow
+          for XML document structure descriptions.</para>
 
           <para>Readers being familiar with <abbrev
           xlink:href="http://en.wikipedia.org/wiki/Backus-Naur_form">BNF</abbrev>
@@ -1459,41 +1468,56 @@ terminated by the matching end-tag "&lt;/to&gt;". parsing error</computeroutput>
             </production>
           </productionset>
 
+          <para>We may as well supply a graphical representation:</para>
+
+          <figure xml:id="extendContModelGraph">
+            <title>Graphical representation of the extended
+            <code>content</code> model.</title>
+
+            <mediaobject>
+              <imageobject>
+                <imagedata fileref="Ref/Fig/contentmixed.fig"/>
+              </imageobject>
+            </mediaobject>
+          </figure>
+
           <para>In comparison to our informal description of memo documents a
-          DTD offers an added value: The grammar is machine readable and may
-          thus be used by a parser to check whether an XML document obeys the
-          constraints being imposed. So the parser must be instructed to use a
-          DTD in addition to the XML document in question. For this purpose an
-          XML document may define a reference to a DTD:</para>
+          schema offers an added value: The grammar is machine readable and
+          may thus become input to a parser which in turn gets enabled to
+          check whether an XML document obeys the constraints being imposed.
+          So the parser must be instructed to use a schema in addition to the
+          XML document in question. For this purpose an XML document may
+          define a reference to a schema:</para>
 
           <figure xml:id="memo_external_dtd">
             <title>A memo document instance holding a reference to a document
             external DTD.</title>
 
-            <programlisting language="none">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;!DOCTYPE memo<co xml:id="memo_external_dtd_top_element"/> SYSTEM<co
-                xml:id="memo_external_dtd_system_decl"/> "memo.dtd"<co
-                xml:id="memo_external_dtd_url"/> &gt;
-&lt;memo date="10.02.2006" priority="high"&gt;
-  &lt;from&gt;M. Goik&lt;/from&gt;
-  &lt;to&gt;B. King&lt;/to&gt;
-  &lt;to&gt;A. June&lt;/to&gt;
-  &lt;subject&gt;Best whishes&lt;/subject&gt;
-  &lt;content&gt;Hi all, congratulations to your splendid party&lt;/content&gt;
+            <programlisting language="none">&lt;memo <co
+                xml:id="memo_external_dtd_top_element"/> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:noNamespaceSchemaLocation="memo.xsd" <co
+                xml:id="memo_external_dtd_url"/>
+            date="2014-09-24" priority="high"&gt;
+    &lt;from&gt;M. Goik&lt;/from&gt;
+    &lt;to&gt;B. King&lt;/to&gt;
+    &lt;to&gt;A. June&lt;/to&gt;
+    &lt;subject&gt;Best whishes&lt;/subject&gt;
+    &lt;content&gt;Hi all, congratulations to your splendid party&lt;/content&gt;
 &lt;/memo&gt;</programlisting>
 
             <calloutlist>
               <callout arearefs="memo_external_dtd_top_element">
-                <para>The element <tag class="element">memo</tag> is chosen to
-                be the top (root) element of the document's tree. It must be
-                defined in the file <filename>memo.dtd</filename>. This is
-                really a choice since a DTD defines a <emphasis>set</emphasis>
-                of elements in <emphasis>arbitrary</emphasis> order. There is
-                no such rule as <quote>define before use</quote>. So a DTD
-                does not tell us which element has to appear on top of a
+                <para>The element <tag class="starttag">memo</tag> is chosen
+                to be the top (root) element of the document's tree. It must
+                be defined in our schema <filename>memo.xsd</filename>. This
+                is really a choice since an XML schema defines a
+                <emphasis>set</emphasis> of elements in
+                <emphasis>arbitrary</emphasis> order. There is no such rule as
+                <quote>define before use</quote>. So an XML schema does not
+                tell us which element has to appear on top of a
                 document.</para>
 
-                <para>Suppose a given DTD offers both <tag
+                <para>Suppose a given XML schema offers both <tag
                 class="starttag">book</tag> and <tag
                 class="starttag">report</tag> elements. An XML author writing
                 a complex document will choose <tag
@@ -1501,23 +1525,13 @@ terminated by the matching end-tag "&lt;/to&gt;". parsing error</computeroutput>
                 <tag class="starttag">report</tag> being more appropriate for
                 a small piece of documentation. Consequently it is an XML
                 authors <emphasis>choice</emphasis> which of the elements
-                being defined in a DTD shall appear as
+                being defined in a schema shall appear as
                 <emphasis>the</emphasis> top level element</para>
               </callout>
 
-              <callout arearefs="memo_external_dtd_system_decl">
-                <para>The <code>SYSTEM</code> keyword states that the DTD
-                rules reside outside the XML document as a separate entity.
-                Though this situation is the most common the grammar rules may
-                also be <link linkend="dtd_and_document">defined inside</link>
-                the XML document itself. For professional use this is not
-                particularly useful but during DTD development it may be an
-                option.</para>
-              </callout>
-
               <callout arearefs="memo_external_dtd_url">
-                <para>The address of the DTD rule set. In the given example it
-                is just a filename but it may as well be an <link
+                <para>The address of the schema's rule set. In the given
+                example it is just a filename but it may as well be an <link
                 xlink:href="http://www.w3.org/Addressing">URL</link> of type
                 <abbrev
                 xlink:href="http://en.wikipedia.org/wiki/File_Transfer_Protocol">ftp</abbrev>,
@@ -1527,21 +1541,22 @@ terminated by the matching end-tag "&lt;/to&gt;". parsing error</computeroutput>
             </calloutlist>
           </figure>
 
-          <para>In presence of a DTD parsing a document is actually a two step
-          process: First the parser will check the document for well
-          -formedness. Then the parser will read the referenced DTD (memo.dtd)
-          and check the document for the additional constraints being defined
-          there.</para>
-
-          <para>In the current example both the DTD and the XML memo document
-          reside as text files in a common file system folder. For general use
-          a DTD is usually kept at a centralized location. The string
-          following the <code>SYSTEM</code> keyword is actually a
+          <para>In presence of a schema parsing a document is actually a two
+          step process: First the parser will check the document for well
+          -formedness. Then the parser will read the referenced schema
+          <filename>memo.xsd</filename> and check the document for the
+          additional constraints being defined within.</para>
+
+          <para>In the current example both the schema and the XML memo
+          document reside as text files in a common file system folder. For
+          general use a schema is usually kept at a centralized location. The
+          attribute <varname>xsi:noNamespaceSchemaLocation</varname> value is
+          actually a
           <emphasis>U</emphasis><foreignphrase>niform</foreignphrase>
           <emphasis>R</emphasis><foreignphrase>esource</foreignphrase>
           <emphasis>L</emphasis><foreignphrase>ocator</foreignphrase> <link
           xlink:href="http://www.w3.org/Addressing">(URL)</link>. Thus our
-          <filename>memo.dtd</filename> may also be supplied as a <abbrev
+          <filename>memo.xsd</filename> may also be supplied as a <abbrev
           xlink:href="http://www.w3.org/Protocols">http</abbrev> or <abbrev
           xlink:href="http://en.wikipedia.org/wiki/File_Transfer_Protocol">ftp</abbrev>
           <link xlink:href="http://www.w3.org/Addressing">URL</link>:</para>
@@ -1550,61 +1565,13 @@ terminated by the matching end-tag "&lt;/to&gt;". parsing error</computeroutput>
             <title>A DTD reference to a FTP server.</title>
 
             <programlisting language="none">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;!DOCTYPE memo SYSTEM "ftp://www.hdm-stuttgart.de/memo.dtd"&gt;
-&lt;memo date="10.02.2006" priority="high"&gt;
+&lt;memo ... xsi:noNamespaceSchemaLocation="https://someserver.org/memo.xsd"&gt;
   &lt;from&gt;M. Goik&lt;/from&gt;
   ...
 &lt;/memo&gt;</programlisting>
           </figure>
 
-          <para>For development purposes we may combine a DTD and a conforming
-          document into a single unit. This is achieved by in line replacing
-          the <code>SYSTEM "memo.dtd"</code> clause by the DTD itself:</para>
-
-          <figure xml:id="dtd_and_document">
-            <title>DTD and document within the same file</title>
-
-            <programlisting language="none">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;!DOCTYPE memo [<co xml:id="memo_inline_dtd_start"/>
-&lt;!ELEMENT memo     (from, to+, subject, content)&gt;
-
-&lt;!ATTLIST memo date     CDATA             #REQUIRED
-               priority (low|medium|high) #IMPLIED&gt;
-
-&lt;!ELEMENT from     (#PCDATA)&gt;
-&lt;!ELEMENT to       (#PCDATA)&gt;
-&lt;!ELEMENT subject  (#PCDATA)&gt;
-&lt;!ELEMENT content  (#PCDATA)&gt;
-]<co xml:id="memo_inline_dtd_end"/>&gt; <co xml:id="memo_inline_doc_start"/>
-&lt;memo date="10.02.2006" priority="high"&gt; 
-    &lt;from&gt;M. Goik&lt;/from&gt;
-    &lt;to&gt;B. King&lt;/to&gt;
-    &lt;to&gt;A. June&lt;/to&gt;
-    &lt;subject&gt;Best whishes&lt;/subject&gt;
-    &lt;content&gt;Hi all, congratulations to your splendid party&lt;/content&gt;
-&lt;/memo&gt;</programlisting>
-
-            <calloutlist>
-              <callout arearefs="memo_inline_dtd_start">
-                <para>The DTD definitions start right after the left bracket
-                <quote>[</quote> thus replacing the <code>SYSTEM
-                "memo.dtd"</code> declaration.</para>
-              </callout>
-
-              <callout arearefs="memo_inline_dtd_end">
-                <para>The right bracket <quote>]</quote> terminates the DTD
-                declarations. After finishing the <code>&lt;!DOCTYPE ...
-                &gt;</code> declaration the document's content starts.</para>
-              </callout>
-
-              <callout arearefs="memo_inline_doc_start">
-                <para>Start of document content.</para>
-              </callout>
-            </calloutlist>
-          </figure>
-
-          <para>Some terms are helpful in the context of <abbrev
-          xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>'s:</para>
+          <para>Some terms are helpful in the context of schemas:</para>
 
           <variablelist>
             <varlistentry>
@@ -1613,10 +1580,7 @@ terminated by the matching end-tag "&lt;/to&gt;". parsing error</computeroutput>
               <listitem>
                 <para>A non-validating parser only checks a document for well-
                 formedness. If it also checks XML documents for conformance to
-                DTD it is a <emphasis>validating</emphasis> parser. Caution:
-                Even a non-validating parser needs to read a DTD (if being
-                supplied) since it might have to expand general entity
-                declarations being defined in it.</para>
+                schema it is a <emphasis>validating</emphasis> parser.</para>
               </listitem>
             </varlistentry>
 
@@ -1624,8 +1588,8 @@ terminated by the matching end-tag "&lt;/to&gt;". parsing error</computeroutput>
               <term>Valid / invalid documents:</term>
 
               <listitem>
-                <para>An XML document referencing a DTD may either be valid or
-                invalid depending on its conformance to the DTD in
+                <para>An XML document referencing a schema may either be valid
+                or invalid depending on its conformance to the schema in
                 question.</para>
               </listitem>
             </varlistentry>
@@ -1635,9 +1599,9 @@ terminated by the matching end-tag "&lt;/to&gt;". parsing error</computeroutput>
 
               <listitem>
                 <para>An XML memo document may conform to the <link
-                linkend="figure_memo_dtd">memo DTD</link>. In this case we
+                linkend="figure_memo_dtd">memo schema</link>. In this case we
                 call it a <emphasis>document instance</emphasis> of the memo
-                DTD.</para>
+                schema.</para>
 
                 <para>This situation is quite similar as in typed programming
                 languages: A <link
@@ -1652,20 +1616,21 @@ terminated by the matching end-tag "&lt;/to&gt;". parsing error</computeroutput>
                 <emphasis>instance of class String</emphasis>. So in a <link
                 linkend="gloss_Java"><trademark>Java</trademark></link>
                 runtime environment a class declaration plays the same role as
-                a DTD declaration in XML. See also <xref
+                a schema declaration in XML. See also <xref
                 linkend="example_memoJavaClass"/>.</para>
               </listitem>
             </varlistentry>
           </variablelist>
 
           <para>For further discussions it is very useful to clearly
-          distinguish element definitions in a DTD from their
+          distinguish element definitions in a schema from their
           <emphasis>realizations</emphasis> in a corresponding document
-          instance: Our memo DTD defines an element <tag
-          class="starttag">from</tag> to be of content <code>#PCDATA</code>.
-          According to the DTD in a document instance at least one <tag
-          class="starttag">from</tag> clause must appear. If we were talking
-          about HTML document instances we would prefer to talk about a <tag
+          instance: Our memo schema defines an element <tag
+          class="starttag">from</tag> to be of content <type>xs:string</type>.
+          According to the schema at least one <tag
+          class="starttag">from</tag> clause must appear in a valid
+          (conforming) document instance . If we were talking about HTML
+          document instances we would prefer to talk about a <tag
           class="starttag">from</tag> <emphasis>tag</emphasis> rather than a
           <tag class="starttag">from</tag>
           <emphasis>element</emphasis>.</para>
@@ -1677,7 +1642,7 @@ terminated by the matching end-tag "&lt;/to&gt;". parsing error</computeroutput>
           <filename>memo.dtd</filename>.</para>
 
           <para>An element type being defined in a <abbrev
-          xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>
+          xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">schema</abbrev>
           may have document instances as realizations. For example the
           document instance shown in <xref linkend="memo_external_dtd"/> has
           two <emphasis>nodes</emphasis> of element type <tag
@@ -1690,12 +1655,12 @@ terminated by the matching end-tag "&lt;/to&gt;". parsing error</computeroutput>
           class="starttag">from</tag> elements. But the careful reader should
           always distinguish between a single type <code>foo</code> being
           defined in a <abbrev
-          xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>
+          xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">schema</abbrev>
           and the possibly empty set of <tag class="starttag">foo</tag> nodes
           appearing in valid document instances.</para>
 
           <para><abbrev
-          xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>'s
+          xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">Schema</abbrev>'s
           appear on top of well-formed XML documents:</para>
 
           <figure xml:id="wellformedandvalid">
@@ -1717,7 +1682,7 @@ terminated by the matching end-tag "&lt;/to&gt;". parsing error</computeroutput>
                   <para>Copy the two files <link
                   xlink:href="Ref/src/Memo.1/message.xml">message.xml</link>
                   and <link
-                  xlink:href="Ref/src/Memo.1/memo.dtd">memo.dtd</link> into
+                  xlink:href="Ref/src/Memo.1/memo.dtd">memo.xsd</link> into
                   your eclipse project. Use the Oxygen XML plug in to check if
                   the document is valid. Then subsequently do and undo the
                   following changes each time checking the document for
@@ -1751,7 +1716,7 @@ terminated by the matching end-tag "&lt;/to&gt;". parsing error</computeroutput>
 
                 <answer>
                   <para>The <tag class="attribute">priority</tag> attribute is
-                  declared as <code>#IMPLIED</code> so it may be omitted.
+                  declared as <code>optional</code> and may thus be omitted.
                   Erasing the <tag class="attribute">priority</tag> attribute
                   thus leaves the document in a valid state. The remaining
                   three edit actions yield an invalid document
@@ -1765,12 +1730,12 @@ terminated by the matching end-tag "&lt;/to&gt;". parsing error</computeroutput>
 
                   <para>The aim of this exercise is to clarify the (abstract)
                   relation between XML <abbrev
-                  xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>'s
+                  xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">schema</abbrev>'s
                   and sets of <link
                   linkend="gloss_Java"><trademark>Java</trademark></link>
                   classes rather then building a running application. We want
                   to model the <link xlink:href="Ref/src/Memo.1/memo.dtd">memo
-                  DTD</link> as a set of <link
+                  schema</link> as a set of <link
                   linkend="gloss_Java"><trademark>Java</trademark></link>
                   classes.</para>
                 </question>
@@ -1786,8 +1751,8 @@ terminated by the matching end-tag "&lt;/to&gt;". parsing error</computeroutput>
                   class="element">content</tag> which may be implemented as
                   simple Strings or alternatively as separate Classes wrapping
                   the String content. The latter method of implementation
-                  should be preferred if the Memo DTD is expected to grow in
-                  complexity. A simple sketch reads:</para>
+                  should be preferred if the Memo schema is expected to grow
+                  in complexity. A simple sketch reads:</para>
 
                   <programlisting language="none">import java.util.Date;
 import java.util.SortedSet;
@@ -1805,11 +1770,11 @@ public class Memo {
                   able to address a <emphasis>set</emphasis> of recipients.
                   Thus we have to disallow duplicates. Note that this is an
                   <emphasis>informal</emphasis> constraint not being handled
-                  by our DTD: A Memo document instance
+                  by our schema: A Memo document instance
                   <emphasis>may</emphasis> have duplicate content in <tag
                   class="starttag">to</tag> nodes. This is a weakness of
                   <abbrev
-                  xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>s:
+                  xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">schema</abbrev>s:
                   We are unable to impose uniqueness constraints on the
                   content of partial sets of document nodes.</para>
 
@@ -1822,7 +1787,7 @@ public class Memo {
                   <classname>java.util.SortedSet</classname> parametrized with
                   String type to fulfill both requirements.</para>
 
-                  <para>Our DTD defines:</para>
+                  <para>Our schema defines:</para>
 
                   <programlisting language="none">&lt;!ATTLIST memo ...  priority (low|medium|high) #IMPLIED&gt;</programlisting>
 
@@ -1840,19 +1805,19 @@ public class Memo {
           <para>In the following chapters we will extend the memo document
           type (<code>&lt;!DOCTYPE memo ... &gt;</code>) to demonstrate
           various concepts of <abbrev
-          xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>'s
+          xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">schema</abbrev>'s
           and other XML related standards. In parallel a series of exercises
-          deals with building a DTD usable to edit books. This DTD gets
+          deals with building a schema usable to edit books. This schema gets
           extended as our knowledge about XML advances. We start with an
           initial exercise:</para>
 
           <qandaset defaultlabel="qanda" xml:id="example_bookDtd">
-            <title>A DTD for editing books</title>
+            <title>A schema for editing books</title>
 
             <qandadiv>
               <qandaentry>
                 <question>
-                  <para>Write a DTD describing book document instances with
+                  <para>Write a schema describing book document instances with
                   the following features:</para>
 
                   <itemizedlist>
@@ -1879,10 +1844,10 @@ public class Memo {
                 </question>
 
                 <answer>
-                  <para>A possible DTD looks like:</para>
+                  <para>A possible schema looks like:</para>
 
                   <figure xml:id="figure_book.dtd_v1">
-                    <title>A first DTD version for book documents</title>
+                    <title>A first schema version for book documents</title>
 
                     <programlisting language="none">&lt;!ELEMENT book     (title, chapter+)&gt;
 &lt;!ELEMENT chapter  (title, para+)&gt;
@@ -1922,14 +1887,14 @@ public class Memo {
 
         <section xml:id="dtdVsSqlDdl">
           <title>Relating <abbrev
-          xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>'s
+          xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">schema</abbrev>'s
           and <acronym
           xlink:href="http://en.wikipedia.org/wiki/Sql">SQL</acronym> -
           <abbrev
           xlink:href="http://en.wikipedia.org/wiki/Data_definition_language">DDL</abbrev></title>
 
           <para>XML <abbrev
-          xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>'s
+          xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">schema</abbrev>'s
           and <acronym
           xlink:href="http://en.wikipedia.org/wiki/Sql">SQL</acronym> -
           <abbrev
@@ -1974,7 +1939,7 @@ public class Memo {
 
           <qandaset defaultlabel="qanda" xml:id="quandaentry_MultipleFk">
             <title><abbrev
-            xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>'s
+            xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">schema</abbrev>'s
             and <acronym
             xlink:href="http://en.wikipedia.org/wiki/Sql">SQL</acronym>-DDL</title>
 
@@ -1991,22 +1956,13 @@ public class Memo {
 
                 <answer>
                   <para>XML <abbrev
-                  xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>'s
-                  cannot express multiple foreign keys. Adding a second
-                  foreign key <coref linkend="invoiceSecondFK"/> in a
-                  referencing table <code>Order</code> already breaks <abbrev
-                  xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>
-                  expressibility:</para>
+                  xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">schema</abbrev>'s
+                  can express multiple foreign keys.</para>
 
                   <programlisting language="none">CREATE TABLE Order (
   orderNo BIGINT NOT NULL PRIMARY KEY,
   customer NUMERIC(5) NOT NULL <emphasis role="bold">REFERENCES Customer</emphasis> <co
                       xml:id="invoiceSecondFK"/>...</programlisting>
-
-                  <remark>This is actually a deficiency of DTD's rather than
-                  of XML technologies in general: The XML schema standard
-                  allows for multiple foreign key definitions and polymorphic
-                  references as well.</remark>
                 </answer>
               </qandaentry>
             </qandadiv>
@@ -2015,7 +1971,7 @@ public class Memo {
 
         <section xml:id="xmlAndJava">
           <title>Relating <abbrev
-          xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>'s
+          xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">schema</abbrev>'s
           and <link linkend="gloss_Java"><trademark>Java</trademark></link>
           class descriptions.</title>
 
@@ -2024,12 +1980,12 @@ public class Memo {
           linkend="gloss_Java"><trademark>Java</trademark></link> class
           declaration is actually a blueprint for a <trademark
           xlink:href="http://www.oracle.com/technetwork/java/javase">JRE</trademark>
-          to instantiate compatible objects. Likewise an XML DTD restricts
+          to instantiate compatible objects. Likewise an XML schema restricts
           well-formed documents:</para>
 
           <figure xml:id="fig_XmlAndJava">
             <title>XML <abbrev
-            xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>'s
+            xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">schema</abbrev>'s
             and <link linkend="gloss_Java"><trademark>Java</trademark></link>
             class declarations.</title>
 
@@ -2046,752 +2002,28 @@ public class Memo {
           xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>'s
           in detail</title>
 
-          <para>We have already seen that elements are building blocks of XML
-          documents. Now we regard the formal rules that govern the way
-          <code>&lt;!ELEMENT ...&gt;</code> declarations may appear in XML.
-          This will lead to the notion of the term <emphasis>Content
-          Model</emphasis>.</para>
-
-          <para>Then we will shed some light on <code>&lt;!ATTRIBUTE
-          ...&gt;</code> declarations. We will learn about possible attribute
-          types and default values.</para>
-
-          <para>Next we explore the <emphasis>physical</emphasis> structure of
-          XML documents. We will see that <abbrev
-          xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>s
-          and document instances may be physically subdivided into
-          <emphasis>entities</emphasis> without touching their logical
-          structure.</para>
-
-          <para>Since we want to illustrate DTD grammars by <userinput
-          xlink:href="http://en.wikipedia.org/wiki/Ebnf">EBNF</userinput>
-          diagrams we first show some helpful non-terminals starting with the
-          definition of white space. Apparently this is the same as in most
-          programming languages:</para>
-
-          <productionset>
-            <title><link
-            xlink:href="http://www.w3.org/TR/2008/REC-xml-20081126/#NT-S">White
-            Space</link></title>
-
-            <production xml:id="w3RecXml_NT-S">
-              <lhs>S</lhs>
-
-              <rhs>(#x20 | #x9 | #xD | #xA)+ <lineannotation>space, tabulator,
-              carriage return and line feed</lineannotation></rhs>
-            </production>
-          </productionset>
-
-          <para>The production rule for <code>Name</code> defines legal
-          identifier names for element names like <tag
-          class="element">memo</tag>. We learn that such an identifier must
-          not begin with a digit. So the rule presented here resembles the
-          grammar constraint on legal identifiers in the <link
-          linkend="gloss_Java"><trademark>Java</trademark></link> programming
-          language. The type <code>NMTOKEN</code> will be needed later when
-          defining element attributes.</para>
-
-          <productionset>
-            <title><link
-            xlink:href="http://www.w3.org/TR/2008/REC-xml-20081126/#d0e804">Names
-            and Tokens</link></title>
-
-            <production xml:id="w3RecXml_NT-NameChar">
-              <lhs>NameChar</lhs>
-
-              <rhs><nonterminal def="#w3RecXml_NT-Letter">Letter</nonterminal>
-              | <nonterminal def="#w3RecXml_NT-Digit">Digit</nonterminal> |
-              '.' | '-' | '_' | ':' | <nonterminal
-              def="#w3RecXml_NT-CombiningChar"
-              xlink:href="#w3RecXml_NT-CombiningChar">CombiningChar</nonterminal>
-              | <nonterminal
-              def="#w3RecXml_NT-Extender">Extender</nonterminal></rhs>
-            </production>
-
-            <production xml:id="w3RecXml_NT-Name">
-              <lhs>Name</lhs>
-
-              <rhs>(<nonterminal
-              def="#w3RecXml_NT-Letter">Letter</nonterminal> | '_' | ':')
-              (<nonterminal
-              def="#w3RecXml_NT-NameChar">NameChar</nonterminal>)*</rhs>
-            </production>
-
-            <production xml:id="w3RecXml_NT-Names">
-              <lhs>Names</lhs>
-
-              <rhs><nonterminal def="#w3RecXml_NT-Name">Name</nonterminal>
-              (#x20 <nonterminal
-              def="#w3RecXml_NT-Name">Name</nonterminal>)*</rhs>
-            </production>
-
-            <production xml:id="w3RecXml_NT-Nmtoken">
-              <lhs>Nmtoken</lhs>
-
-              <rhs>(<nonterminal
-              def="#w3RecXml_NT-NameChar">NameChar</nonterminal>)+</rhs>
-            </production>
-
-            <production xml:id="w3RecXml_NT-Nmtokens">
-              <lhs>Nmtokens</lhs>
-
-              <rhs><nonterminal
-              def="#w3RecXml_NT-Nmtoken">Nmtoken</nonterminal> (#x20
-              <nonterminal
-              def="#w3RecXml_NT-Nmtoken">Nmtoken</nonterminal>)*</rhs>
-            </production>
-          </productionset>
-
           <section xml:id="section_contentmodel">
             <title>The content model</title>
 
-            <para>We already saw examples of XML elements being composed of
-            other elements in our <link
-            linkend="figure_memo_dtd">memo.dtd</link>:</para>
-
-            <programlisting language="none">&lt;!ELEMENT memo     (from, to+, subject, content)&gt;</programlisting>
-
-            <para>We call the right side the <emphasis>content
-            model</emphasis> of the <tag class="element">memo</tag> element.
-            The XML 1.0 specification defines <link
-            xlink:href="http://www.w3.org/TR/xml#dt-eldecl">four</link>
-            different <link
-            xlink:href="http://www.w3.org/TR/2006/REC-xml-20060816/#elemdecls">element
-            type definitions</link>:</para>
-
-            <productionset xml:id="productionset_element_decl">
-              <title><link
-              xlink:href="http://www.w3.org/TR/2008/REC-xml-20081126/#dt-eldecl">Element
-              Type Declaration</link></title>
-
-              <production xml:id="w3RecXml_NT-elementdecl">
-                <lhs>elementdecl</lhs>
-
-                <rhs>'&lt;!ELEMENT' <nonterminal
-                def="#w3RecXml_NT-S">S</nonterminal> <nonterminal
-                def="#w3RecXml_NT-Name">Name</nonterminal> <nonterminal
-                def="#w3RecXml_NT-S">S</nonterminal> <nonterminal
-                def="#w3RecXml_NT-contentspec">contentspec</nonterminal>
-                <nonterminal def="#w3RecXml_NT-S">S</nonterminal>?
-                '&gt;'</rhs>
-              </production>
-
-              <production xml:id="w3RecXml_NT-contentspec">
-                <lhs>contentspec</lhs>
-
-                <rhs>'EMPTY' | 'ANY' | <nonterminal
-                def="#w3RecXml_NT-Mixed">Mixed</nonterminal> | <nonterminal
-                def="#w3RecXml_NT-children">children</nonterminal></rhs>
-              </production>
-            </productionset>
-
-            <glosslist>
-              <glossentry>
-                <glossterm><link
-                linkend="section_empty">EMPTY</link></glossterm>
-
-                <glossdef>
-                  <para>The element doesn't have any content at all. This
-                  makes sense for elements with attributes being allowed as in
-                  <tag class="emptytag"> img src="foo.gif"</tag>.</para>
-                </glossdef>
-              </glossentry>
-
-              <glossentry>
-                <glossterm><link linkend="section_any">ANY</link></glossterm>
-
-                <glossdef>
-                  <para>The element in question may contain a sequence of
-                  arbitrary elements and ordinary text
-                  (<code>#PCDATA</code>).</para>
-                </glossdef>
-              </glossentry>
-
-              <glossentry>
-                <glossterm><nonterminal
-                def="#w3RecXml_NT-Mixed">Mixed</nonterminal></glossterm>
-
-                <glossdef>
-                  <para>The element may contain an arbitrary sequence from a
-                  set of child elements possibly interspersed with ordinary
-                  text.</para>
-                </glossdef>
-              </glossentry>
-
-              <glossentry>
-                <glossterm><nonterminal
-                def="#w3RecXml_NT-children">children</nonterminal></glossterm>
-
-                <glossdef>
-                  <para>An element contains <emphasis>only</emphasis> other
-                  elements. A node of the element type in question may appear
-                  as child of itself giving rise to recursion:</para>
-
-                  <programlisting language="none">...
-&lt;chapter&gt;
-  &lt;chapter&gt; ...&lt;/chapter&gt;
-&lt;/chapter&gt;</programlisting>
-                </glossdef>
-              </glossentry>
-            </glosslist>
-
-            <para>All elements being declared are subject to the following
-            validity constraint:</para>
-
-            <constraintdef>
-              <para>An element type MUST NOT be declared more than
-              once.</para>
-            </constraintdef>
-
-            <para>Programmers will not be surprised: The above constraint is
-            common to most programming languages. In <link
-            linkend="gloss_Java"><trademark>Java</trademark></link> for
-            example a given local variable may not be redefined:</para>
-
-            <programlisting language="none">int count = 3;
-double pi=3.1415926;
-int count = 2;       // Fatal error: A variable must not be 
-                     // redefined within the given scope</programlisting>
-
-            <para>However there is no such rule like <quote>Define before
-            use</quote>: Element <emphasis>and</emphasis> attribute
-            definitions may refer to elements being defined
-            <quote>later</quote>:</para>
-
-            <programlisting language="none">&lt;!ATTLIST memo<co
-                xml:id="programlisting_elemattorder_memoatt"/> date     CDATA             #REQUIRED
-               priority (low|medium|high) #IMPLIED&gt;
-
-&lt;!ELEMENT memo<co xml:id="programlisting_elemattorder_memodecl"/>     (from, to+, subject, content)&gt;
-
-&lt;!ELEMENT from     (#PCDATA)&gt;
-&lt;!ELEMENT to       (#PCDATA)&gt;
-&lt;!ELEMENT subject  (#PCDATA)&gt;
-&lt;!ELEMENT content  (#PCDATA)&gt;</programlisting>
-
-            <calloutlist>
-              <callout arearefs="programlisting_elemattorder_memoatt">
-                <para>Two attributes <varname>date</varname> and
-                <varname>priority</varname> are defined for the element <tag
-                class="starttag">memo</tag> which itself gets defined
-                immediately <emphasis>after</emphasis> this definition.</para>
-              </callout>
-
-              <callout arearefs="programlisting_elemattorder_memodecl">
-                <para>The <tag class="element">memo</tag> type definition
-                refers to the element types <tag class="element">from</tag>,
-                <tag class="element">to</tag>, <tag
-                class="element">subject</tag> and <tag
-                class="element">content</tag> all being defined
-                afterwards.</para>
-              </callout>
-            </calloutlist>
-
-            <section xml:id="section_empty">
-              <title>The <code>EMPTY</code> declaration</title>
-
-              <para>Element nodes of content type <code>EMPTY</code> are
-              familiar from e.g. HTML:</para>
-
-              <programlisting language="none">...
-&lt;p&gt;We saw the picture &lt;img src="person.gif"&gt; of the officer.
-...</programlisting>
-
-              <para>This code fragment shows an image embedded <emphasis>in
-              line</emphasis> with the current text flow. This is possible in
-              HTML being an SGML standard but it is <emphasis>not</emphasis>
-              allowed in XML. Also the omission of <tag
-              class="starttag">/p</tag> to close the paragraph is disallowed.
-              In XML either of the two forms has to be chosen:</para>
-
-              <itemizedlist>
-                <listitem>
-                  <para><code>&lt;p&gt;We saw the picture &lt;img
-                  src="person.gif"&gt;&lt;/img&gt; of the
-                  officer.&lt;/p&gt;</code></para>
-                </listitem>
-
-                <listitem>
-                  <para><code>&lt;p&gt;We saw the picture &lt;img
-                  src="person.gif"/&gt; of the
-                  officer.&lt;/p&gt;</code></para>
-                </listitem>
-              </itemizedlist>
-
-              <para>Using <tag class="starttag">img .../</tag> as a shorthand
-              for an empty element is legal in XML but disallowed in SGML and
-              thus HTML. This is one of the possible obstacles when migrating
-              from SGML based HTML documents to an XML version of HTML like
-              <link xlink:href="http://www.w3.org/MarkUp">Xhtml</link>. From
-              <xref linkend="productionset_element_decl"/> we can infer the
-              corresponding DTD declaration:</para>
-
-              <programlisting language="none">&lt;!ELEMENT img EMPTY&gt;</programlisting>
-            </section>
-
-            <section xml:id="section_any">
-              <title>The <code>ANY</code> declaration</title>
-
-              <para>The <code>ANY</code> declaration allows every element of a
-              given DTD to appear as a child of the element being defined
-              including the element itself. It is not possible to exclude
-              certain elements from an <code>ANY</code> rule:</para>
-
-              <figure xml:id="figure_any_declaration">
-                <title>The <code>ANY</code> declaration</title>
-
-                <programlisting language="none">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;!DOCTYPE theater [
-&lt;!ELEMENT theater ANY <co xml:id="figure_any_declaration_any"/> &gt;
-
-&lt;!ELEMENT actor   (#PCDATA) <co xml:id="figure_any_declaration_actor"/> &gt;
-&lt;!ELEMENT show    (#PCDATA) <co xml:id="figure_any_declaration_show"/>&gt; 
-]&gt;
-&lt;theater&gt;
-    &lt;actor&gt;Peter Sun&lt;/actor&gt;
-     some text <co xml:id="figure_any_declaration_doc_text"/>
-     &lt;show&gt;Must go on&lt;/show&gt;
-    &lt;theater&gt;Self referencing!&lt;/theater&gt; <co
-                    xml:id="figure_any_declaration_actor_self_reference"/>
-   &lt;!-- An error: --&gt;
-    &lt;b&gt;Ooops, no such element defined in DTD&lt;/b&gt; <co
-                    xml:id="figure_any_declaration_actor_undefined"/>
-&lt;/theater&gt;</programlisting>
-
-                <calloutlist>
-                  <callout arearefs="figure_any_declaration_any">
-                    <para>A <tag class="element">theater</tag> element may
-                    consist of a sequence of arbitrary content. Every child
-                    element must be defined in the DTD.</para>
-                  </callout>
-
-                  <callout arearefs="figure_any_declaration_actor figure_any_declaration_show">
-                    <para>Two elements <tag class="element">actor</tag> and
-                    <tag class="element">show</tag> consisting of mere textual
-                    content.</para>
-                  </callout>
-
-                  <callout arearefs="figure_any_declaration_doc_text">
-                    <para>Ordinary text may also be part of the <tag
-                    class="starttag">theater</tag> element and may appear
-                    everywhere.</para>
-                  </callout>
-
-                  <callout arearefs="figure_any_declaration_actor_self_reference">
-                    <para>A <tag class="starttag">theater</tag> element may
-                    appear as a child of itself. This gives rise to recursion
-                    of arbitrary depth.</para>
-                  </callout>
-
-                  <callout arearefs="figure_any_declaration_actor_undefined">
-                    <para>There is no element <tag class="starttag">b</tag>
-                    defined in the DTD. Thus the current XML document is
-                    invalid.</para>
-                  </callout>
-                </calloutlist>
-              </figure>
-
-              <para>Remark: The restriction to elements being defined in a DTD
-              is common to other content model types as well. Actually every
-              element being referenced by a definition in the DTD
-              <emphasis>must</emphasis> itself be defined in order for the
-              document to be valid.</para>
-            </section>
-
             <section xml:id="section_mixed">
-              <title>Mixed content</title>
-
-              <para>Mixed content is similar to the ANY declaration. But the
-              set of elements allowed to appear is restricted. We show an
-              example:</para>
-
-              <figure xml:id="figure_memo_content_mixed">
-                <title>Extending the memo content type.</title>
-
-                <programlisting language="none">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;!DOCTYPE memo [
-...
-&lt;!ELEMENT content  (#PCDATA|emphasis|url)*&gt;
-&lt;!ELEMENT emphasis (#PCDATA)&gt;
-&lt;!ELEMENT url (#PCDATA)&gt;
-&lt;!ATTLIST url href     CDATA  #REQUIRED&gt;
-]&gt;
-...
-&lt;content&gt;The &lt;url href="http://w3.org/XML"&gt;XML&lt;/url&gt; language
-  is &lt;emphasis&gt;easy&lt;/emphasis&gt; to learn. However you need 
-  some &lt;emphasis&gt;time&lt;/emphasis&gt;.&lt;/content&gt; ...</programlisting>
-
-                <caption>
-                  <para>This grammar allows to emphasize text passages and to
-                  define hypertext links.</para>
-                </caption>
-              </figure>
-
-              <para>The formatting expectation is <quote>... The <link
-              xlink:href="http://w3.org/XML">XML</link> language is
-              <emphasis>easy</emphasis> to learn. However you need some
-              <emphasis>time</emphasis>. ...</quote>. We may visualize this
-              document instance as a tree:</para>
-
-              <figure xml:id="extendContModelGraph">
-                <title>Graphical representation of the extended
-                <code>content</code> model.</title>
-
-                <mediaobject>
-                  <imageobject>
-                    <imagedata fileref="Ref/Fig/contentmixed.fig"/>
-                  </imageobject>
-                </mediaobject>
-              </figure>
-
-              <para>More formally the W3C specification defines mixed content
-              models as:</para>
-
-              <productionset xml:id="productionset_w3RecXml_NT-Mixed">
-                <title><link
-                xlink:href="http://www.w3.org/TR/2008/REC-xml-20081126/#sec-mixed-content">Mixed-content
-                Declaration</link></title>
-
-                <production xml:id="w3RecXml_NT-Mixed">
-                  <lhs>Mixed</lhs>
-
-                  <rhs>'(' <nonterminal def="#w3RecXml_NT-S">S</nonterminal>?
-                  '#PCDATA' (<nonterminal
-                  def="#w3RecXml_NT-S">S</nonterminal>? '|' <nonterminal
-                  def="#w3RecXml_NT-S">S</nonterminal>? <nonterminal
-                  def="#w3RecXml_NT-Name">Name</nonterminal>)* <nonterminal
-                  def="#w3RecXml_NT-S">S</nonterminal>? ')*' | '('
-                  <nonterminal def="#w3RecXml_NT-S">S</nonterminal>? '#PCDATA'
-                  <nonterminal def="#w3RecXml_NT-S">S</nonterminal>? ')'</rhs>
-                </production>
-              </productionset>
-
-              <para>We notice that out simple <code>&lt;!ELEMENT from
-              (#PCDATA)&gt;</code> is also described by this definition. It is
-              just a special case of a single text node and no element nodes
-              being present.</para>
-
-              <qandaset defaultlabel="qanda" xml:id="example_allowed_mixed">
-                <title>Variations of mixed content models</title>
-
-                <qandadiv>
-                  <qandaentry>
-                    <question>
-                      <para>You may assume that the element types <tag
-                      class="element">emphasize</tag> and <tag
-                      class="element">URL</tag> are correctly defined. Are the
-                      following definitions allowed?</para>
-
-                      <itemizedlist>
-                        <listitem>
-                          <para><code>&lt;! ELEMENT mix
-                          (#PCDATA)*&gt;</code></para>
-                        </listitem>
-
-                        <listitem>
-                          <para><code>&lt;! ELEMENT mix
-                          (emphasize|#PCDATA)*&gt;</code></para>
-                        </listitem>
-
-                        <listitem>
-                          <para><code>&lt;! ELEMENT mix
-                          (#PCDATA|URL)&gt;</code></para>
-                        </listitem>
+              <title/>
 
-                        <listitem>
-                          <para><code>&lt;! ELEMENT mix
-                          (emphasize|#PCDATA)+&gt;</code></para>
-                        </listitem>
-                      </itemizedlist>
-                    </question>
-
-                    <answer>
-                      <programlisting language="none">&lt;! ELEMENT mix (#PCDATA)*&gt;</programlisting>
-
-                      <para>Valid due to syntax diagram.</para>
-
-                      <programlisting language="none">&lt;! ELEMENT mix (emphasize|#PCDATA)*&gt;</programlisting>
-
-                      <para>Not valid. According to the production rule in
-                      <xref linkend="productionset_w3RecXml_NT-Mixed"/> the
-                      term <code>#PCDATA</code> <emphasis>must</emphasis> be
-                      the first token.</para>
-
-                      <programlisting language="none"><code>&lt;! ELEMENT mix (#PCDATA|URL)&gt;</code>, <code>&lt;! ELEMENT mix (emphasize|#PCDATA)+&gt;</code></programlisting>
-
-                      <para>Both variants are disallowed: The indicator of
-                      multiplicity <quote>*</quote> is mandatory and the only
-                      legal token to appear in a mixed content model's
-                      definition.</para>
-                    </answer>
-                  </qandaentry>
-                </qandadiv>
-              </qandaset>
+              <para/>
             </section>
 
             <section xml:id="section_element_content">
-              <title>Element content</title>
-
-              <para>We refer to our first version of our <link
-              linkend="figure_memo_dtd">memo.dtd</link>. The <tag
-              class="starttag">memo</tag> content model definition
-              reads:</para>
-
-              <programlisting language="none">&lt;!ELEMENT memo     (from, to+, subject, content)&gt;</programlisting>
-
-              <para>This basically states that any valid <tag
-              class="starttag">memo</tag> document instance consists of a
-              sequence of other nodes. In this context we denote <tag
-              class="starttag">memo</tag> as <emphasis>parent</emphasis> node.
-              <tag class="element">from</tag>, <tag class="element">to</tag>,
-              <tag class="element">subject</tag> and <tag
-              class="element">content</tag> are called
-              <emphasis>child</emphasis> nodes or
-              <emphasis>children</emphasis> of <tag
-              class="starttag">memo</tag> for short.</para>
-
-              <para>A sequence of elements is a special case of a more general
-              element content definition in the XML specification. We already
-              used the <quote>+</quote> operator allowing a node to appear
-              multiple times. The DTD standard defines three such operators of
-              multiplicity:</para>
-
-              <glosslist>
-                <glossentry>
-                  <glossterm>?</glossterm>
-
-                  <glossdef>
-                    <para>A node may appear once or never.</para>
-                  </glossdef>
-                </glossentry>
-
-                <glossentry>
-                  <glossterm>+</glossterm>
-
-                  <glossdef>
-                    <para>A node must appear <emphasis>at least</emphasis>
-                    once.</para>
-                  </glossdef>
-                </glossentry>
-
-                <glossentry>
-                  <glossterm>*</glossterm>
-
-                  <glossdef>
-                    <para>A node may appear an arbitrary number of times,
-                    possibly not at all.</para>
-                  </glossdef>
-                </glossentry>
-              </glosslist>
-
-              <para>Consequently the absence of any such operator declares the
-              node to appear exactly once. So far we only talked about
-              sequences of element nodes. Bi virtue of
-              <quote><code>|</code></quote> we may also define mutually
-              exclusive alternatives:</para>
-
-              <figure xml:id="operatorContentAlt">
-                <title>The operator <quote>|</quote> defining exclusive
-                alternatives.</title>
-
-                <programlisting language="none">...
-&lt;!ELEMENT address   (email|telephone|town)<co
-                    xml:id="programlisting_alternative_address"/> &gt;
-&lt;!ELEMENT email     (#PCDATA)&gt;
-&lt;!ELEMENT telephone (#PCDATA)&gt;
-&lt;!ELEMENT town      (#PCDATA)&gt;
-...
-
-  &lt;address&gt;<co xml:id="programlisting_alternative_emailchild"/>
-    &lt;email&gt;goik@hdm-stuttgart.de&lt;/email&gt;
-  &lt;/address&gt;
-...
-  &lt;address&gt;<co xml:id="programlisting_alternative_telephonechild"/>
-    &lt;telephone&gt;+49 (0)711-8923-2164&lt;/telephone&gt;
-  &lt;/address&gt;
-...</programlisting>
-
-                <calloutlist>
-                  <callout arearefs="programlisting_alternative_address">
-                    <para>An <tag class="element">address</tag> node has
-                    <emphasis>either</emphasis> an <tag
-                    class="starttag">email</tag> child <emphasis>or</emphasis>
-                    a <tag class="starttag">telephone</tag> or a <tag
-                    class="starttag">town</tag> child.</para>
-                  </callout>
-
-                  <callout arearefs="programlisting_alternative_emailchild">
-                    <para>An <tag class="starttag">address</tag> node having
-                    an <tag class="starttag">email</tag> child.</para>
-                  </callout>
-
-                  <callout arearefs="programlisting_alternative_telephonechild">
-                    <para>An <tag class="starttag">address</tag> node having
-                    an <tag class="starttag">telephone</tag> child.</para>
-                  </callout>
-                </calloutlist>
-              </figure>
-
-              <para>Now we have collected the basic means allowing to
-              structure XML documents. We have the three indicators
-              <quote>?</quote>, <quote>+</quote> and <quote>*</quote> which
-              govern the multiplicity of nodes. On the other hand the two
-              operators <quote>,</quote> and <quote>|</quote> allow us to
-              define sequences or mutually exclusive alternatives of element
-              nodes. The XML standard defines the notion of <emphasis>content
-              particles</emphasis> (<command>cp</command>) which allows these
-              two types of structuring elements to be grouped and
-              nested:</para>
-
-              <productionset>
-                <title><link
-                xlink:href="http://www.w3.org/TR/2008/REC-xml-20081126/#sec-element-content">Element-content
-                Models</link></title>
-
-                <production xml:id="w3RecXml_NT-children">
-                  <lhs>children</lhs>
-
-                  <rhs>(<nonterminal
-                  def="#w3RecXml_NT-choice">choice</nonterminal> |
-                  <nonterminal def="#w3RecXml_NT-seq">seq</nonterminal>) ('?'
-                  | '*' | '+')?</rhs>
-                </production>
-
-                <production xml:id="w3RecXml_NT-cp">
-                  <lhs>cp</lhs>
-
-                  <rhs>(<nonterminal
-                  def="#w3RecXml_NT-Name">Name</nonterminal> | <nonterminal
-                  def="#w3RecXml_NT-choice">choice</nonterminal> |
-                  <nonterminal def="#w3RecXml_NT-seq">seq</nonterminal>) ('?'
-                  | '*' | '+')?</rhs>
-                </production>
-
-                <production xml:id="w3RecXml_NT-choice">
-                  <lhs>choice</lhs>
-
-                  <rhs>'(' <nonterminal def="#w3RecXml_NT-S">S</nonterminal>?
-                  <nonterminal def="#w3RecXml_NT-cp">cp</nonterminal> (
-                  <nonterminal def="#w3RecXml_NT-S">S</nonterminal>? '|'
-                  <nonterminal def="#w3RecXml_NT-S">S</nonterminal>?
-                  <nonterminal def="#w3RecXml_NT-cp">cp</nonterminal> )+
-                  <nonterminal def="#w3RecXml_NT-S">S</nonterminal>? ')'</rhs>
-                </production>
-
-                <production xml:id="w3RecXml_NT-seq">
-                  <lhs>seq</lhs>
-
-                  <rhs>'(' <nonterminal def="#w3RecXml_NT-S">S</nonterminal>?
-                  <nonterminal def="#w3RecXml_NT-cp">cp</nonterminal> (
-                  <nonterminal def="#w3RecXml_NT-S">S</nonterminal>? ','
-                  <nonterminal def="#w3RecXml_NT-S">S</nonterminal>?
-                  <nonterminal def="#w3RecXml_NT-cp">cp</nonterminal> )*
-                  <nonterminal def="#w3RecXml_NT-S">S</nonterminal>? ')'</rhs>
-                </production>
-              </productionset>
-
-              <para>We provide two examples:</para>
-
-              <figure xml:id="pureElementContent">
-                <title>Examples of pure element content models</title>
-
-                <glosslist>
-                  <glossentry>
-                    <glossterm><code>&lt;!ELEMENT address
-                    (email|(name,street,town,telephone?))</code></glossterm>
-
-                    <glossdef>
-                      <para>An <tag class="element">address</tag> is given
-                      either by an email or by a postal address plus an
-                      optional telephone number.</para>
-                    </glossdef>
-                  </glossentry>
-
-                  <glossentry>
-                    <glossterm><code>&lt;!ELEMENT figurelist (title,
-                    ((table|image|animation),
-                    caption?)+)&gt;</code></glossterm>
-
-                    <glossdef>
-                      <para>We will call table, image and animations
-                      <emphasis>block</emphasis> elements. The <tag
-                      class="starttag">figurelist</tag> element defines a list
-                      of figures. The whole list starts with an overall title.
-                      Then we have at least one occurrence of a block element
-                      and an optional caption.</para>
-                    </glossdef>
-                  </glossentry>
-                </glosslist>
-              </figure>
+              <title/>
 
               <qandaset defaultlabel="qanda"
                         xml:id="example_operatorprecedence">
-                <title>Content models and operator priority</title>
+                <title>Book documents with mixed content and itemized
+                lists</title>
 
                 <qandadiv>
-                  <qandaentry>
-                    <question>
-                      <para>Find and explain the error being buried in the
-                      following DTD. After correcting the error construct a
-                      valid document instance.</para>
-
-                      <programlisting language="none">&lt;!ELEMENT addresslist (address*) &gt;
-&lt;!ELEMENT address (email | town,street) &gt;
-&lt;!ELEMENT email (#PCDATA)&gt;
-&lt;!ELEMENT town (#PCDATA)&gt;
-&lt;!ELEMENT street (#PCDATA)&gt;</programlisting>
-                    </question>
-
-                    <answer>
-                      <para>The following document uses the DTD:</para>
-
-                      <programlisting language="none">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;!DOCTYPE addresslist SYSTEM "address.dtd"&gt;
-&lt;addresslist&gt;
-  &lt;address&gt;
-    &lt;email&gt;bingo@cheat.com&lt;/email&gt;
-  &lt;/address&gt;
-  &lt;address&gt;
-    &lt;town&gt;Paris&lt;/town&gt;
-    &lt;street&gt;Avenue Kléber&lt;/street&gt;
-  &lt;/address&gt;
-&lt;/addresslist&gt;</programlisting>
-
-                      <para>This yields the following parsing error:</para>
-
-                      <programlisting language="none"><errortext>A ')' is required in the declaration of element type "address".</errortext></programlisting>
-
-                      <para>Like many other error messages this one is not
-                      really enlightening the reader. We examine the content
-                      model of the element <tag
-                      class="element">address</tag>:</para>
-
-                      <programlisting language="none">email | town,street</programlisting>
-
-                      <para>We have tree elements joined by two operators
-                      namely alternative and sequence. In contrast to e.g.
-                      Boolean Algebras the XML standard does not define any
-                      operator priority with respect to <quote>|</quote> and
-                      <quote>,</quote>. Instead a DTD author must use braces
-                      to explicitly define the desired priority:</para>
-
-                      <programlisting language="none">&lt;!ELEMENT address (email | (town,street)) &gt;</programlisting>
-
-                      <para>We note that the operators <quote>*</quote>,
-                      <quote>+</quote> and <quote>?</quote> have precedence
-                      over <quote>|</quote> and <quote>,</quote>. Thus we may
-                      write <code>town,street+</code> instead of the clumsy
-                      term <code>town,(street)+</code>.</para>
-                    </answer>
-                  </qandaentry>
-
                   <qandaentry xml:id="example_book_v2">
                     <question>
-                      <label>Book documents with mixed content and itemized
-                      lists</label>
-
                       <para>Extend the first version of <link
-                      linkend="example_bookDtd">book.dtd</link> to support the
+                      linkend="example_bookDtd">book.xsd</link> to support the
                       following features:</para>
 
                       <itemizedlist>
@@ -2852,17 +2084,95 @@ int count = 2;       // Fatal error: A variable must not be
                       <figure xml:id="paraListEmphasize">
                         <title>Version 2 of book.dtd</title>
 
-                        <programlisting language="none">&lt;!ELEMENT book     (title, chapter+)&gt;
-&lt;!ELEMENT chapter  (title, (para|itemizedlist)+ <co
-                            xml:id="figure_book.dtd_v2_chapter"/>)&gt;
-&lt;!ELEMENT title    (#PCDATA)&gt;
-&lt;!ELEMENT para     (#PCDATA|emphasis)*<co xml:id="figure_book.dtd_v2_para"/>&gt;
-&lt;!ELEMENT emphasis (#PCDATA)&gt;
-
-&lt;!ELEMENT itemizedlist (listitem+)<co
-                            xml:id="figure_book.dtd_v2_itemizedlist"/>&gt;
-&lt;!ELEMENT listitem ((para|itemizedlist)<co
-                            xml:id="figure_book.dtd_v2_listitem"/>+)&gt;</programlisting>
+                        <programlisting language="none">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified"
+    vc:minVersion="1.0" vc:maxVersion="1.1"&gt;
+
+    &lt;xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd" /&gt;
+
+
+    &lt;xs:include schemaLocation="table.xsd"/&gt;
+
+    &lt;!-- Type definitions --&gt;
+    &lt;xs:simpleType name="languageType"&gt;
+        &lt;xs:restriction base="xs:string"&gt;
+            &lt;xs:enumeration value="en"/&gt;
+            &lt;xs:enumeration value="fr"/&gt;
+            &lt;xs:enumeration value="de"/&gt;
+            &lt;xs:enumeration value="it"/&gt;
+            &lt;xs:enumeration value="es"/&gt;
+        &lt;/xs:restriction&gt;
+    &lt;/xs:simpleType&gt;
+
+
+    &lt;!-- Elements having no inner structure --&gt;
+    &lt;xs:element name="emphasis" type="xs:string"/&gt;
+    &lt;xs:element name="title" type="xs:string"/&gt;
+    &lt;xs:element name="link"&gt;
+        &lt;xs:complexType mixed="true"&gt;
+            &lt;xs:attribute name="linkend" type="xs:IDREF" use="required"/&gt;
+        &lt;/xs:complexType&gt;
+    &lt;/xs:element&gt;
+
+    &lt;!-- Starting the game ... --&gt;
+    &lt;xs:element name="book"&gt;
+        &lt;xs:complexType&gt;
+            &lt;xs:sequence&gt;
+                &lt;xs:element ref="title"/&gt;
+                &lt;xs:element ref="chapter" minOccurs="1" maxOccurs="unbounded"/&gt;
+            &lt;/xs:sequence&gt;
+            &lt;xs:attribute name="lang" type="languageType" use="optional"/&gt;
+        &lt;/xs:complexType&gt;
+    &lt;/xs:element&gt;
+
+    &lt;xs:element name="chapter"&gt;
+        &lt;xs:complexType&gt;
+            &lt;xs:sequence&gt; <co xml:id="figure_book.dtd_v2_chapter"/>
+                &lt;xs:element ref="title"/&gt;
+                &lt;xs:choice minOccurs="1" maxOccurs="unbounded"&gt;
+                    &lt;xs:element ref="para"/&gt;
+                    &lt;xs:element ref="itemizedlist"/&gt;
+                    &lt;xs:element ref="table"/&gt;
+                &lt;/xs:choice&gt;
+            &lt;/xs:sequence&gt;
+            &lt;xs:attribute name="id" type="xs:ID" use="optional"/&gt;
+            &lt;xs:attribute ref="xml:base"/&gt; &lt;!-- This allows for &lt;xi:include ...&gt; --&gt;
+        &lt;/xs:complexType&gt;
+    &lt;/xs:element&gt;
+
+    &lt;xs:element name="para"&gt;
+        &lt;xs:complexType mixed="true"&gt; <co
+                            xml:id="figure_book.dtd_v2_para"/>
+            &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
+                &lt;xs:element ref="emphasis"/&gt;
+                &lt;xs:element ref="link"/&gt;
+            &lt;/xs:choice&gt;
+            &lt;xs:attribute name="id" type="xs:ID" use="optional"/&gt;
+        &lt;/xs:complexType&gt;
+    &lt;/xs:element&gt;
+
+    &lt;xs:element name="itemizedlist"&gt;
+        &lt;xs:complexType&gt;
+            &lt;xs:sequence&gt;
+                &lt;xs:element ref="listitem" minOccurs="1" <co
+                            xml:id="figure_book.dtd_v2_itemizedlist"/> maxOccurs="unbounded"/&gt;
+            &lt;/xs:sequence&gt;
+            &lt;xs:attribute name="id" type="xs:ID" use="optional"/&gt;
+        &lt;/xs:complexType&gt;
+    &lt;/xs:element&gt;
+
+    &lt;xs:element name="listitem"&gt;
+        &lt;xs:complexType&gt;
+            &lt;xs:choice minOccurs="1" maxOccurs="unbounded"&gt; <co
+                            xml:id="figure_book.dtd_v2_listitem"/>
+                &lt;xs:element ref="para"/&gt;
+                &lt;xs:element ref="itemizedlist"/&gt;
+            &lt;/xs:choice&gt;
+        &lt;/xs:complexType&gt;
+    &lt;/xs:element&gt;
+
+&lt;/xs:schema&gt;</programlisting>
 
                         <caption>
                           <para>This allows emphasized text in <tag
@@ -2887,15 +2197,16 @@ int count = 2;       // Fatal error: A variable must not be
                         </callout>
 
                         <callout arearefs="figure_book.dtd_v2_itemizedlist">
-                          <para>An itemized list contains at least one list
-                          item.</para>
+                          <para>An <tag class="starttag">itemizedlist</tag>
+                          contains at least one list item.</para>
                         </callout>
 
                         <callout arearefs="figure_book.dtd_v2_listitem">
-                          <para>A list item contains a sequence of at least
-                          one <tag class="starttag">para</tag> or <tag
-                          class="starttag">itemizedlist</tag> node. The latter
-                          gives rise to nested lists. We find a similar
+                          <para>A <tag class="starttag">listitem</tag>
+                          contains a sequence of at least one <tag
+                          class="starttag">para</tag> or <tag
+                          class="starttag">itemizedlist</tag> child node. The
+                          latter gives rise to nested lists. We find a similar
                           construct in HTML namely unnumbered lists defined by
                           <code>&lt;UL&gt;&lt;LI&gt;...
                           </code>constructs.</para>
@@ -2908,21 +2219,15 @@ int count = 2;       // Fatal error: A variable must not be
             </section>
 
             <section xml:id="comments_processing">
-              <title>Comments and processing instructions</title>
+              <title>Comments</title>
 
               <para>A XML comment uses the syntax <code>&lt;!-- This is a
               comment! I love comments! --&gt;</code>. Without going into
-              details here comments may appear in many locations both within
-              <abbrev
-              xlink:href="http://en.wikipedia.org/wiki/Document_Type_Declaration">DTD</abbrev>'s
-              and document instances:</para>
+              details here comments may appear in most locations both within
+              schema and document instances:</para>
 
               <programlisting language="none">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;!DOCTYPE addresslist [
-&lt;!-- An addresslist may contain an arbitrary number of address nodes --&gt;
-&lt;!ELEMENT addresslist (address)*&gt;
-&lt;!ELEMENT address     (#PCDATA)&gt;
-]&gt;
+
 &lt;addresslist&gt;
   &lt;!-- the document author --&gt;
   &lt;address&gt;goik@hdm-stuttgart.de&lt;/address&gt;
@@ -2938,10 +2243,7 @@ int count = 2;       // Fatal error: A variable must not be
               file</link> of the XML specification:</para>
 
               <programlisting language="none">&lt;?xml version='1.0' encoding='UTF-8'?&gt;
-&lt;!DOCTYPE spec SYSTEM "xmlspec.dtd" [
-    &lt;!ENTITY base.uri "http://www.w3.org/TR/2006/"&gt;
-...
-]&gt;
+
 &lt;?xml-stylesheet type="text/xsl" href="REC-xml.xsl" <co
                   xml:id="programmlisting_xmlspecsrc_xsltref"/> ?&gt; <co
                   xml:id="programmlisting_xmlspecsrc_pi"/>
@@ -3130,12 +2432,11 @@ int count = 2;       // Fatal error: A variable must not be
           <section xml:id="section_attributetypes">
             <title>Attribute types</title>
 
-            <para>When discussing the content model type <link
-            linkend="section_empty">EMPTY</link> we already mentioned the
-            possibility of element nodes having attributes like <tag
-            class="emptytag">img src="..."</tag>. We discuss two features of
-            element attributes namely its <emphasis>type</emphasis> and the
-            way default values are specified.:</para>
+            <para>We already mentioned the possibility of element nodes having
+            attributes like <tag class="emptytag">img src="..."</tag>. We
+            discuss two features of element attributes namely its
+            <emphasis>type</emphasis> and the way default values are
+            specified.:</para>
 
             <figure xml:id="attribImg">
               <title>Attributes of HTML <tag class="emptytag">img</tag>
@@ -3148,103 +2449,41 @@ int count = 2;       // Fatal error: A variable must not be
               </mediaobject>
             </figure>
 
-            <para>We already observed that content model definitions allow us
-            to define <emphasis>composition</emphasis> rules. Thus a <tag
-            class="starttag">chapter</tag> may consist of a <tag
-            class="starttag">title</tag> node followed by <tag
-            class="starttag">para</tag> and other nodes. This defines
-            hierarchical , tree like structures. But the
-            <emphasis>actual</emphasis> string content is defined as
-            <code>#PCDATA</code>. We are unable to specify a node's content to
-            consist purely of numbers for example. In contrast XML DTD
-            attribute definitions offer a limited set of predefined types to
-            choose from.</para>
-
             <section xml:id="section_cdata">
               <title><code>CDATA</code></title>
 
-              <para>An element type may be defined to have attributes of type
-              <code>CDATA</code>:</para>
-
-              <programlisting language="none">&lt;!ATTLIST img <co
-                  xml:id="programlisting_img_element"/>
-   src<co xml:id="programlisting_img_att_src"/> CDATA<co
-                  xml:id="programlisting_img_att_src_type"/> #REQUIRED<co
-                  xml:id="programlisting_img_att_src_default"/> &gt;</programlisting>
-
-              <calloutlist>
-                <callout arearefs="programlisting_img_element">
-                  <para>Start of the definition of a <emphasis>set</emphasis>
-                  of attributes for the element type <tag
-                  class="element">img</tag>.</para>
-                </callout>
-
-                <callout arearefs="programlisting_img_att_src">
-                  <para>Start of the first at tribute's definition named <tag
-                  class="attribute">src</tag>.</para>
-                </callout>
-
-                <callout arearefs="programlisting_img_att_src_type">
-                  <para>The attribute <tag class="attribute">src</tag>'s type
-                  is <code>CDATA</code>.</para>
-                </callout>
-
-                <callout arearefs="programlisting_img_att_src_default">
-                  <para>The attribute <tag class="attribute">src</tag> is
-                  mandatory, see <xref linkend="section_attribute_default"/>
-                  .</para>
-                </callout>
-              </calloutlist>
-
-              <para>We have to be careful here. The term <code>CDATA</code>
-              resembles <code>#PCDATA</code> already being introduced for
-              content models. Actually these two terms are completely distinct
-              since <code>CDATA</code> refers to attribute values. Consider
-              the following code snippet:</para>
-
-              <programlisting language="none">&lt;para&gt;We may use "quotes" here&lt;/para&gt;</programlisting>
-
-              <para>This is completely legal since all characters being used
-              refer to the production rule of <code>#PCDATA</code>. But using
-              the same as an attribute value instead causes trouble:</para>
-
-              <programlisting language="none">&lt;img src="bold.gif" alt="We may use "quotes" here" /&gt;</programlisting>
-
-              <para>This is indeed not even well formed XML. The two inner
-              quotes embedding the substring <code>quotes</code> interfere
-              with the two outer quotes delimiting the attribute <tag
-              class="attribute">src</tag>'s value. As we shall see in <xref
-              linkend="example_quotes"/> there is a solution to this problem
-              but the current example shows that the production rules of
-              <code>#PCDATA</code> and <code>CDATA</code> differ.</para>
-
               <qandaset defaultlabel="qanda" xml:id="example_book.dtd_v3">
                 <title>book.dtd and languages</title>
 
                 <qandadiv>
                   <qandaentry>
                     <question>
-                      <para>We want to extend our DTD from <xref
+                      <para>We want to extend our schema from <xref
                       linkend="example_book_v2"/> by allowing an author to
-                      define the language used within the document. Add an
-                      attribute declaration to the top level element <tag
-                      class="element">book</tag>.</para>
+                      define the language to be used within the document in
+                      question. Add an attribute declaration to the top level
+                      element <tag class="element">book</tag>.</para>
                     </question>
 
                     <answer>
                       <para>We simply have to add a single line to our
-                      DTD:</para>
-
-                      <programlisting language="none">&lt;!ELEMENT book     (title, chapter+)&gt;
-<emphasis role="bold">&lt;!ATTLIST book lang CDATA #IMPLIED &gt;</emphasis>
-...</programlisting>
+                      schema:</para>
+
+                      <programlisting language="none">&lt;xs:element name="book"&gt;
+        &lt;xs:complexType&gt;
+            &lt;xs:sequence&gt;
+                &lt;xs:element ref="title"/&gt;
+                &lt;xs:element ref="chapter" minOccurs="1" maxOccurs="unbounded"/&gt;    
+            &lt;/xs:sequence&gt;
+            <emphasis role="bold">&lt;xs:attribute name="lang" type="xs:token"/&gt;</emphasis>
+        &lt;/xs:complexType&gt;
+    &lt;/xs:element&gt;</programlisting>
 
                       <para>This allows us to globally set a language for a
                       document:</para>
 
                       <programlisting language="none">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;!DOCTYPE book SYSTEM "book.dtd"&gt;
-&lt;book lang="english"&gt;
+&lt;book ... lang="english"&gt;
   &lt;title&gt;Introduction to Java&lt;/title&gt;
 ...</programlisting>
                     </answer>
@@ -3252,100 +2491,7 @@ int count = 2;       // Fatal error: A variable must not be
                 </qandadiv>
               </qandaset>
 
-              <para>The XML specification defines attribute definitions
-              belonging to element types as:</para>
-
-              <productionset>
-                <title><link
-                xlink:href="http://www.w3.org/TR/2008/REC-xml-20081126/#attdecls">Attribute-list
-                Declaration</link></title>
-
-                <production xml:id="w3RecXml_NT-AttlistDecl">
-                  <lhs>AttlistDecl</lhs>
-
-                  <rhs>'&lt;!ATTLIST' <nonterminal
-                  def="#w3RecXml_NT-S">S</nonterminal> <nonterminal
-                  def="#w3RecXml_NT-Name">Name</nonterminal> <nonterminal
-                  def="#w3RecXml_NT-AttDef">AttDef</nonterminal>* <nonterminal
-                  def="#w3RecXml_NT-S">S</nonterminal>? '&gt;'</rhs>
-                </production>
-
-                <production xml:id="w3RecXml_NT-AttDef">
-                  <lhs>AttDef</lhs>
-
-                  <rhs><nonterminal def="#w3RecXml_NT-S">S</nonterminal>
-                  <nonterminal def="#w3RecXml_NT-Name">Name</nonterminal>
-                  <nonterminal def="#w3RecXml_NT-S">S</nonterminal>
-                  <nonterminal
-                  def="#w3RecXml_NT-AttType">AttType</nonterminal>
-                  <nonterminal def="#w3RecXml_NT-S">S</nonterminal>
-                  <nonterminal
-                  def="#w3RecXml_NT-DefaultDecl">DefaultDecl</nonterminal></rhs>
-                </production>
-              </productionset>
-
-              <para>The first rule tells us that multiple attributes may be
-              defined for a given element. This is quite <quote>normal</quote>
-              since the same applies for example when attributes are defined
-              within <link
-              linkend="gloss_Java"><trademark>Java</trademark></link> or C++
-              classes. Actually in <link
-              xlink:href="http://www.w3.org/MarkUp">XHTML</link> the <tag
-              class="emptytag">img</tag> element's attribute list is defined
-              as:</para>
-
-              <programlisting language="none">&lt;!ATTLIST img
-      src          CDATA        #REQUIRED
-      alt          CDATA        #REQUIRED
-      longdesc     CDATA        #IMPLIED
-      height       CDATA        #IMPLIED
-      width        CDATA        #IMPLIED
-      ...  &gt;</programlisting>
-
-              <para>The second production rule tells us that attribute names
-              like <tag class="attribute">src</tag> must be of <link
-              linkend="w3RecXml_NT-Name">Name</link> production. For example
-              <code>4element</code> would be an illegal name since attribute
-              name strings may contain numbers but not at the beginning. This
-              is quite common in most programming languages and refers to the
-              term of a legal identifier.</para>
-
-              <para>The second rule also tells us that <code>CDATA</code> is
-              only one among other possible attribute types:</para>
-
-              <productionset>
-                <title><link
-                xlink:href="http://www.w3.org/TR/2008/REC-xml-20081126/#sec-attribute-types">Attribute
-                Types</link></title>
-
-                <production xml:id="w3RecXml_NT-AttType">
-                  <lhs>AttType</lhs>
-
-                  <rhs><nonterminal
-                  def="#w3RecXml_NT-StringType">StringType</nonterminal> |
-                  <nonterminal
-                  def="#w3RecXml_NT-TokenizedType">TokenizedType</nonterminal>
-                  | <nonterminal
-                  def="#w3RecXml_NT-EnumeratedType">EnumeratedType</nonterminal></rhs>
-                </production>
-
-                <production xml:id="w3RecXml_NT-StringType">
-                  <lhs>StringType</lhs>
-
-                  <rhs>'CDATA'</rhs>
-                </production>
-
-                <production xml:id="w3RecXml_NT-TokenizedType">
-                  <lhs>TokenizedType</lhs>
-
-                  <rhs>'ID'| 'IDREF'| 'IDREFS'| 'ENTITY'| 'ENTITIES'|
-                  'NMTOKEN'| 'NMTOKENS'</rhs>
-                </production>
-              </productionset>
-
               <qandaset defaultlabel="qanda" xml:id="example_quotes">
-                <title>Enclosing quotes</title>
-
                 <qandadiv>
                   <qandaentry>
                     <question>
@@ -3468,175 +2614,11 @@ int count = 2;       // Fatal error: A variable must not be
             <section xml:id="section_nmtoken">
               <title><code>NMTOKEN</code> /<code>NMTOKENS</code></title>
 
-              <para>Name tokens are essentially strings composed of a
-              restricted character set. A name token must for example not
-              contain any white space. We already mentioned its production
-              rule:</para>
-
-              <productionset>
-                <productionrecap linkend="w3RecXml_NT-Nmtoken"/>
-              </productionset>
-
-              <para>This may be used to restrict attribute values. We consider
-              a configuration file containing a list of user accounts:</para>
-
-              <programlisting language="none">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;!DOCTYPE userlist [
-&lt;!ELEMENT userlist (account*)&gt;
-&lt;!ELEMENT account EMPTY&gt;
-&lt;!ATTLIST account
-    username NMTOKEN #REQUIRED
-    password CDATA   #IMPLIED
-    &gt;
-]&gt;
-&lt;userlist&gt;
-  &lt;account username="Joe"/&gt;
-  &lt;account username="Mr. Bean"/&gt;
-                &lt;!-- Whoops, an illegal space!--&gt;
-&lt;/userlist&gt;</programlisting>
-
-              <para>We extend the above example by allowing each user to
-              belong to a <emphasis>set</emphasis> of groups. We achieve this
-              by adding an attribute <tag class="attribute">groups</tag> of
-              type <code>NMTOKENS</code>:</para>
-
-              <programlisting language="none">...
-&lt;!ATTLIST account
-    username NMTOKEN #REQUIRED
-    groups NMTOKENS #IMPLIED
-    password CDATA   #IMPLIED
-    &gt;
-]&gt;
-&lt;userlist&gt;
-  &lt;account username="Joe" groups="admin staff team"/&gt;
-&lt;/userlist&gt;</programlisting>
-
-              <para>This defines a user <code>Joe</code> belonging to the
-              three groups <code>admin</code>, <code>staff</code> and
-              <code>team</code>. Informally we see a list of tokens separated
-              by spaces. This is indeed the formal W3C specification:</para>
-
-              <productionset>
-                <productionrecap linkend="w3RecXml_NT-Nmtokens"/>
-              </productionset>
-
-              <para>According to this rule only single spaces (#20) are legal.
-              Actual parser implementations seem to accept more general
-              whitespace here. Thus a sequence of spaces, tabs, carriage
-              returns and newlines is also accepted as a separator
-              value.</para>
+              <para/>
             </section>
 
             <section xml:id="section_name_token_group">
-              <title>Enumeration values</title>
-
-              <para>The XML standard allows us to define enumerations by
-              restricting an attribute value to a predefined set of name
-              tokens:</para>
-
-              <productionset>
-                <title><link
-                xlink:href="http://www.w3.org/TR/2008/REC-xml-20081126/#d0e3200">Enumerated
-                Attribute Types</link></title>
-
-                <production xml:id="w3RecXml_NT-EnumeratedType">
-                  <lhs>EnumeratedType</lhs>
-
-                  <rhs><nonterminal
-                  def="#w3RecXml_NT-NotationType">NotationType</nonterminal> |
-                  <nonterminal
-                  def="#w3RecXml_NT-Enumeration">Enumeration</nonterminal></rhs>
-                </production>
-
-                <production xml:id="w3RecXml_NT-NotationType">
-                  <lhs>NotationType</lhs>
-
-                  <rhs>'NOTATION' <nonterminal
-                  def="#w3RecXml_NT-S">S</nonterminal> '(' <nonterminal
-                  def="#w3RecXml_NT-S">S</nonterminal>? <nonterminal
-                  def="#w3RecXml_NT-Name">Name</nonterminal> (<nonterminal
-                  def="#w3RecXml_NT-S">S</nonterminal>? '|' <nonterminal
-                  def="#w3RecXml_NT-S">S</nonterminal>? <nonterminal
-                  def="#w3RecXml_NT-Name">Name</nonterminal>)* <nonterminal
-                  def="#w3RecXml_NT-S">S</nonterminal>? ')'</rhs>
-                </production>
-
-                <production xml:id="w3RecXml_NT-Enumeration">
-                  <lhs>Enumeration</lhs>
-
-                  <rhs>'(' <nonterminal def="#w3RecXml_NT-S">S</nonterminal>?
-                  <nonterminal
-                  def="#w3RecXml_NT-Nmtoken">Nmtoken</nonterminal>
-                  (<nonterminal def="#w3RecXml_NT-S">S</nonterminal>? '|'
-                  <nonterminal def="#w3RecXml_NT-S">S</nonterminal>?
-                  <nonterminal
-                  def="#w3RecXml_NT-Nmtoken">Nmtoken</nonterminal>)*
-                  <nonterminal def="#w3RecXml_NT-S">S</nonterminal>? ')'</rhs>
-                </production>
-              </productionset>
-
-              <para>We start with an example of a <emphasis>Name Token
-              Group</emphasis> aka enumeration:</para>
-
-              <figure xml:id="figure_nametokengroup">
-                <title>A name token group</title>
-
-                <programlisting language="none">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;!DOCTYPE top [
-&lt;!ELEMENT top        (chemical*)&gt;
-&lt;!ELEMENT chemical   (#PCDATA)&gt;
-&lt;!ATTLIST chemical state  (solid|liquid|gas) <co
-                    xml:id="figure_nametokengroup_att_state"/> #REQUIRED <co
-                    xml:id="figure_nametokengroup_att_state_required"/>&gt;
-]&gt;
-&lt;top&gt;
-  &lt;chemical state="gas" <co xml:id="figure_nametokengroup_oxygen_state"/>&gt;Oxygen&lt;/chemical&gt;
-  &lt;chemical state="liquid" <co xml:id="figure_nametokengroup_water_state"/>&gt;Water&lt;/chemical&gt;
-  
-  &lt;chemical state="superfluous" <co
-                    xml:id="figure_nametokengroup_helium_state"/>&gt;Helium&lt;/chemical&gt;
-                    &lt;!-- Ooops! --&gt;
-&lt;/top&gt;</programlisting>
-
-                <calloutlist>
-                  <callout arearefs="figure_nametokengroup_att_state">
-                    <para>The attribute <tag class="attribute">state</tag>'s
-                    value may have values from the set {solid, liquid,
-                    gas}.</para>
-                  </callout>
-
-                  <callout arearefs="figure_nametokengroup_att_state_required">
-                    <para><tag class="attribute">state</tag> is
-                    mandatory.</para>
-                  </callout>
-
-                  <callout arearefs="figure_nametokengroup_oxygen_state">
-                    <para>A legal value.</para>
-                  </callout>
-
-                  <callout arearefs="figure_nametokengroup_water_state">
-                    <para>Another legal value.</para>
-                  </callout>
-
-                  <callout arearefs="figure_nametokengroup_helium_state">
-                    <para>The token value <tag
-                    class="attvalue">superfluous</tag> does not belong to the
-                    set of allowed values. The parser flags this error
-                    as:</para>
-
-                    <para><code>Attribute "state" with value "superfluous"
-                    must have a value from the list "solid liquid gas
-                    ".</code></para>
-                  </callout>
-                </calloutlist>
-              </figure>
-
-              <para>The rule defining an <link
-              linkend="w3RecXml_NT-Enumeration">Enumeration</link> has to be
-              supplemented by a validity constraint: The set of legal token
-              values must not contain duplicates. This would violate the
-              attributes property allowing values to be chosen from a
-              <emphasis>set</emphasis>.</para>
+              <title/>
 
               <qandaset defaultlabel="qanda" xml:id="example_book.dtd_v4">
                 <title>Restriction of allowed languages</title>
@@ -3647,82 +2629,27 @@ int count = 2;       // Fatal error: A variable must not be
                       <para xml:lang="">We extend our book.dtd version from
                       <xref linkend="example_book.dtd_v3"/>. The attribute
                       <tag class="attribute">lang</tag> is simple free text.
-                      We want to restrict this to allow only values from the
-                      set {en,fr,de,it,es}.</para>
+                      We want to restrict available values to the set
+                      {en,fr,de,it,es}.</para>
                     </question>
 
                     <answer>
-                      <para>We restrict our attribute definition from type
-                      <code>CDATA</code> to a name token group:</para>
-
-                      <programlisting language="none">&lt;!ATTLIST book lang (en|fr|de|it|es) #IMPLIED &gt;</programlisting>
+                      <para>We restrict our attribute definition by
+                      introducing a corresponding type:</para>
+
+                      <programlisting language="none"> &lt;xs:simpleType name="languageType"&gt;
+        &lt;xs:restriction base="xs:string"&gt;
+            &lt;xs:enumeration value="en"/&gt;
+            &lt;xs:enumeration value="fr"/&gt;
+            &lt;xs:enumeration value="de"/&gt;
+            &lt;xs:enumeration value="it"/&gt;
+            &lt;xs:enumeration value="es"/&gt;
+        &lt;/xs:restriction&gt;
+    &lt;/xs:simpleType&gt;</programlisting>
                     </answer>
                   </qandaentry>
                 </qandadiv>
               </qandaset>
-
-              <para>The notation type branch production rule's usage is quite
-              similar:</para>
-
-              <figure xml:id="attributeNotation">
-                <title>A notation attribute</title>
-
-                <programlisting language="none">&lt;!DOCTYPE doc [
-
-&lt;!NOTATION <emphasis role="bold">cpp</emphasis>  SYSTEM "The ANSI C++ programming language"&gt;
-&lt;!NOTATION <emphasis role="bold">perl</emphasis> SYSTEM "The PERL script programming language"&gt;
-&lt;!NOTATION <emphasis role="bold">sql</emphasis>  SYSTEM "SQL 92 database query language"&gt;
-
-&lt;!ELEMENT doc (code)*&gt;
-&lt;!ELEMENT code (#PCDATA)&gt;
-&lt;!ATTLIST code
-   language NOTATION (<emphasis role="bold">cpp</emphasis>|<emphasis
-                    role="bold">perl</emphasis>|<emphasis role="bold">sql</emphasis>)  #REQUIRED &gt;
-]&gt;
-&lt;doc&gt;
-  &lt;code language="<emphasis role="bold">cpp</emphasis>"&gt;delete[] namelist;&lt;/code&gt;
-  &lt;code language="<emphasis role="bold">sql</emphasis>"&gt;SELECT * FROM User;&lt;/code&gt;
-&lt;/doc&gt;</programlisting>
-              </figure>
-
-              <para>The only difference in comparison to a Name Token Group is
-              the keyword <code>NOTATION</code>. There are however additional
-              validity constraints imposed by the XML specification.</para>
-
-              <para>In the given example the content of <tag
-              class="starttag">para</tag> nodes was declared as
-              <code>#PCDATA</code>. Actually all types of element content
-              except <code>EMPTY</code> may appear.</para>
-
-              <itemizedlist>
-                <listitem>
-                  <para>Values of type <code>NOTATION</code>
-                  <emphasis>must</emphasis> match one of the notation names
-                  included in the declaration. In the given example this would
-                  be either <tag class="attvalue">cpp</tag>, <tag
-                  class="attvalue">perl</tag> or <tag
-                  class="attvalue">sql</tag>. All notation names in the
-                  declaration <emphasis>must</emphasis> be declared.</para>
-                </listitem>
-
-                <listitem>
-                  <para>An element type <emphasis>must not</emphasis> have
-                  more than one <code>NOTATION</code> attribute specified.
-                  Actually a <code>NOTATION</code> attribute value gives us a
-                  <quote>promise</quote> about the expected content of the
-                  element node in which it appears. So if the content of a
-                  <tag class="starttag">para</tag> node is SQL code it cannot
-                  in addition be declared to be of language category type
-                  <emphasis>declarative</emphasis>.</para>
-                </listitem>
-
-                <listitem>
-                  <para>For compatibility to SGML an attribute of type
-                  <code>NOTATION</code> <emphasis>must not</emphasis> be
-                  declared on an element declared <link
-                  linkend="section_empty">EMPTY</link>.</para>
-                </listitem>
-              </itemizedlist>
             </section>
 
             <section xml:id="section_id_idref">
-- 
GitLab