diff --git a/Doc/Common/snippets.xml b/Doc/Common/snippets.xml index b60907f9d545327dc25a10e16fb75baadb94f707..a8e14cf8f6eee92d5865a436c06a9d9d6fd0a49d 100644 --- a/Doc/Common/snippets.xml +++ b/Doc/Common/snippets.xml @@ -30,13 +30,19 @@ <programlisting language="none">http://www.utf8-chartable.de/unicode-utf8-table.pl?start=9472&unicodeinhtml=dec <emphasis role="red">â”</emphasis> <emphasis role="red">â–²</emphasis> <emphasis - role="red"><emphasis role="red">┳</emphasis> ┓</emphasis> + role="red"><emphasis role="red">┳</emphasis> </emphasis><emphasis + role="red">┓</emphasis> <emphasis role="red">┃</emphasis> <emphasis role="red">â—€â”â”â•‹â”â”â”â–¶</emphasis> <emphasis role="red">┣</emphasis> <emphasis role="red">┃</emphasis> <emphasis role="red">┫</emphasis> <emphasis role="red">â”—</emphasis> <emphasis role="red">â–¼</emphasis> <emphasis role="red">â”»</emphasis><emphasis role="red">â”›</emphasis> + +<emphasis role="red">â”—â”â”â”â”â”â”â”â”â”â”â”â”â”┓</emphasis> + +<emphasis role="red">â”â”â”â”â”â”â”â”â”â”â”â”â”â”<emphasis role="red">â”›</emphasis></emphasis> + http://xahlee.info/comp/unicode_drawing_shapes.html diff --git a/Doc/Sda1/xmlschema.xml b/Doc/Sda1/xmlschema.xml index 608a838910f21920327c88a04c07485fdba4b024..98515d65b950f45bdbb12217a6503c4046ed8aac 100644 --- a/Doc/Sda1/xmlschema.xml +++ b/Doc/Sda1/xmlschema.xml @@ -243,7 +243,7 @@ double amount = Double.parseDouble(a);</programlisting></td> <figure xml:id="sda1_xmlschema_fig_contactsObjective"> <title>An address book</title> - <para> Our </para> + <para>Our</para> <itemizedlist> <listitem> @@ -867,7 +867,7 @@ String s1 = new String(), s2 = new String();</programlisting> <informaltable border="0"> <tr> <td valign="top"><programlisting language="xml"><link - xlink:href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/blob/master/Doc/Sda1/Ref/Organizer/V04_birthdateElement/organizer.xsd"><xs:element name="organizer"></link> + xlink:href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/blob/master/Doc/Sda1/Ref/Organizer/V04_birthdateElement/organizer.xsd"><xs:element name="contac"></link> <xs:complexType> <xs:sequence> <xs:element name="firstName"/> @@ -921,9 +921,9 @@ String s1 = new String(), s2 = new String();</programlisting> </contact> <contact> ... - <!-- '21-th May 2004' is no valid + <!-- '21-st May 2004' is no valid value for 'date'. --> - <birthDate><emphasis role="red">21-th May 2004</emphasis></birthDate> + <birthDate><emphasis role="red">21-st May 2004</emphasis></birthDate> </contact></programlisting></td> </tr> </informaltable> @@ -1275,21 +1275,34 @@ String s1 = new String(), s2 = new String();</programlisting> <informaltable border="0"> <tr> - <td valign="top"><programlisting language="none"><xs:simpleType name="contactCategoryType"> - <xs:restriction base="xs:string"> - <xs:enumeration value="<emphasis role="red">friend</emphasis>"/> - <xs:enumeration value="<emphasis role="red">colleague</emphasis>"/> - <xs:enumeration value="<emphasis role="red">businessPartner</emphasis>"/> - </xs:restriction> -</xs:simpleType></programlisting></td> + <td valign="top"><programlisting language="none"><xs:simpleType name="<emphasis + role="red">contactCategoryType</emphasis>"> + <xs:restriction base="xs:string"> <emphasis role="red"> â–²</emphasis> + <xs:enumeration value="<emphasis role="red">friend</emphasis>"/> <emphasis + role="red">â”—â”â”â”â”â”â”â”â”â”â”â”â”â”┓</emphasis> + <xs:enumeration value="<emphasis role="red">colleague</emphasis>"/> <emphasis + role="red">┃</emphasis> + <xs:enumeration value="<emphasis role="red">businessPartner</emphasis>"/> <emphasis + role="red">┃</emphasis> + </xs:restriction> <emphasis role="red">┃</emphasis> +</xs:simpleType> <emphasis role="red">┃</emphasis> + <emphasis role="red">┃</emphasis> +<xs:element name="contact"> <emphasis role="red">┃</emphasis> + <xs:complexType> <emphasis role="red">┃</emphasis> + <xs:sequence> ... </xs:sequence> <emphasis + role="red">┃</emphasis> + <xs:attribute name="birthDate" type="<emphasis role="red">contactCategoryType</emphasis>" + use="optional"/> + </xs:complexType> +</xs:element></programlisting></td> <td valign="top"><programlisting language="none"><contact category="<emphasis role="red">author</emphasis>"> <firstName>Joe</firstName> <lastName>Simpson</lastName> -</contact></programlisting><para>Value 'author' is not - facet-valid</para><para>with respect to - enumeration</para><para>'[friend, colleague, +</contact></programlisting><para>Value '<emphasis + role="red">author</emphasis>' is not facet-valid</para><para>with + respect to enumeration</para><para>'[friend, colleague, businessPartner]'...</para></td> </tr> </informaltable> @@ -2849,10 +2862,10 @@ key "primaryKey". --></emphasis> <question> <para>Use <xref linkend="glo_OxygenXml"/> for validation of <link - xlink:href="/Sda1/Ref/src/Memo.1/message.xml">message.xml</link> + xlink:href="Ref/Memo/V08_datePriority/message.xml">message.xml</link> against <link - xlink:href="/Sda1/Ref/src/Memo.1/memo.xsd">memo.xsd</link>. Then - subsequently do and undo the following changes each time + xlink:href="Ref/Memo/V08_datePriority/memo.xsd">memo.xsd</link>. + Then subsequently do and undo the following changes each time checking for validity:</para> <itemizedlist> @@ -2898,22 +2911,22 @@ key "primaryKey". --></emphasis> relation between XML <abbrev xlink:href="https://en.wikipedia.org/wiki/Document_Type_Declaration">schema</abbrev>'s and sets of <xref linkend="glo_Java"/> classes rather then - building a running application. We want to model the <link - xlink:href="/Sda1/Ref/src/Memo.1/memo.xsd">memo schema</link> as - a set of <xref linkend="glo_Java"/> classes.</para> + building a running application: Model the <link + xlink:href="/Sda1/Ref/src/Memo.1/memo.xsd"><tag + class="starttag">memo</tag> schema</link> as a set of <xref + linkend="glo_Java"/> classes as closely as possible.</para> </question> <answer> <para>The XML attributes <tag class="attribute">date</tag> and <tag class="attribute">priority</tag> can be mapped as <xref - linkend="glo_Java"/> attributes. The same applies for the Memo - elements <tag class="element">from</tag>, <tag - class="element">subject</tag> and <tag - 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 schema is expected to grow in complexity. A simple - sketch reads:</para> + linkend="glo_Java"/> instance attributes. The same applies to + the elements <tag class="starttag">from</tag>, <tag + class="starttag">subject</tag> and <tag + class="starttag">content</tag> which may be implemented as + simple <link + xlink:href="https://docs.oracle.com/javase/10/docs/api/java/lang/String.html">String</link> + instances. A simple sketch reads:</para> <programlisting language="java">import java.util.Date; import java.util.SortedSet; @@ -2926,25 +2939,29 @@ public class Memo { // Accessors not yet implemented }</programlisting> - <para>The only thing to note here is the implementation of the - <tag class="element">to</tag> element: We want to be able to - address a <emphasis>set</emphasis> of recipients. Thus we have - to disallow duplicates. Note that this is an + <para>The only point worth noting here is the <tag + class="starttag">to</tag> element's implementation: We want to + be able addressing 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 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="https://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> + our schema: A <tag class="starttag">memo</tag> document instance + <emphasis>may</emphasis> have duplicate content in <tag + class="starttag">to</tag> nodes. This is a current weakness of + our <abbrev + xlink:href="https://en.wikipedia.org/wiki/Document_Type_Declaration">schema</abbrev>: + We are yet unable to impose uniqueness constraints on the + content of partial sets of document nodes. This topic is being + addressed in <xref + linkend="sda1_xmlschema_sect_uniquenessConstraints"/>.</para> <para>On the other hand our set of recipients has to be ordered: In a XML document instance the order of <tag class="starttag">to</tag> nodes is important and has to be preserved in a <xref linkend="glo_Java"/> representation. Thus we choose an <classname>java.util.SortedSet</classname> - parametrized with String type to fulfill both - requirements.</para> + parametrized with <link + xlink:href="https://docs.oracle.com/javase/10/docs/api/java/lang/String.html">String</link> + type to fulfill both requirements.</para> <para>Our schema defines:</para> @@ -2956,8 +2973,8 @@ public class Memo { </xs:restriction> </xs:simpleType></programlisting> - <para>Starting from <xref linkend="glo_Java"/> 1.5 we may - implement this constraint by a type safe enumeration:</para> + <para>Starting from <xref linkend="glo_Java"/> 1.5 type safe + enumerations are a perfect match:</para> <programlisting language="java">public enum Priority {low, standard, high};</programlisting> </answer>