From 3caaf553b5179f3cb39b35f2a876e88de5b7e6e1 Mon Sep 17 00:00:00 2001 From: "Dr. Martin Goik" <goik@hdm-stuttgart.de> Date: Thu, 31 May 2018 07:10:39 +0200 Subject: [PATCH] removing whitespace --- Doc/Sd1/arrays.xml | 150 +++++------ Doc/Sd1/collections.xml | 58 ++--- Doc/Sd1/coreClasses.xml | 90 +++---- Doc/Sd1/deployment.xml | 10 +- Doc/Sd1/errorHandling.xml | 22 +- Doc/Sd1/gettingStarted.xml | 48 ++-- Doc/Sd1/inheritance.xml | 42 +-- Doc/Sd1/interfacesAbstractClasses.xml | 36 +-- Doc/Sd1/languageFundamentals.xml | 156 ++++++------ Doc/Sd1/statements.xml | 324 ++++++++++++------------ Doc/Sd1/streams.xml | 36 +-- Doc/Sd1/workingWithNumbers.xml | 34 +-- Doc/Sda1/dom.xml | 112 ++++---- Doc/Sda1/fo.xml | 40 +-- Doc/Sda1/jdbc.xml | 90 +++---- Doc/Sda1/jpaintro.xml | 100 ++++---- Doc/Sda1/mongodb.xml | 2 +- Doc/Sda1/prerequisites.xml | 52 ++-- Doc/Sda1/sax.xml | 56 ++-- Doc/Sda1/schema.xml | 40 +-- Doc/Sda1/vaadin.xml | 30 +-- Doc/Sda1/xmlintro.xml | 8 +- Doc/Sda1/xmlschema.xml | 352 +++++++++++++------------- Doc/Sda1/xslt.xml | 82 +++--- Doc/Sdi/dns.xml | 4 +- Doc/Sdi/docker.xml | 34 +-- Doc/Sdi/gettingStarted.xml | 12 +- Doc/Sdi/ldap.xml | 2 +- Doc/Sdi/samba.xml | 8 +- Doc/Tdoc/general.xml | 128 +++++----- Doc/Tdoc/software.xml | 10 +- 31 files changed, 1084 insertions(+), 1084 deletions(-) diff --git a/Doc/Sd1/arrays.xml b/Doc/Sd1/arrays.xml index c37b6f474..68b5562d8 100644 --- a/Doc/Sd1/arrays.xml +++ b/Doc/Sd1/arrays.xml @@ -211,12 +211,12 @@ primes[4] = 11; [] strings)</methodname> as in:</para> <programlisting language="java">public class Stringarray2Html { - + /** * Create an unordered ... * ... */ - static public String strings2html(final String [] strings) { + static public String strings2html(final String [] strings) { ... return ...; } @@ -298,7 +298,7 @@ primes[4] = 11; define:</para> <programlisting language="java">public class Segment { - + /** * Indication a segment does not have any speed limit. */ @@ -308,12 +308,12 @@ primes[4] = 11; * The distance of the current leg in km. */ public final double distance; - + /** - * The current leg's speed limit in km / h. + * The current leg's speed limit in km / h. */ public final int speedLimit; - + /** * Creating an (immutable) leg * @param distance {@link #distance} @@ -343,19 +343,19 @@ primes[4] = 11; * official speed limits and the driver's personal maximum speed. If a * leg does not have any speed limit the value of personalSpeedLimit will * be used for calculation instead. - * + * * @param route The array of segments composing a route. - * - * @param personalSpeedLimit The drivers personal speed limit whether or + * + * @param personalSpeedLimit The drivers personal speed limit whether or * not official limits apply. Must be greater than 0. - * + * * @return The minimal duration in (rounded) minutes with respect to all * speed limits. Must be a positive (non-zero) value. */ static public long duration(Segment[] route, int personalSpeedLimit) { return 0; // TODO } - </programlisting> +</programlisting> <para>Write <xref linkend="glo_Junit"/> tests to cover different situations.</para> @@ -369,7 +369,7 @@ primes[4] = 11; * @param args unused */ public static void main(String[] args) { - + final Segment[] route = new Segment[] { new Segment(2.4, 50) ,new Segment(5, 100) @@ -377,10 +377,10 @@ primes[4] = 11; ,new Segment(0.8, 30) }; ... - + final long fullMinutes = ...; - - System.out.println("Minimal duration:" + fullMinutes); + + System.out.println("Minimal duration:" + fullMinutes); }</programlisting> </tip> </question> @@ -693,11 +693,11 @@ Mark|frequency <orderedlist> <listitem> - <programlisting language="java">type[] arrayName; </programlisting> + <programlisting language="java">type[] arrayName;</programlisting> </listitem> <listitem> - <programlisting language="java">type arrayName[]; </programlisting> + <programlisting language="java">type arrayName[];</programlisting> </listitem> </orderedlist> </figure> @@ -710,7 +710,7 @@ Mark|frequency ...println(" double[]: " + new double[]{}.getClass().getName()); ...println(" boolean[]: " + new boolean[]{}.getClass().getName()); ...println(" String[]: " + new String[]{}.getClass().getName()); -...println("StringBuffer[]: " + new StringBuffer[]{}.getClass().getName()); </programlisting> +...println("StringBuffer[]: " + new StringBuffer[]{}.getClass().getName());</programlisting> <screen> String: java.lang.String int[]: [I @@ -1279,7 +1279,7 @@ final int[] sortedValues = Arrays.copyOf(values, values.length); <para>Loop over the sorted values. Due to sorting duplicates now appear in sequence:</para> - <programlisting language="java">{1, 1, 1, 5, 6, 6} </programlisting> + <programlisting language="java">{1, 1, 1, 5, 6, 6}</programlisting> <para>You may create a secondary array holding only distinct index values. In the given example this would contain index @@ -1290,7 +1290,7 @@ final int[] sortedValues = Arrays.copyOf(values, values.length); <para>Create a result array containing only distinct values:</para> - <programlisting language="java">{1, 5, 6} </programlisting> + <programlisting language="java">{1, 5, 6}</programlisting> </listitem> </orderedlist> </tip> @@ -1342,7 +1342,7 @@ final int[] sortedValues = Arrays.copyOf(values, values.length); for (int i = 0; i < uniqueValueIndexTop; i++) { // Copy distinct values to result array - result[i] = sortedValues[uniqueValuesIndex[i]]; + result[i] = sortedValues[uniqueValuesIndex[i]]; } return result; } @@ -1585,17 +1585,17 @@ Parameter 3: -13</screen> <informaltable border="0"> <tr> - <td valign="top"><programlisting language="none"><artifactId>maven-shade-plugin</artifactId> + <td valign="top"><programlisting language="none"><artifactId>maven-shade-plugin</artifactId> ... -<transformer ...> +<transformer ...> <manifestEntries> <Main-Class><emphasis role="red">myapp.Cmd</emphasis></Main-Class> </manifestEntries>...</programlisting></td> <td valign="top"><screen>unzip ww-1.0-SNAPSHOT.jar -cat tmp/META-INF/MANIFEST.MF +cat tmp/META-INF/MANIFEST.MF ... -Created-By: Apache Maven 3.5.0 +Created-By: Apache Maven 3.5.0 Build-Jdk: 1.8.0_151 Main-Class: <emphasis role="red">myapp.Cmd</emphasis></screen></td> </tr> @@ -1623,7 +1623,7 @@ public class Driver { public static void main(String[] args) { final Scanner scanner = new Scanner(System.in); - + System.out.print("How many values do you want to summ up? "); final int numValues = scanner.nextInt(); @@ -2151,8 +2151,8 @@ x..</screen></td> <programlisting language="java">public class Player { - final public static Player - PLAYER1 = new Player ("Jim", 'O'), + final public static Player + PLAYER1 = new Player ("Jim", 'O'), PLAYER2 = new Player("Eve", 'X'); public final String nickname; @@ -2164,7 +2164,7 @@ x..</screen></td> } public Player getOtherPlayer() { - + if (PLAYER1 == this) { return PLAYER2; } else if (PLAYER2 == this) { @@ -2215,10 +2215,10 @@ Results : Tests run: 2, Failures: 0, Errors: 0, Skipped: 0 -[INFO] +[INFO] <emphasis role="bold">[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ tictactoe --- [INFO] Building jar: /.../P/Sd1/TicTacToe/V1/target/tictactoe-0.9.jar -[INFO] +[INFO] [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ tictactoe --- [INFO] Installing /.../de/hdm-stuttgart/mi/sd1/tictactoe/0.9/tictactoe-0.9.jar </emphasis>[INFO] Installing /ma/.../de/hdm-stuttgart/mi/sd1/tictactoe/0.9/tictactoe-0.9.pom @@ -2461,7 +2461,7 @@ System.out.println(3 * b);</programlisting> <programlisting language="java">@Test public void testApp() { - + double b= 1./3.; b++; b--; @@ -2539,7 +2539,7 @@ public void testApp() { not:</para> <programlisting language="java"> /** - * Test, whether a given number is prime. + * Test, whether a given number is prime. * @param candidate The number to be assessed * @return true if candidate is prime, false otherwise * <dl> @@ -2621,7 +2621,7 @@ public void testApp() { final int[] primeNumbers = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 31, 37, 41, 43, 47, 53, 59, 29, 61, 67, 71, 73, 79, 83, 89, 97}; - + final boolean[] isPrime = new boolean[101]; //Testing 2, 3, 4, .., 99, 100 for (int i = 2; i <= 100; i++) { isPrime[i] = false; @@ -2942,7 +2942,7 @@ values newArray | 1| 2| F| 7| 9| | ...</screen> <dt><b>Precondition:</b></dt> <dd>There must be at least one element.</dd> </dl> - * + * * @return The sample's median. */ public double getMedian() { @@ -3090,7 +3090,7 @@ values newArray | 1| 2| F| 7| 9| | ...</screen> <programlisting language="java"> public IntegerStore(final int[] values) { this.values = values; - } </programlisting> + }</programlisting> <para>This will fail in most cases since the array parameter typically contains unsorted values.</para> @@ -3117,7 +3117,7 @@ values newArray | 1| 2| F| 7| 9| | ...</screen> IntegerStore store = new IntegerStore(new int[] {2, 7, 0, -3, 4}); assertArrayEquals(new int[] {-3, 0, 2, 4, 7}, store.getValues()); assertTrue(Math.abs(2. - store.getMedian()) < 1.E-10); - + store.addValue(7); assertArrayEquals(new int[] {-3, 0, 2, 4, 7, 7}, store.getValues()); assertTrue(Math.abs(3. - store.getMedian()) < 1.E-10); @@ -3162,45 +3162,45 @@ values newArray | 1| 2| F| 7| 9| | ...</screen> language="java">sin(x)</code> and other functions in a terminal like e.g.:</para> - <screen> ****** - ** ** - * ** - * * - * * - * * - * * - * * - * - * * - * - * * - * - * * - * - * - * * - * - * + <screen> ****** + ** ** + * ** + * * + * * + * * + * * + * * + * + * * + * + * * + * + * * + * + * + * * + * + * * * * - * - * - * - * * - * - * - * * - * - * * - * - * * - * - * * - * * - * * - * * - * * - ** * - ** ** + * + * + * + * * + * + * + * * + * + * * + * + * * + * + * * + * * + * * + * * + * * + ** * + ** ** ******</screen> </question> diff --git a/Doc/Sd1/collections.xml b/Doc/Sd1/collections.xml index ae97c1e53..aaf4c3f27 100644 --- a/Doc/Sd1/collections.xml +++ b/Doc/Sd1/collections.xml @@ -240,7 +240,7 @@ Jim</screen> to allow execution of:</para> <programlisting language="java"> // Defining and testing integer coordinates - final Coordinate + final Coordinate c12 = new Coordinate(1, 2), c52 = new Coordinate(5, 0), c12Duplicate = new Coordinate(1, 2); @@ -275,7 +275,7 @@ c12.equals("dummy"):false private int x, y; /** - * Create a Cartesian coordinate / point. + * Create a Cartesian coordinate / point. * @param x * @param y */ @@ -366,7 +366,7 @@ c12.equals("dummy"):false xlink:href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html#equals-java.lang.Object-">equals()</methodname> method. Consider:</para> - <programlisting language="java"> final Coordinate + <programlisting language="java"> final Coordinate c12 = new Coordinate(1, 2), c12Duplicate = new Coordinate(1, 2); @@ -534,13 +534,13 @@ c12.equals("dummy"):false <programlisting language="java"> @Test public void testWordSet() throws FileNotFoundException, IOException { - - final Set<String> expectedStrings = + + final Set<String> expectedStrings = new HashSet <String>(Arrays.asList(new String[]{ "A", "simple", "collection", "of", "words", "Some", "may", "appear", "multiple", "times" })); - + final TextFileHandler tfh = new TextFileHandler("smalltest.txt"); Assert.assertTrue(tfh.getWords().equals(expectedStrings)); }</programlisting> @@ -563,7 +563,7 @@ c12.equals("dummy"):false code to get the same set of words but in alphabetic order with respect to capital and small letters:</para> - <screen>A, Some, appear, collection, may, multiple, of, simple, times, words </screen> + <screen>A, Some, appear, collection, may, multiple, of, simple, times, words</screen> </question> <answer> @@ -718,7 +718,7 @@ You found Pascal!"</literallayout> frequency of appearance:</para> <programlisting language="java">/** - * A helper class to account for frequencies of words found in textual input. + * A helper class to account for frequencies of words found in textual input. * */ public class WordFrequency { @@ -1094,7 +1094,7 @@ End of records</screen> ... <tr> <td>Graham <b>Stanwick</b></td> - <td><emphasis role="bold"><![CDATA[73 Hawkstone St, Renfrew South & Gallowhill War]]></emphasis>, + <td><emphasis role="bold"><![CDATA[73 Hawkstone St, Renfrew South & Gallowhill War]]></emphasis>, <b>G52 4YG</b></td> <td>01860-191930</td> <td>gstanwick@gmail.com</td> @@ -1167,26 +1167,26 @@ End of records</screen> * More formally, sets contain no pair of Strings s1 and s2 such that * s1.equals(s2), and no null elements. As implied by its name, * this class models the mathematical set abstraction. - * + * * The StringSet class places stipulations on the contracts of the add, - * equals and hashCode methods. + * equals and hashCode methods. * * The stipulation on constructors is, not surprisingly, that all constructors * must create a set that contains no duplicate elements (as defined above). * */ public interface Set_String { - + /** - * Returns the number of strings in this set (its cardinality). - * + * Returns the number of strings in this set (its cardinality). + * * @return the number of elements in this set (its cardinality) */ public int size() ; /** * Returns true if this set contains no elements. - * + * * @return true if this set contains no elements */ public boolean isEmpty(); @@ -1195,21 +1195,21 @@ public interface Set_String { * Returns true if this set contains the specified element. More * formally, returns true if and only if this set contains an * element e such that (o==null ? e==null : o.equals(e)). - * + * * @param o element whose presence in this set is to be tested * @return true if this set contains the specified element. * A null value will be treated as "not in set". - * + * */ public boolean contains(Object o); /** * Returns an array containing all strings in this set. - * + * * The returned array will be "safe" in that no references to it are * maintained by this set. (In other words, this method allocates * a new array). The caller is thus free to modify the returned array. - * + * * @return an array containing all strings in this set. */ public String[] toArray(); @@ -1221,16 +1221,16 @@ public interface Set_String { * If this set already contains the element, the call leaves the set * unchanged and returns false. In combination with the restriction on * constructors, this ensures that sets never contain duplicate elements. - * + * * null values will be discarded - * + * * @param s string to be added to this set - * + * * @return true if this set did not already contain the specified element. * The attempted insert of a null value will return false. */ public boolean add(String s); - + /** * Removes the specified string from this set if it is present * (optional operation). More formally, removes a string s @@ -1239,7 +1239,7 @@ public interface Set_String { * the string (or equivalently, if this set changed as a result * of the call). (This set will not contain the string once the * call returns.) - * + * * @param s String to be removed from this set, if present. * @return true if this set contained the specified string. */ @@ -1249,7 +1249,7 @@ public interface Set_String { * Removes all of the strings from this set (optional operation). * The set will be empty after this call returns. */ - public void clear(); + public void clear(); }</programlisting> <para>Implement this interface:</para> @@ -1262,16 +1262,16 @@ public interface Set_String { public MySet_String() { ... } - - /** + + /** * Copy array values into this set excluding duplicates. - * + * * @param source The array to copy values from */ public MySet_String(final String[] source) { ... } - + @Override public int size() { ... diff --git a/Doc/Sd1/coreClasses.xml b/Doc/Sd1/coreClasses.xml index 5da796e55..75f9b453a 100644 --- a/Doc/Sd1/coreClasses.xml +++ b/Doc/Sd1/coreClasses.xml @@ -217,7 +217,7 @@ s1.equals(s2): true</screen> <programlisting language="java"> int value = 33; double secondValue = 114.317; - + System.out.format("Just a single integer %3d\n", value); System.out.format("An integer %3d and a double value %6.2f\n", value, secondValue);</programlisting> @@ -277,7 +277,7 @@ s1.equals(s2): true</screen> <programlisting language="java"> final int v = 33; final double d = 114.317; final short color = 255; - + System.out.format("v=%d, d=%5.2f, color=%2x\n", v, d, color);</programlisting> <para>This generates the following output:</para> @@ -287,7 +287,7 @@ s1.equals(s2): true</screen> <para>We may prettify our code to better reflect the one to one correspondence between format strings and variables:</para> - <programlisting language="java"> System.out.format("v=%d, d=%5.2f, color=%2x\n", + <programlisting language="java"> System.out.format("v=%d, d=%5.2f, color=%2x\n", v, d, color);</programlisting> <caution> @@ -331,11 +331,11 @@ java.util.IllegalFormatConversionException: <emphasis role="bold">d != java.lang language="java">final</code> modifier:</para> <programlisting language="java">public static void main(String[] args) { - + double radius = 2.31; // A circle having a radius (given e.g. in mm). final double pi = 3.1415926; // Creating pi as a constant (non-modifiable/ // assignable) variable. - + final double area = pi * radius * radius; System.out.println(area); }</programlisting> @@ -363,9 +363,9 @@ java.util.IllegalFormatConversionException: <emphasis role="bold">d != java.lang <para>The short answer simply is:</para> <programlisting language="java" linenumbering="numbered">public static void main(String[] args) { - + double radius = 2.31; // A circle having a radius (given e.g. in mm). - + final double area = Math.PI * radius * radius; System.out.println(area); }</programlisting> @@ -645,7 +645,7 @@ public class CircleAreaCalculator { traversing the <xref linkend="glo_unicode"/> block:</para> <programlisting language="java"> public static void main(String[] args) { - + final StringBuffer sb = new StringBuffer(); for (int i = 0x1F600; i < 0x1F650; i += 0x10) { // 1F600, 1F610, ..., 1F640 for (int j = 0; j < 0x10; j++) { // 0, 1, 2, ..., 15 @@ -712,7 +712,7 @@ public class CircleAreaCalculator { literals:</para> <programlisting language="java">final String input = "731671765 ... 94934" - + ... + + ... + "716362695 ... 63450";</programlisting> </listitem> @@ -774,7 +774,7 @@ public class CircleAreaCalculator { + "05886116467109405077541002256983155200055935729725"; final int numOfDigits = 13; // The intended number of adjacent digits - + for (int i = 0; i < input.length() - numOfDigits + 1; i++) { final String fourDigitWord = input.substring(i, i + numOfDigits); System.out.println(fourDigitWord); @@ -804,15 +804,15 @@ public class CircleAreaCalculator { switch(digit) { case '0': return 0; case '1': return 1; - case '2': return 2; - case '3': return 3; + case '2': return 2; + case '3': return 3; case '4': return 4; case '5': return 5; case '6': return 6; case '7': return 7; case '8': return 8; case '9': return 9; - default: + default: System.err.println("Character '" + digit + "' is no digit, exiting"); System.exit(1); return 0; @@ -891,7 +891,7 @@ public class CircleAreaCalculator { + "05886116467109405077541002256983155200055935729725"; final int numOfDigits = 13; // The intended number of adjacent digits - + long maximumDigitProduct = 0; String maxDigitString = null; for (int i = 0; i < input.length() - numOfDigits + 1; i++) { @@ -962,10 +962,10 @@ public class CircleAreaCalculator { <programlisting language="java">a1 == a2: true <co linkends="answerCoStringOperatorEquality-1" xml:id="answerCoStringOperatorEquality-1-co"/> -a1.equals(a2): true +a1.equals(a2): true b1 == b2: false <co linkends="answerCoStringOperatorEquality-2" xml:id="answerCoStringOperatorEquality-2-co"/> -b1.equals(b2): true </programlisting> +b1.equals(b2): true</programlisting> <calloutlist> <callout arearefs="answerCoStringOperatorEquality-1-co" @@ -1054,9 +1054,9 @@ b1.equals(b2): true </programlisting> <para>Consider the following code snippet:</para> <programlisting language="java"> public static void main(String[] args) { - + final String reference = "Anton"; - + final String name = "An" + "ton"; System.out.println("Content:" + name); @@ -1077,12 +1077,12 @@ b1.equals(b2): true </programlisting> <programlisting language="java"> public static void main(String[] args) { final String reference = "Anton"; - + <emphasis role="bold">final String name = "An".concat("ton");</emphasis> <co xml:id="sd1CoNamedefByConcatMethod"/> - + System.out.println("Content:" + name); - + if (name == reference) { System.out.println("Instances are equal"); } else { @@ -1273,7 +1273,7 @@ b1.equals(b2): true </programlisting> public static void main( String[] args ) { final FileMetaInfo fmi = new FileMetaInfo("C:\\users\\heinz\\Desktop\\index.html"); - + System.out.println("Filename is relative? " + fmi.isRelative); System.out.println("Drive letter:" + fmi.drive); System.out.println("Directory path: " + fmi.path); @@ -1425,16 +1425,16 @@ File extension: html</screen> point:</para> <programlisting language="java">public class MetaInfoUnixTest { - + static private final boolean isWindows = System.getProperty("os.name").startsWith("Windows"); - + @Test public void testAbsoluteWithoutExtension() { Assume.assumeFalse(isWindows); - + final FileMetaInfo fmi = new FileMetaInfo("/usr/openvpn/hdm"); - + Assert.assertFalse(fmi.isRelative); Assert.assertEquals(FileMetaInfo.noDrive, fmi.drive); Assert.assertEquals("/usr/openvpn", fmi.path); @@ -1445,9 +1445,9 @@ File extension: html</screen> @Test public void testAbsoluteWithExtension() { Assume.assumeFalse(isWindows); - + final FileMetaInfo fmi = new FileMetaInfo("/usr/openvpn/hdm.conf"); - + Assert.assertFalse(fmi.isRelative); Assert.assertEquals(FileMetaInfo.noDrive, fmi.drive); Assert.assertEquals("/usr/openvpn", fmi.path); @@ -1458,9 +1458,9 @@ File extension: html</screen> @Test public void testRelativeWithoutExtension() { Assume.assumeFalse(isWindows); - + final FileMetaInfo fmi = new FileMetaInfo("../Desktop/icon"); - + Assert.assertTrue(fmi.isRelative); Assert.assertEquals(FileMetaInfo.noDrive, fmi.drive); Assert.assertEquals("../Desktop", fmi.path); @@ -1471,9 +1471,9 @@ File extension: html</screen> @Test public void testRelativeWithExtension() { Assume.assumeFalse(isWindows); - + final FileMetaInfo fmi = new FileMetaInfo("../../Desktop/icon.gif"); - + Assert.assertTrue(fmi.isRelative); Assert.assertEquals(FileMetaInfo.noDrive, fmi.drive); Assert.assertEquals("../../Desktop", fmi.path); @@ -1483,17 +1483,17 @@ File extension: html</screen> }</programlisting> <programlisting language="java">public class MetaInfoWindowsTest { - + static private final boolean isWindows = System.getProperty("os.name").startsWith("Windows"); - + @Test public void testAbsoluteWithoutExtension() { Assume.assumeTrue(isWindows); - - final FileMetaInfo fmi = + + final FileMetaInfo fmi = new FileMetaInfo("F:\\software\\my\\archive"); - + Assert.assertFalse(fmi.isRelative); Assert.assertEquals('F', fmi.drive); Assert.assertEquals("\\software\\my", fmi.path); @@ -1504,10 +1504,10 @@ File extension: html</screen> @Test public void testAbsoluteWithExtension() { Assume.assumeTrue(isWindows); - - final FileMetaInfo fmi = + + final FileMetaInfo fmi = new FileMetaInfo("F:\\subdir\\archive.zip"); - + Assert.assertFalse(fmi.isRelative); Assert.assertEquals('F', fmi.drive); Assert.assertEquals("\\subdir", fmi.path); @@ -1518,9 +1518,9 @@ File extension: html</screen> @Test public void testRelativeWithoutExtension() { Assume.assumeTrue(isWindows); - + final FileMetaInfo fmi = new FileMetaInfo("..\\Desktop\\icon"); - + Assert.assertTrue(fmi.isRelative); Assert.assertEquals(FileMetaInfo.noDrive, fmi.drive); Assert.assertEquals("..\\Desktop", fmi.path); @@ -1531,10 +1531,10 @@ File extension: html</screen> @Test public void testRelativeWithExtension() { Assume.assumeTrue(isWindows); - - final FileMetaInfo fmi = + + final FileMetaInfo fmi = new FileMetaInfo("..\\..\\Desktop\\icon.gif"); - + Assert.assertTrue(fmi.isRelative); Assert.assertEquals(FileMetaInfo.noDrive, fmi.drive); Assert.assertEquals("..\\..\\Desktop", fmi.path); diff --git a/Doc/Sd1/deployment.xml b/Doc/Sd1/deployment.xml index 56a85becb..67a4b5bb7 100644 --- a/Doc/Sd1/deployment.xml +++ b/Doc/Sd1/deployment.xml @@ -60,12 +60,12 @@ public class ArrayMethodTest { <programlisting language="java"> int a = 3, b = 5; // Other code ... - + {// Swap values of a and b final int tmp = a; a = b; b = tmp; - } </programlisting> + }</programlisting> </glossdef> </glossentry> @@ -239,13 +239,13 @@ No values provided</screen> * them to integer values. */ public class InputValidator { - + /** * Integer values being calculated upon * constructor call. */ public final int[] values; - + /** * Transform a series of strings into integer values. In case * of invalid input, a corresponding error messsage will be written @@ -254,7 +254,7 @@ public class InputValidator { * contains two valid elements and the invalid element "three" which * cannot be converted to an integer value by virtue of * {@link Integer#parseInt(String)}. - * + * * @param userInput A set of strings possibly representing integer values. */ public InputValidator(final String[] userInput) {...} diff --git a/Doc/Sd1/errorHandling.xml b/Doc/Sd1/errorHandling.xml index 0aaddfcc7..97cf8636f 100644 --- a/Doc/Sd1/errorHandling.xml +++ b/Doc/Sd1/errorHandling.xml @@ -163,7 +163,7 @@ System.out.println("Business as usual ...");</programlisting> [code that is executed when ExceptionType-1 is thrown] }] [catch (ExceptionType-2 e) { [code that is executed when ExceptionType-2 is thrown] -}] +}] ... } [catch (ExceptionType-n e) { [code that is executed when ExceptionType-n is thrown] @@ -183,13 +183,13 @@ System.out.println("Business as usual ...");</programlisting> <tr> <td valign="top"><programlisting language="none">public static void main(String[] args) { final Path - sourcePath = Paths.get("/tmp/test.txt"), + sourcePath = Paths.get("/tmp/test.txt"), destPath = Paths.get("/tmp/copy.java"); // Compile time error: - // <emphasis role="red">Unhandled exception: - java.io.IOException</emphasis> - Files.copy(sourcePath, destPath); + // <emphasis role="red">Unhandled exception: + java.io.IOException</emphasis> + Files.copy(sourcePath, destPath); ...</programlisting></td> <td valign="top"><programlisting language="none">public static void @@ -198,7 +198,7 @@ System.out.println("Business as usual ...");</programlisting> final String s = null; // <emphasis role="red">No problem</emphasis> -System.out.println(s.length()); </programlisting></td> +System.out.println(s.length());</programlisting></td> </tr> </informaltable> </figure> @@ -358,7 +358,7 @@ try { <td valign="top"><programlisting language="java" linenumbering="numbered">package exceptionhandling; public class StackTrace { - public static void main( + public static void main( String[] args){ a(); } @@ -371,7 +371,7 @@ public class StackTrace { }</programlisting></td> <td valign="top"><screen>Exception in thread "main" - java.lang.NullPointerException + java.lang.NullPointerException at ex.Trace.c(Trace.java:10) at ex.Trace.b(Trace.java:7) at ex.Trace.a(Trace.java:6) @@ -386,7 +386,7 @@ public class StackTrace { <informaltable border="0"> <tr> <td valign="top"><programlisting language="java">try { - FileInputStream f = new FileInputStream( + FileInputStream f = new FileInputStream( new File("test.txt")); } catch(FileNotFoundException e) { System.err.println( "File not found"); @@ -418,7 +418,7 @@ public class StackTrace { } catch (<emphasis role="red">IOException e</emphasis>) { System.err.println( "IO error"); } catch(<emphasis role="red">FileNotFoundException e</emphasis>) { - System.err.println("File not found"); + System.err.println("File not found"); }</programlisting></td> <td valign="top"><mediaobject> @@ -499,7 +499,7 @@ static public String convert(final String input) { <figure xml:id="sd1_errorHandling_fig_cardinalThrowErrorStep2"> <title>Step 2: Derive <classname>CardinalException</classname></title> - <programlisting language="java">public class CardinalException + <programlisting language="java">public class CardinalException extends IllegalArgumentException { public CardinalException(final String msg) { diff --git a/Doc/Sd1/gettingStarted.xml b/Doc/Sd1/gettingStarted.xml index cc357991b..e668bc896 100644 --- a/Doc/Sd1/gettingStarted.xml +++ b/Doc/Sd1/gettingStarted.xml @@ -601,7 +601,7 @@ <programlisting language="java">public class HelloWorld { public static void main(String[] args) { - + System.out.println("Hello, World ..."); } @@ -666,7 +666,7 @@ <programlisting language="java"> public static void main(String[] args) { System.out.println( - "Those who can do.\n" + + "Those who can do.\n" + "Those, who cannot, teach.\n" + "Those, who cannot teach, " + "lecture trainee teachers teaching methodology."); @@ -690,13 +690,13 @@ <para>Execute:</para> <programlisting language="java" linenumbering="numbered"> public static void main(String[] args) { - + int a = 4, b = 7; - + System.out.println("a=" + a); System.out.println("b=" + b); - + int sum = a + b; System.out.println("Sum: " + sum); }</programlisting> @@ -720,7 +720,7 @@ <programlisting language="java" linenumbering="unnumbered">int a = 4, b = 7; - + System.out.println(...);</programlisting> </listitem> </orderedlist> @@ -740,10 +740,10 @@ System.out.println(...);</programlisting> <para>Execute:</para> <programlisting language="java"> public static void main(String[] args) { - + int a = 3, b = 87; - + if (a < b) { System.out.println("a is smaller than b"); } else if (b < a) { @@ -771,7 +771,7 @@ System.out.println(...);</programlisting> <para>Execute:</para> <programlisting language="java"> public static void main(String[] args) { - + int i = 0; while ( i < 5) { System.out.println("loop # " + i); @@ -910,10 +910,10 @@ loop # 12</screen> <profiles> <profile> <id>dev</id> - <repositories> + <repositories> <repository> <id>archetype</id> - <url><emphasis role="red">https://maven.mi.hdm-stuttgart.de/nexus/repository/mi-maven</emphasis></url> + <url><emphasis role="red">https://maven.mi.hdm-stuttgart.de/nexus/repository/mi-maven</emphasis></url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> @@ -960,7 +960,7 @@ loop # 12</screen> -DartifactId=gettingstarted -Dversion=0.9 -DarchetypeGroupId=de.hdm_stuttgart.mi \ -DarchetypeArtifactId=mi-maven-archetype-quickstart -DarchetypeVersion=1.2 [INFO] Scanning for projects... -[INFO] +[INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Stub Project (No POM) 1 ... @@ -1044,15 +1044,15 @@ loop # 12</screen> <glossdef> <screen>goik@mi-ESPRIMO-P910 gettingstarted> mvn compile [INFO] Scanning for projects... -[INFO] +[INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building gettingstarted 0.9 [INFO] ------------------------------------------------------------------------ -[INFO] +[INFO] [INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ gettingstarted --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 1 resource -[INFO] +[INFO] [INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ gettingstarted --- [INFO] Nothing to compile - all classes are up to date [INFO] ------------------------------------------------------------------------ @@ -1097,9 +1097,9 @@ Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 <screen>goik@mi-ESPRIMO-P910 gettingstarted> mvn install [INFO] Scanning for projects... ... -[INFO] +[INFO] [INFO] --- maven-install-plugin:2.3:install (default-install) @ gettingstarted --- -[INFO] Installing ../target/<filename>gettingstarted-0.9.jar</filename> to +[INFO] Installing ../target/<filename>gettingstarted-0.9.jar</filename> to /ma/goik/.m2/repository/my/base/url/gettingstarted/0.9/gettingstarted-0.9.jar</screen> <para>Notice the installation of @@ -1119,9 +1119,9 @@ Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 jar archive</link>. The <command>java</command> command allows for execution:</para> - <screen>java -jar target/gettingstarted-0.9.jar + <screen>java -jar target/gettingstarted-0.9.jar Hello World! -2017-06-02 16:06:14,901 DEBUG [main] sd1.App (App.java:21) - With respect to logging you may want to configure file +2017-06-02 16:06:14,901 DEBUG [main] sd1.App (App.java:21) - With respect to logging you may want to configure file 2017-06-02 16:06:14,903 DEBUG [main] sd1.App (App.java:22) - 'src/main/resources/log4j2.xml' to suit your needs. 2017-06-02 16:06:14,903 DEBUG [main] sd1.App (App.java:23) - This config file 'log4j2.xml' will result in 'A1.log' 2017-06-02 16:06:14,903 DEBUG [main] sd1.App (App.java:24) - file containing logging output as well.</screen> @@ -1139,7 +1139,7 @@ import org.apache.logging.log4j.Logger; /** * A simple http://logging.apache.org/log4j/2.x demo, * see file log4j2.xml for configuration options. - * + * */ public class App { private static Logger log = LogManager.getLogger(App.class); @@ -1149,7 +1149,7 @@ public class App { */ public static void main( String[] args ) { System.out.println( "Hello World!" ); - + log.debug("With respect to logging you may want to configure file "); log.debug("'src/main/resources/log4j2.xml' to suit your needs."); log.debug("This config file 'log4j2.xml' will result in 'A1.log'"); @@ -1168,11 +1168,11 @@ public class App { <glossdef> <screen>goik@mi-ESPRIMO-P910 gettingstarted> mvn clean [INFO] Scanning for projects... -[INFO] +[INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building gettingstarted 0.9 [INFO] ------------------------------------------------------------------------ -[INFO] +[INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ gettingstarted --- [INFO] Deleting /ma/goik/gettingstarted/target</screen> @@ -2222,7 +2222,7 @@ javac 1.8.0_91</screen> <screen>goik@hopc ~> cd Downloads/Exam goik@hopc Exam> mvn <emphasis role="bold">javadoc:javadoc</emphasis> [INFO] Scanning for projects... -[INFO] +[INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building sw1_2016summer_exam 0.8 [INFO] ------------------------------------------------------------------------ diff --git a/Doc/Sd1/inheritance.xml b/Doc/Sd1/inheritance.xml index d1899c40d..92ad0efe8 100644 --- a/Doc/Sd1/inheritance.xml +++ b/Doc/Sd1/inheritance.xml @@ -49,7 +49,7 @@ }</programlisting></td> <td valign="top"><programlisting language="none">public class Circle { - // Center coordinate + // Center coordinate private <emphasis role="red">double x</emphasis>; <coref linkend="sda_inherit_fig_codeDuplicate-1-co"/> private <emphasis role="red">double y</emphasis>; @@ -204,12 +204,12 @@ double height;</programlisting></td> </tr> <tr> - <td colspan="2" valign="top"><programlisting language="java">public class Rectangle extends Shape { + <td colspan="2" valign="top"><programlisting language="java">public class Rectangle extends Shape { private double width; private double height; }</programlisting></td> - <td colspan="2" valign="top"><programlisting language="java">public class Circle extends Shape { + <td colspan="2" valign="top"><programlisting language="java">public class Circle extends Shape { private double radius; }</programlisting></td> </tr> @@ -322,7 +322,7 @@ public Shape(double x,double y) { * @param width Rectangle's width. * @param height Rectangle's height. */ -public Rectangle(double x, double y, +public Rectangle(double x, double y, double width, double height) { super(x, y) <co linkends="sda_inherit_fig_RectangleConstructor-1" xml:id="sda_inherit_fig_RectangleConstructor-1-co"/>; @@ -505,10 +505,10 @@ public Rectangle(double x, double y, <informaltable border="0"> <tr> - <td valign="top"><programlisting language="java">public class Rectangle extents Shape { + <td valign="top"><programlisting language="java">public class Rectangle extents Shape { /** * Calculate the area. - * @return The rectangle's area + * @return The rectangle's area */ public double getArea() { return width * height; @@ -520,7 +520,7 @@ public Rectangle(double x, double y, * @return The circle's area */ public double getArea() { - return Math.PI * radius * radius; + return Math.PI * radius * radius; }</programlisting></td> </tr> </informaltable> @@ -623,22 +623,22 @@ Rectangle at (1.0|-1.0), width= 2.0, height=3.0: <emphasis role="red">area = 6.0 abstract<co linkends="sda_inherit_fig_implementAbstractGetArea-2" xml:id="sda_inherit_fig_implementAbstractGetArea-2-co"/> public double getArea()<co linkends="sda_inherit_fig_implementAbstractGetArea-3" - xml:id="sda_inherit_fig_implementAbstractGetArea-3-co"/>; ... </programlisting></td> + xml:id="sda_inherit_fig_implementAbstractGetArea-3-co"/>; ...</programlisting></td> <td valign="top"/> </tr> <tr> - <td colspan="2" valign="top"><programlisting language="java">public class Rectangle extends Shape { + <td colspan="2" valign="top"><programlisting language="java">public class Rectangle extends Shape { @Override<co linkends="sda_inherit_fig_implementAbstractGetArea-4" xml:id="sda_inherit_fig_implementAbstractGetArea-4-co"/> public double getArea() { return width * height; }...</programlisting></td> - <td colspan="2" valign="top"><programlisting language="java">public class Circle ... { + <td colspan="2" valign="top"><programlisting language="java">public class Circle ... { @Override<coref linkend="sda_inherit_fig_implementAbstractGetArea-4-co"/> - public double getArea() { + public double getArea() { return Math.PI * radius * radius; } ...</programlisting></td> @@ -886,7 +886,7 @@ double p = c.move(1, 5).move(-3, 7).getPrimeter();</programlisting> <classname>Shape</classname>:</para> <programlisting language="java">/** - * + * * @param factor Scale the current shape by this value. * @return The current object. */ @@ -929,7 +929,7 @@ double p = c.move(1, 5).move(-3, 7).getPrimeter();</programlisting> <programlisting language="java"> final Circle c = new Circle(-2, -1, 3.5); final Rectangle r = new Rectangle(3, 1, 1.5, 4.4); - + System.out.println(c); System.out.println(r);</programlisting> @@ -986,7 +986,7 @@ public abstract class Shape <co final protected long <emphasis role="red">creationTime</emphasis> <co linkends="sda_inherit_fig_protectedCreationTime-2" xml:id="sda_inherit_fig_protectedCreationTime-2-co"/>= System.nanoTime(); -... +... } ------------------------------------------------ <emphasis role="red">package model.sub</emphasis>; @@ -1234,7 +1234,7 @@ public class Rectangle static void print(final Shape[] shapes) { for (final Shape s : shapes) { if (s <link xlink:href="https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.20.2">instanceof</link> Rectangle) { - System.out.println("Type Rectangle"); + System.out.println("Type Rectangle"); } else if (s <link xlink:href="https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.20.2">instanceof</link> Circle) { System.out.println("Type Circle"); @@ -1321,8 +1321,8 @@ Type Rectangle</screen></td> xlink:href="https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.20.2">instanceof</link> Rectangle){ final Rectangle oRectangle = (Rectangle) o; return super.equalCenter(oRectangle) && - Math.abs(oRectangle.width- width) + - Math.abs(oRectangle.height- height) < 1.E-15; + Math.abs(oRectangle.width- width) + + Math.abs(oRectangle.height- height) < 1.E-15; } return false; } @@ -1342,10 +1342,10 @@ Type Rectangle</screen></td> <programlisting language="java">public class Circle extends Shape { @Override public boolean equals(final Object o) { if (o <link - xlink:href="https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.20.2">instanceof</link> Circle){ + xlink:href="https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.20.2">instanceof</link> Circle){ final Circle oCircle = (Circle) o; return super.equalCenter(o) && - Math.abs(oCircle.radius - radius) < 1.E-15; + Math.abs(oCircle.radius - radius) < 1.E-15; } return false; } ...</programlisting> @@ -1367,11 +1367,11 @@ Type Rectangle</screen></td> final Circle c = new Circle(2,3, 7); -System.out.println("r1.equals(r2): " + r1.equals(r2)); +System.out.println("r1.equals(r2): " + r1.equals(r2)); System.out.println("r1.equals(r3): " + r1.equals(r3)); System.out.println("c.equals(r1): " + c.equals(r1));</programlisting></td> - <td valign="top"><screen>r1.equals(r2): false + <td valign="top"><screen>r1.equals(r2): false r1.equals(r3): true c.equals(r1): false</screen></td> </tr> diff --git a/Doc/Sd1/interfacesAbstractClasses.xml b/Doc/Sd1/interfacesAbstractClasses.xml index 3f9f7e7f1..00a298a5e 100644 --- a/Doc/Sd1/interfacesAbstractClasses.xml +++ b/Doc/Sd1/interfacesAbstractClasses.xml @@ -84,7 +84,7 @@ try { output.println("Some dumb text"); output.println("More dumb text"); output.closeFile(); -} catch (final FileNotFoundException e){ +} catch (final FileNotFoundException e){ System.err.println("Unable to open '" + outputFileName + "' for writing"); }</programlisting></td> @@ -126,17 +126,17 @@ output.println("Too late!");</programlisting> <tr> <td valign="top"><programlisting language="java">final String outputFileName = "output.txt"; - -try (final Text2File output = + +try (final Text2File output = new Text2File(outputFileName)){ output.println("Some dumb text"); output.println("More dumb text"); -} catch (FileNotFoundException e){...} </programlisting></td> +} catch (FileNotFoundException e){...}</programlisting></td> <td valign="top"><para>Compile time error:</para><screen>Required: <link xlink:href="https://docs.oracle.com/javase/9/docs/api/java/lang/AutoCloseable.html">java.lang.AutoCloseable</link> Found: - de.hdm_stuttgart.mi.sd1.Text2File </screen></td> + de.hdm_stuttgart.mi.sd1.Text2File</screen></td> </tr> </informaltable> </figure> @@ -181,7 +181,7 @@ void close​() <co linkends="sd1_interface_fig_AutoCloseablePromise-2.2" private <co linkends="sd1_interface_fig_AutoCloseablePromise-2" xml:id="sd1_interface_fig_AutoCloseablePromise-2-co"/> PrintStream out; ... - public void println(final String s){ + public void println(final String s){ out.println(s); } public void close() <co linkends="sd1_interface_fig_AutoCloseablePromise-3" @@ -276,10 +276,10 @@ void close​() <co linkends="sd1_interface_fig_AutoCloseablePromise-2.2" linkends="sd1_interface_fig_AutoCloseableAsAbstractClass-1" xml:id="sd1_interface_fig_AutoCloseableAsAbstractClass-1-co"/> -abstract public +abstract public class AutoCloseable <co linkends="sd1_interface_fig_AutoCloseableAsAbstractClass-2" - xml:id="sd1_interface_fig_AutoCloseableAsAbstractClass-2-co"/>{ + xml:id="sd1_interface_fig_AutoCloseableAsAbstractClass-2-co"/>{ /** * Closes this resource, @@ -299,14 +299,14 @@ abstract void close​();<co private PrintStream out; ... - public void println(final String s){ + public void println(final String s){ out.println(s); } @Override public void close() <co linkends="sd1_interface_fig_AutoCloseableAsAbstractClass-5" xml:id="sd1_interface_fig_AutoCloseableAsAbstractClass-5-co"/>{ - out.close(); - out = null; + out.close(); + out = null; } }</programlisting></td> </tr> @@ -467,7 +467,7 @@ public interface MyFlushable extends MyAutoCloseable { "silver", "sweet", "nationwide", "competitive", "stable", // Index 19 "municipal", "famous" }; // Index 21 -private static final String[] THINGS = { +private static final String[] THINGS = { "elephant", "bowl", "brick", "spoon", "bunny", // Index 4 "watermelon", "car", "cat", "cup", "desk", // Index 9 "tangerine", "duck", "bottle", "road" , "fork", // Index 14 @@ -532,10 +532,10 @@ public void testApp() { 3, 7, 19, 26, // First sentence fixed index values 6, 20, 7, 15 // Second sentence fixed index values })); - - Assert.assertEquals("The gray cat threatens a dog.", + + Assert.assertEquals("The gray cat threatens a dog.", nonsenseGenerator.generateRandomSentence()); - Assert.assertEquals("The friendly lawyer meets with a physicist.", + Assert.assertEquals("The friendly lawyer meets with a physicist.", nonsenseGenerator.generateRandomSentence()); }</programlisting> </listitem> @@ -620,12 +620,12 @@ plotter.plot(sinFunction);</programlisting> */ public static void main( String[] args ) { final Plotter plotter = new Plotter(); - + plotter.setNumTics(80, 40);// 80 characters vertical, 40 characters horizontal plotter.setXrange(0, 2 * Math.PI); plotter.setYrange(-1, 1); - - // Function implementing the underlying interface + + // Function implementing the underlying interface // de.hdm_stuttgart.mi.sd1.plot.DoubleOfDoubleFunction // are being conveniently passed as arguments. plotter.plot(<emphasis role="bold">x -> Math.sin(x)</emphasis>); diff --git a/Doc/Sd1/languageFundamentals.xml b/Doc/Sd1/languageFundamentals.xml index 272fc9580..2760e4876 100644 --- a/Doc/Sd1/languageFundamentals.xml +++ b/Doc/Sd1/languageFundamentals.xml @@ -380,9 +380,9 @@ int c;</programlisting> </tr> <tr> - <td valign="top"><programlisting language="java">int a, b = 22, c; </programlisting></td> + <td valign="top"><programlisting language="java">int a, b = 22, c;</programlisting></td> - <td valign="top"><programlisting language="java">int a, + <td valign="top"><programlisting language="java">int a, b = 22, c;</programlisting></td> </tr> @@ -836,7 +836,7 @@ System.out.println(count + ":" + Count);</programlisting> <glossdef> <programlisting language="java">double f; -f = -4.55; </programlisting> +f = -4.55;</programlisting> </glossdef> </glossentry> @@ -844,7 +844,7 @@ f = -4.55; </programlisting> <glossterm>Wrong</glossterm> <glossdef> - <programlisting language="java">f = -4.55; + <programlisting language="java">f = -4.55; double f;</programlisting> </glossdef> </glossentry> @@ -876,7 +876,7 @@ i = "Hello"; // Even worse: Assigning a String to an int</programlisting> <tr> <td valign="top"><programlisting language="java">byte b120 = 120; // o.K., static check -byte b128 = 128; // Wrong: Exceeding 127 </programlisting></td> +byte b128 = 128; // Wrong: Exceeding 127</programlisting></td> <td valign="top"><para>Performing static range check</para></td> </tr> @@ -902,10 +902,10 @@ int i = (int) l; // Casting long to int double d = 44.2323; i = (int) d; // Casting double to int -<emphasis role="bold">System.out.println("i carrying double: " + i)</emphasis>; </programlisting></td> +<emphasis role="bold">System.out.println("i carrying double: " + i)</emphasis>;</programlisting></td> <td valign="top"><screen>i carrying long: 4345 -i carrying double: 44 </screen></td> +i carrying double: 44</screen></td> </tr> </informaltable> </figure> @@ -921,10 +921,10 @@ int i = (int) l; double d = 44300000000000.0; i = (int) d; -<emphasis role="bold">System.out.println("i carrying double:" + i)</emphasis>; </programlisting></td> +<emphasis role="bold">System.out.println("i carrying double:" + i)</emphasis>;</programlisting></td> <td valign="top"><screen>i carrying long:-1294967296 -i carrying double:2147483647 </screen></td> +i carrying double:2147483647</screen></td> </tr> </informaltable> </figure> @@ -940,10 +940,10 @@ void main(void) { double measure = 65234.5435; short velocity; velocity = measure; - printf("Velocity=%d\n", velocity); + printf("Velocity=%d\n", velocity); }</programlisting></td> - <td valign="top"><para><abbrev>Uups</abbrev>:</para><screen>Velocity=-302 </screen></td> + <td valign="top"><para><abbrev>Uups</abbrev>:</para><screen>Velocity=-302</screen></td> </tr> </informaltable> </figure> @@ -1550,7 +1550,7 @@ int i = (int) d; // Explicit cast double to int</programlisting> minimum and maximum possible value to standard output.</para> <programlisting language="java"> public static void main(String[] args) { - + int minumum = ... , //TODO: provide values by maximum = ...; // binary int literals @@ -1567,7 +1567,7 @@ int i = (int) d; // Explicit cast double to int</programlisting> linkend="sw1Table4ByteIntegerRepresentation"/>.</para> <programlisting language="java">public static void main(String[] args) { - + int minumum = 0B10000000_00000000_00000000_00000000, maximum = 0B01111111_11111111_11111111_11111111; @@ -1597,7 +1597,7 @@ int i = (int) d; // Explicit cast double to int</programlisting> <programlisting language="java"> System.out.println("int minimum:" + Integer.MIN_VALUE); System.out.println("int maximum:" + Integer.MAX_VALUE); - + System.out.println("int bytes:" + Integer.BYTES); System.out.println("int size:" + Integer.SIZE);</programlisting> </answer> @@ -1618,7 +1618,7 @@ print $test, "\n"; $cmp = 43.55; # A float -if ($test == $cmp) { # comparing string against float +if ($test == $cmp) { # comparing string against float print "Equal\n"; } else { print "Different\n"; @@ -1626,7 +1626,7 @@ if ($test == $cmp) { # comparing string against float <td valign="top"><screen>44 Jim -Different </screen></td> +Different</screen></td> </tr> </informaltable> </figure> @@ -1660,8 +1660,8 @@ pi = -4; // Compile time error: <glossterm>Even better</glossterm> <glossdef> - <para><programlisting language="java">final double PI = 3.141592653589793; // Coding style (Best practices): - // Using capital letters for + <para><programlisting language="java">final double PI = 3.141592653589793; // Coding style (Best practices): + // Using capital letters for ... // constant variable.</programlisting></para> </glossdef> </glossentry> @@ -1734,13 +1734,13 @@ LocalDate birtday = LocalDate.of(1990, Month.JULY, 5);</programlisting> <tr> <td><programlisting language="java">System.out.println("Decimal "+ <emphasis - role="bold">35</emphasis>); -System.out.println("Binary " + <emphasis role="bold">0b10_0011</emphasis>); -System.out.println("Hex " + <emphasis role="bold">0x23</emphasis>); -System.out.println("Octal " + <emphasis role="bold">043</emphasis>); </programlisting></td> + role="bold">35</emphasis>); +System.out.println("Binary " + <emphasis role="bold">0b10_0011</emphasis>); +System.out.println("Hex " + <emphasis role="bold">0x23</emphasis>); +System.out.println("Octal " + <emphasis role="bold">043</emphasis>);</programlisting></td> <td><screen>Decimal 35 -Binary 35 +Binary 35 Hex 35 Octal 35</screen></td> </tr> @@ -1760,9 +1760,9 @@ Octal 35</screen></td> int a = 20, b = 3, c = 9; - + System.out.println(a + " + " + b + " + " + c + " = " + (a + b + c)); - + }</programlisting> <para>This will run smoothly producing the expected output:</para> @@ -1778,7 +1778,7 @@ int a = 20, int a = 20, b = 03, <emphasis role="bold">c = 09; // Compiler error: The literal 09 of type int is out of range</emphasis> - + System.out.println(a + " + " + b + " + " + c + " = " + (a + b + c)); }</programlisting> @@ -1935,7 +1935,7 @@ Arrow value: 10173</screen> System.out.println(10000000000 ); // Compile time error: Integer number larger // than 2147483647 (2^31 - 1, Integer.<link xlink:href="https://docs.oracle.com/javase/9/docs/api/java/lang/Integer.html#MAX_VALUE">MAX_VALUE</link>) - </programlisting> +</programlisting> </figure> <figure xml:id="sd1_fig_literals"> @@ -2433,7 +2433,7 @@ System.out.println('&' + ": " + ((int) '&')); <programlisting language="java">public static void main(String[] args) { short intensity = ...; - + System.out.println(intensity); }</programlisting> @@ -3196,7 +3196,7 @@ System.out.println("Sum = " + sum);</programlisting> <td valign="top"><screen>Sum = -2</screen></td> <td><screen> 01111111_11111111_11111111_11111111 -+ 01111111_11111111_11111111_11111111 ++ 01111111_11111111_11111111_11111111 _____________________________________ <emphasis role="red">1_</emphasis>11111111_11111111_11111111_11111110</screen></td> </tr> @@ -4074,7 +4074,7 @@ short sum = a + 7; <co linkends="sd1_co_expressionTypeIntToShort-2" <para>On contrary the following line will compile flawlessly:</para> - <programlisting language="java">short sum = 4 + 7; </programlisting> + <programlisting language="java">short sum = 4 + 7;</programlisting> <para>Explain this strange behaviour.</para> </question> @@ -4149,9 +4149,9 @@ short sum = a + 7; <co linkends="sd1_co_expressionTypeIntToShort-2" <td valign="top"><programlisting language="java">int i = 2147480000; int j = 2147480000; int sum = i + j; -System.out.println("Sum = " + sum); </programlisting></td> +System.out.println("Sum = " + sum);</programlisting></td> - <td valign="top"><screen>Sum = -7296 </screen></td> + <td valign="top"><screen>Sum = -7296</screen></td> </tr> </informaltable> </figure> @@ -4261,9 +4261,9 @@ System.out.println(a + b);</programlisting> subsequent code example would occur:</para> <programlisting language="java">byte a = 120, b = 10; - + byte sum = (byte) (a + b); - + System.out.println(sum);</programlisting> <para>The explicit type conversion (a so called <quote>type @@ -4464,7 +4464,7 @@ System.out.println(<link System.out.println("sum = " + sum); } catch (<link xlink:href="https://docs.oracle.com/javase/9/docs/api/java/lang/ArithmeticException.html">ArithmeticException</link> ex) { - System.err.println("Problem: " + ex.getMessage()); + System.err.println("Problem: " + ex.getMessage()); }</programlisting> <screen>Problem: integer overflow</screen> @@ -4476,9 +4476,9 @@ System.out.println(<link <informaltable border="1"> <tr> <td valign="top"><programlisting language="java">double f = 34.3 / 0; -System.out.println("Value: " + f); </programlisting></td> +System.out.println("Value: " + f);</programlisting></td> - <td valign="top"><screen>Value: Infinity </screen></td> + <td valign="top"><screen>Value: Infinity</screen></td> </tr> </informaltable> </figure> @@ -4665,12 +4665,12 @@ System.out.println("Difference: " + difference);</programlisting><screen>Differe language="java">System.out.println(...)</code>:</para> <programlisting language="java">public static void main(String[] args) { - + double radius = 2.31; // A circle having a radius (given e.g. in mm). - double pi = 3.1415926; // Constant relating a circle's radius, + double pi = 3.1415926; // Constant relating a circle's radius, //perimeter and area. - - // TODO: Write the circle's area to standard output + + // TODO: Write the circle's area to standard output }</programlisting> <tip> @@ -4686,11 +4686,11 @@ System.out.println("Difference: " + difference);</programlisting><screen>Differe <glossdef> <programlisting language="java">public static void main(String[] args) { - + double radius = 2.31; // A circle having a radius (given e.g. in mm). double pi = 3.1415926; // Constant relating a circle's radius, //perimeter and area. - + System.out.println(pi * radius * radius); }</programlisting> </glossdef> @@ -4706,11 +4706,11 @@ System.out.println("Difference: " + difference);</programlisting><screen>Differe its value to a variable prior to output creation:</para> <programlisting language="java">public static void main(String[] args) { - + double radius = 2.31; // A circle having a radius (given e.g. in mm). - double pi = 3.1415926; // Constant relating a circle's radius, + double pi = 3.1415926; // Constant relating a circle's radius, //perimeter and area. - + double area = pi * radius * radius; System.out.println(area); }</programlisting> @@ -4733,11 +4733,11 @@ System.out.println("Difference: " + difference);</programlisting><screen>Differe calculated a given circle's area:</para> <programlisting language="java"> public static void main(String[] args) { - + double radius = 2.31; // A circle having a radius (given e.g. in mm). double pi = 3.1415926; // Constant relating a circle's radius, perimeter //and area. - + double area = pi * radius * radius; System.out.println(area); }</programlisting> @@ -4791,7 +4791,7 @@ double radius = 2.3; // Computing a circle's area System.out.println("A circle of radius " + radius + " will cover an area of " + PI * radius * radius); -PI = -4; +PI = -4; radius = 1.8; @@ -4861,9 +4861,9 @@ System.out.println("A circle of radius " + radius + " will cover an area of " + <programlisting language="java"> public static void main(String[] args) { double temperatureCelsius = 23.2; - + ... - + System.out.println("Celsius: " + temperatureCelsius); System.out.println("Kelvin: " + temperatureKelvin); System.out.println("Fahrenheit: " + temperatureFahrenheit); @@ -4874,11 +4874,11 @@ System.out.println("A circle of radius " + radius + " will cover an area of " + <programlisting language="java"> public static void main(String[] args) { double temperatureCelsius = 23.2; - - double + + double temperatureKelvin = temperatureCelsius + 273.15, temperatureFahrenheit = 9 * temperatureCelsius / 5 + 32; - + System.out.println("Celsius: " + temperatureCelsius); System.out.println("Kelvin: " + temperatureKelvin); System.out.println("Fahrenheit: " + temperatureFahrenheit); @@ -4907,9 +4907,9 @@ System.out.println("A circle of radius " + radius + " will cover an area of " + seconds = 31, minutes = 16, hours = 4; - + int timeInSeconds ... - + System.out.println("Time in seconds:" + timeInSeconds); }</programlisting> @@ -4926,9 +4926,9 @@ System.out.println("A circle of radius " + radius + " will cover an area of " + <programlisting language="java"> public static void main(String[] args) { final int timeInSeconds = 15391; - + ... - + System.out.println("Hours:" + hours); System.out.println("Minutes:" + minutes); System.out.println("Seconds:" + seconds); @@ -4960,9 +4960,9 @@ Seconds:31</screen> seconds = 31, minutes = 16, hours = 4; - + final int timeInSeconds = seconds + 60 * (minutes + 60 * hours); - + System.out.println("Time in seconds:" + timeInSeconds); }</programlisting></para> </listitem> @@ -4971,13 +4971,13 @@ Seconds:31</screen> <programlisting language="java"> public static void main(String[] args) { final int timeInSeconds = 15391; - + final int minutesRemaining = timeInSeconds / 60; final int seconds = timeInSeconds % 60; - + final int hours = minutesRemaining / 60; final int minutes = minutesRemaining % 60; - + System.out.println("Hours:" + hours); System.out.println("Minutes:" + minutes); System.out.println("Seconds:" + seconds); @@ -5003,12 +5003,12 @@ Seconds:31</screen> final double initialCapital = 223.12; final double interestRate = 1.5; - + System.out.println("Initial capital:" + initialCapital); System.out.println("Annual interest rate:" + interestRate); - + // TODO ... - + System.out.println("Capital after three years:" + ...); }</programlisting> @@ -5052,17 +5052,17 @@ Capital after three years:233.31175902999993</screen> final double initialCapital = 223.12; final double interestRate = 1.5; - + System.out.println("Initial capital:" + initialCapital); System.out.println("Annual interest rate:" + interestRate); - + final double factor = 1. + interestRate/100.; double capitalAtThreeYears = initialCapital; - + capitalAtThreeYears *= factor; // Year 1 capitalAtThreeYears *= factor; // Year 2 capitalAtThreeYears *= factor; // Year 3 - + System.out.println("Capital after three years:" + capitalAtThreeYears); }</programlisting> @@ -5073,14 +5073,14 @@ Capital after three years:233.31175902999993</screen> final double initialCapital = 223.12; final double interestRate = 1.5; - + System.out.println("Initial capital:" + initialCapital); System.out.println("Annual interest rate:" + interestRate); - + final double factor = 1. + interestRate/100.; - final double capitalAtThreeYears = + final double capitalAtThreeYears = initialCapital * factor * factor * factor; - + System.out.println("Capital after three years:" + capitalAtThreeYears); }</programlisting> @@ -5304,7 +5304,7 @@ System.out.println("e=" + e);</programlisting> int c = b; // c == 2; b = ++a; // Incrementing a by 1 -->a==5, then assigning to b --> b == 5 - int e = a++; // Assigning a to e --> e==5, then incrementing a --> a==6 + int e = a++; // Assigning a to e --> e==5, then incrementing a --> a==6 a *= b; // Multiplying a with b and assigning the result to a --> a==30 @@ -5421,7 +5421,7 @@ System.out.println("a = " + a + ", b = " + b + ", c = " + c);</programlisting> <glossdef> <programlisting language="java">int a; /* We define a variable. Then - subsequently a value is being assigned */ + subsequently a value is being assigned */ a = 33;</programlisting> </glossdef> </glossentry> @@ -5431,7 +5431,7 @@ a = 33;</programlisting> <glossdef> <programlisting language="java">int a; // We define a variable. -a = 33; // Then subsequently a value is being assigned </programlisting> +a = 33; // Then subsequently a value is being assigned</programlisting> </glossdef> </glossentry> </glosslist> @@ -5440,7 +5440,7 @@ a = 33; // Then subsequently a value is being assigned </programlisting> <figure xml:id="sd1_fig_inlineComment"> <title><quote>Inline</quote> comments</title> - <programlisting language="java">int strength = a /* fixed value */ + b /* age */ + c /* courage */; </programlisting> + <programlisting language="java">int strength = a /* fixed value */ + b /* age */ + c /* courage */;</programlisting> </figure> </section> </chapter> diff --git a/Doc/Sd1/statements.xml b/Doc/Sd1/statements.xml index b065156e1..0c81c6b42 100644 --- a/Doc/Sd1/statements.xml +++ b/Doc/Sd1/statements.xml @@ -132,11 +132,11 @@ { final double interestRate = 1.2; // 1.2% System.out.println("Interest:" + initialAmount * interestRate / 100); -} -{ +} +{ final double interestRate = 0.8; // 0.8% System.out.println("Interest:" + initialAmount * interestRate / 100); -} </programlisting> +}</programlisting> <informaltable border="1"> <tr> @@ -178,7 +178,7 @@ if (100000 <= initialAmount) { // Rich customer, 1,2% interest rate System.out.println( - "Interest:" + 1.2 * initialAmount / 100); + "Interest:" + 1.2 * initialAmount / 100); } System.out.println("Done!");</programlisting><screen>Interest:3840.0 Done!</screen></td> @@ -195,7 +195,7 @@ Done!</screen></td> <figure xml:id="sd1_fig_ifSyntax"> <title><code language="java">if</code> execution syntax</title> - <programlisting language="java">if (booleanExpression) + <programlisting language="java">if (booleanExpression) (block | statement)</programlisting> </figure> @@ -210,7 +210,7 @@ Done!</screen></td> if (100000 <= initialAmount) { // Rich customer, 1,2% interest rate System.out.println( - "Interest:" + 1.2 * initialAmount / 100); + "Interest:" + 1.2 * initialAmount / 100); } else { // Joe customer, 0.8% standard interest rate System.out.println( @@ -257,7 +257,7 @@ Done!</screen></td> <programlisting language="java">if (booleanExpression) (block | statement) -[else +[else (block | statement) ] <co linkends="sd1_fig_ifElseSyntax-1" xml:id="sd1_fig_ifElseSyntax-1-co"/></programlisting> @@ -457,11 +457,11 @@ int main(int argc, char **args) { <programlisting language="java">double initialAmount = 3200; -if (100000 <= initialAmount) +if (100000 <= initialAmount) System.out.println("Interest:" + 1.2 * initialAmount / 100); else if (1000 <= initialAmount) System.out.println("Interest:" + 0.8 * initialAmount / 100); -else +else System.out.println("Interest:" + 0);</programlisting> <para>Branches containing exactly one statement don't require a block @@ -557,7 +557,7 @@ fail: <tr> <td><programlisting language="c">... -if ((err = SSLHashSHA1.update(...)) != 0) +if ((err = SSLHashSHA1.update(...)) != 0) goto fail; goto fail;</programlisting></td> @@ -745,7 +745,7 @@ System.out.println("Failed!");</programlisting> <informaltable border="1"> <tr> - <td valign="top"><programlisting language="java">if ('A' == grade || 'B' == grade) { + <td valign="top"><programlisting language="java">if ('A' == grade || 'B' == grade) { result = "Excellent"; } else { if ('C' == grade) { @@ -773,7 +773,7 @@ System.out.println("Failed!");</programlisting> <informaltable border="1"> <tr> - <td valign="top"><programlisting language="java">if ('A' == grade || 'B' == grade) { + <td valign="top"><programlisting language="java">if ('A' == grade || 'B' == grade) { result = "Excellent"; } else if ('C' == grade) { result = "O.k."; @@ -801,7 +801,7 @@ System.out.println("Failed!");</programlisting> [else if (booleanExpression) (block | statement) ]* <co linkends="sd1_fig_ifElse_elseSyntax-1" xml:id="sd1_fig_ifElse_elseSyntax-1-co"/> -[else +[else (block | statement) ] <co linkends="sd1_fig_ifElse_elseSyntax-2" xml:id="sd1_fig_ifElse_elseSyntax-2-co"/></programlisting> </figure> @@ -873,15 +873,15 @@ You entered 1234567</screen> language="java">newResult</code>.</para> <programlisting language="java"> public static void main(String[] args) { - + int pointsReached = 1; int maximumPoints = 12; int pointsToAdd = 3; - + final int newResult; - + // TODO: Assignment to variable newResult - + System.out.println("New Result:" + newResult); }</programlisting> </question> @@ -893,19 +893,19 @@ You entered 1234567</screen> just assign the limit itself:</para> <programlisting language="java"> public static void main(String[] args) { - + int pointsReached = 1; int maximumPoints = 12; int pointsToAdd = 3; - + final int newResult; - + if (maximumPoints <= pointsReached + pointsToAdd) { newResult = maximumPoints; } else { newResult = pointsReached + pointsToAdd; } - + System.out.println("New Result:" + newResult); }</programlisting> @@ -915,13 +915,13 @@ You entered 1234567</screen> This may as well be be implemented by:</para> <programlisting language="java"> public static void main(String[] args) { - + int pointsReached = 1; int maximumPoints = 12; int pointsToAdd = 3; - + final int newResult = Math.min(maximumPoints, pointsReached + pointsToAdd); - + System.out.println("New Result:" + newResult); }</programlisting> @@ -1215,17 +1215,17 @@ Saturday</screen> <title><code language="java">switch</code> Syntax</title> <programlisting language="java">switch(expression) { -[case value_1 : +[case value_1 : [statement(s);] - [break; ] -case value_2 : + [break; ] +case value_2 : [statement(s); ] [break;] ... -case value_n : +case value_n : [statement(s); ] [break;] ] -[default: +[default: [statement(s);] [break;]] }</programlisting> @@ -1611,7 +1611,7 @@ Midweek</screen> <answer> <para><programlisting language="java">try (final Scanner scan = new Scanner(System.in)) { - + System.out.print("Enter a number:>"); final int number = scan.nextInt(); @@ -1626,7 +1626,7 @@ Midweek</screen> case 8: System.out.println("VIII"); break; case 9: System.out.println("IX"); break; case 10: System.out.println("X"); break; - + default:System.out.println("Decimal value " + number + " not yet implemented"); break; } @@ -1673,7 +1673,7 @@ import java.util.Scanner; public class LeapYear { public static void main(String[] args) { - + final Scanner scan = new Scanner(System.in); // Read user input System.out.print("Enter a year:>"); final int year = scan.nextInt(); @@ -1682,9 +1682,9 @@ public class LeapYear { if (0 == year % 400) { <emphasis role="bold"> // Every 400 years we do have a leap year.</emphasis> System.out.println( "Year " + year + " is a leap year"); - } else if (0 == year % 4 && <emphasis role="bold"> // Every 4 years we do have a leap year</emphasis> + } else if (0 == year % 4 && <emphasis role="bold"> // Every 4 years we do have a leap year</emphasis> 0 != year % 100) { <emphasis role="bold"> // unless year is a multiple of 100.</emphasis> - System.out.println("Year " + year + " is a leap year"); + System.out.println("Year " + year + " is a leap year"); } else { System.out.println("Year " + year + " is no leap year"); } @@ -1698,14 +1698,14 @@ public class LeapYear { branch into one resolves the issue:</para> <programlisting language="java"> public static void main(String[] args) { - + final Scanner scan = new Scanner(System.in); // Read user input System.out.print("Enter a year:>"); final int year = scan.nextInt(); scan.close(); if (0 == year % 400 || <emphasis role="bold">// Every 400 years we do have a leap year.</emphasis> - (0 == year % 4 && <emphasis role="bold">// Every 4 years we do have a leap year</emphasis> + (0 == year % 4 && <emphasis role="bold">// Every 4 years we do have a leap year</emphasis> 0 != year % 100)) { <emphasis role="bold">// unless year is a multiple of 100.</emphasis> System.out.println("Year " + year + " is a leap year"); } else { @@ -1795,7 +1795,7 @@ int loopCounter = 1; <co linkends="sd1_callout_whileLoop-2" while (loopCounter <= repetitions <co linkends="sd1_callout_whileLoop-3" xml:id="sd1_callout_whileLoop-3-co"/>) { System.out.println("Do not copy!"); <co linkends="sd1_callout_whileLoop-4" - xml:id="sd1_callout_whileLoop-4-co"/> + xml:id="sd1_callout_whileLoop-4-co"/> loopCounter++; <co linkends="sd1_callout_whileLoop-5" xml:id="sd1_callout_whileLoop-5-co"/> }</programlisting><screen>Do not copy! @@ -1867,7 +1867,7 @@ Do not copy!</screen> <programlisting language="java">int threeSeries = 1; while ((threeSeries *=3) < 100); - + System.out.println(threeSeries);</programlisting> <para>Exercise: Guess resulting output.</para> @@ -1885,7 +1885,7 @@ System.out.println(threeSeries);</programlisting> <td valign="top"><programlisting language="java">int sum = 0, value; do { System.out.print( - "Enter value, 0 to terminate: "); + "Enter value, 0 to terminate: "); value = scanner.nextInt(); sum += value; } while (0 != value); @@ -1990,8 +1990,8 @@ Goodbye!</screen>We thus use a <code language="java">do ... while(...)</code> xml:id="sd1_callout_whileLoopJustCounting-1-co"/> while (i < 5 <co linkends="sd1_callout_whileLoopJustCounting-2" - xml:id="sd1_callout_whileLoopJustCounting-2-co"/>) { - ... + xml:id="sd1_callout_whileLoopJustCounting-2-co"/>) { + ... i++; <co linkends="sd1_callout_whileLoopJustCounting-3" xml:id="sd1_callout_whileLoopJustCounting-3-co"/> }</programlisting></td> @@ -2028,15 +2028,15 @@ while (i < 5 <co linkends="sd1_callout_whileLoopJustCounting-2" <td><programlisting language="java">for (int i = 0 <coref linkend="sd1_callout_whileLoopJustCounting-1-co"/>; i < 5 <coref linkend="sd1_callout_whileLoopJustCounting-2-co"/>; i++ <coref - linkend="sd1_callout_whileLoopJustCounting-3-co"/>) { + linkend="sd1_callout_whileLoopJustCounting-3-co"/>) { ... }</programlisting></td> <td><programlisting language="java">int i = 0; <coref linkend="sd1_callout_whileLoopJustCounting-1-co"/> -while (i < 5 <coref linkend="sd1_callout_whileLoopJustCounting-2-co"/>) { - ... +while (i < 5 <coref linkend="sd1_callout_whileLoopJustCounting-2-co"/>) { + ... i++; <coref linkend="sd1_callout_whileLoopJustCounting-3-co"/> }</programlisting></td> </tr> @@ -2057,7 +2057,7 @@ while (i < 5 <coref linkend="sd1_callout_whileLoopJustCounting-2-co"/>) { <tr> <td><programlisting language="java">for (int i = 0 <co linkends="sd1_callout_forVariableScope-1" - xml:id="sd1_callout_forVariableScope-1-co"/>; i < 3; i++) { + xml:id="sd1_callout_forVariableScope-1-co"/>; i < 3; i++) { System.out.println(i); } @@ -2066,11 +2066,11 @@ System.out.println(i); <emphasis role="bold">// Error: i undefined </empha <td><programlisting language="java">int i; <co linkends="sd1_callout_forVariableScope-2" xml:id="sd1_callout_forVariableScope-2-co"/> -for (i = 0; i < 3; i++) { +for (i = 0; i < 3; i++) { System.out.println(i); } -System.out.println(i); // o.K. </programlisting></td> +System.out.println(i); // o.K.</programlisting></td> </tr> </informaltable> @@ -2095,7 +2095,7 @@ System.out.println(i); // o.K. </programlisting></td> <informaltable border="1"> <tr> - <td><programlisting language="java">for (int i = 0 ; i < 3; i++) { + <td><programlisting language="java">for (int i = 0 ; i < 3; i++) { System.out.println(i); } @@ -2103,8 +2103,8 @@ System.out.println(i); // o.K. </programlisting></td> <td><programlisting language="java">{ // Beginning block scope int i = 0; - for (; i < 3; i++) { - System.out.println(i); + for (; i < 3; i++) { + System.out.println(i); } } // Ending block scope @@ -2120,10 +2120,10 @@ System.out.println(i); // o.K. </programlisting></td> <informaltable border="1"> <tr> <td><programlisting language="java">while ( expression ) - (block | statement) </programlisting></td> + (block | statement)</programlisting></td> <td><programlisting language="java">for ( ;expression ;) - (block | statement) </programlisting></td> + (block | statement)</programlisting></td> </tr> </informaltable> @@ -2184,7 +2184,7 @@ while (i < limit) { language="java">for</code> loop having a step width of 2:</para> <programlisting language="java">final int limit = 14; - + for (int i = 0; i < limit; i += 2) { System.out.println(i); }</programlisting> @@ -2210,16 +2210,16 @@ while (i < limit) { <tr> <td><programlisting language="java">for (int i = 0; i < 6; i++) { for (int j = 0; j < i; j++) { - System.out.print(i + j + " "); + System.out.print(i + j + " "); } System.out.println(); // newline }</programlisting></td> - <td><screen>1 -2 3 -3 4 5 -4 5 6 7 -5 6 7 8 9 </screen></td> + <td><screen>1 +2 3 +3 4 5 +4 5 6 7 +5 6 7 8 9</screen></td> </tr> </informaltable> @@ -2280,7 +2280,7 @@ while (i < limit) { <td valign="top"><programlisting language="java">final int numberOfRows = 7; <co linkends="sd1_callout_printTriangle-1" xml:id="sd1_callout_printTriangle-1-co"/> - + for (int row = 0; row < numberOfRows; row++) { <co linkends="sd1_callout_printTriangle-2" xml:id="sd1_callout_printTriangle-2-co"/> @@ -2424,7 +2424,7 @@ for (int row = 0; row < numberOfRows; row++) { for (int x = 1; x < numberOfRows - row; x++) { System.out.print(' '); } - // continue line printing asterisks + // continue line printing asterisks for (int x = 0; x <= row; x++) { System.out.print('*'); } @@ -2460,29 +2460,29 @@ for (int row = 0; row < numberOfRows; row++) { </listitem> </orderedlist> - <programlisting language="java"> public static void main(String[] args) { - + <programlisting language="java"> public static void main(String[] args) { + // Example: 6 rows, tree's body loop index ranging from 0 to 5 // // X The tree's top. // 0 * - // 1 *** - // 2 ***** + // 1 *** + // 2 ***** // 3 ******* The tree's body. - // 4 ********* + // 4 ********* // 5 *********** // III The tree's two bottom trunk lines. - // III - + // III + final int numberOfRows = 6; // You may easily change this value. - + // Part one: The tree's top // - for (int x = 0; x < numberOfRows; x++) { // Printing the tree's top. We need + for (int x = 0; x < numberOfRows; x++) { // Printing the tree's top. We need System.out.print(' '); // numberOfRows preceeding spaces } // before printing the System.out.println("X"); // 'X' (top) character. - + // Part two: The tree's body // for (int row = 0; row < numberOfRows ; row++) { // Outer loop printing the @@ -2491,15 +2491,15 @@ for (int row = 0; row < numberOfRows; row++) { for (int x = 0; x < numberOfRows - row;x++) { // Starting each line with System.out.print(' '); // (numberOfRows - row) } // space characters ... - + for (int x = 0; x < 2 * row + 1; x ++) { // .. then printing (2*row+1) // body ('*') characters ... System.out.print('*'); // May try <xref linkend="glo_unicode"/> 'â–²' instead } - System.out.print("\n"); // ... and finally terminating the + System.out.print("\n"); // ... and finally terminating the } // current body row. - + // Part three: The tree's bottom trunk // for (int x = 0; x < numberOfRows-1; x++) { // Preparing the first line @@ -2507,7 +2507,7 @@ for (int row = 0; row < numberOfRows; row++) { System.out.print(' '); // of bottom trunk part ... } System.out.println("###"); // ... finished. - + for (int x = 0; x < numberOfRows-1; x++) { // Preparing the second System.out.print(' '); // line of bottom trunk } //part ... @@ -2553,10 +2553,10 @@ for (int row = 0; row < numberOfRows; row++) { <para>We start from a version being fully covered by our current knowledge:</para> - <programlisting language="java"> public static void main(String[] args) { - + <programlisting language="java"> public static void main(String[] args) { + // Example: 5 row groups, tree's body loop index ranging from 0 to 4 - + // \ / The tree's top. // -->*<-- // /_\ @@ -2572,7 +2572,7 @@ for (int row = 0; row < numberOfRows; row++) { // /_/_/_/_/_/_/_\ End of tree's body // [___] Bottom trunk line. - + final int numberOfRowGroups = 5; // You may easily change this // value. // Part one: The tree's top @@ -2582,13 +2582,13 @@ for (int row = 0; row < numberOfRows; row++) { System.out.print(' '); // preceding spaces } // before printing the System.out.println("\\ /"); // "\ /" String. - + for (int x = 0; x < numberOfRowGroups - 1; x++) { // Printing the tree's top '*' - // We need numberOfRows-1 + // We need numberOfRows-1 System.out.print(' '); // preceding spaces } // before printing the System.out.println("-->*<--"); // "-->*<--" string. - + for (int x = 0; x < numberOfRowGroups + 1; x++) { // The tree's lower top "/ \". System.out.print(' '); // We need again numberOfRows+1 } // preceding spaces. @@ -2602,28 +2602,28 @@ for (int row = 0; row < numberOfRows; row++) { // First body line of current group // for (int x = 0; // Starting first line - x < numberOfRowGroups - rowGroup;x++) { // of row group with + x < numberOfRowGroups - rowGroup;x++) { // of row group with // (numberOfRows - row) System.out.print(' '); // space characters ... } - System.out.print("/"); // Start of current row group's + System.out.print("/"); // Start of current row group's for (int x = 0; x < rowGroup + 2;x++) { // first line tree body content System.out.print("_\\"); // finishing. } System.out.println(); - + // Second body line of current group // for (int x = 0; // Starting second line of row x < numberOfRowGroups - rowGroup - 1; x++) {// group with (numberOfRows - - System.out.print(' '); // row - 1) space characters ... + System.out.print(' '); // row - 1) space characters ... } for (int x = 0; x < rowGroup + 3;x++) { // tree body content - System.out.print("/_"); + System.out.print("/_"); } System.out.println("\\"); // finishing. } - + // Part three: The tree's bottom trunk // for (int x = 0; x < numberOfRowGroups; x++) { // Indenting the bottom trunk ... @@ -2797,10 +2797,10 @@ for (int row = 0; row < numberOfRows; row++) { the body:</para> <programlisting language="java"> public static void main(String[] args) { - + System.out.println("n | n * n"); // Printing the table's head System.out.println("--+------"); - + for (int i = 0; i <= 9; i++) { // Printing the table's body System.out.println(i + " | " + i * i); } @@ -2877,15 +2877,15 @@ for (int row = 0; row < numberOfRows; row++) { xlink:href="https://docs.oracle.com/javase/9/docs/api/java/io/PrintStream.html#format-java.lang.String-java.lang.Object...-">format</link>(...)</methodname>:</para> <programlisting language="java"> public static void main(String[] args) { - + final int limit = 20; // The number of records to be printed - + System.out.println(" n | n * n"); // Printing the table's head System.out.println("---+------"); - + for (int i = 0; i <= limit; i++) { // Printing the table's body - - System.out.format("%3d|%6d\n", // Format string + + System.out.format("%3d|%6d\n", // Format string i , i * i); // Values being inserted in above format } // string. }</programlisting> @@ -2930,9 +2930,9 @@ for (int row = 0; row < numberOfRows; row++) { <answer> <programlisting language="java"> public static void main(String[] args) { - + final int limit = 20; // The number of records to be printed - + System.out.print( "" + "<html xmlns='http://www.w3.org/1999/xhtml'>\n" + " <head>\n" @@ -2941,18 +2941,18 @@ for (int row = 0; row < numberOfRows; row++) { + " <body>\n" + " <table>\n"); - + System.out.println(" <tr>"); System.out.println(" <th>n</th><th>n * n</th>"); System.out.println(" </tr>"); - + for (int i = 0; i <= limit; i++) { // Printing the table's body - + System.out.println(" <tr>"); - System.out.println(" <td style='text-align: right;'>" + i + + System.out.println(" <td style='text-align: right;'>" + i + "</td><td style='text-align: right;'>" + i * i + "</td>"); System.out.println(" </tr>"); - + } System.out.print( "" + " </table>\n" @@ -2975,18 +2975,18 @@ for (int row = 0; row < numberOfRows; row++) { table we supply a slightly different exercise producing a multiplication table:</para> - <screen> * | 1 2 3 4 5 6 7 8 9 10 + <screen> * | 1 2 3 4 5 6 7 8 9 10 ---+-------------------------------------------------- - 1| 1 2 3 4 5 6 7 8 9 10 - 2| 2 4 6 8 10 12 14 16 18 20 - 3| 3 6 9 12 15 18 21 24 27 30 - 4| 4 8 12 16 20 24 28 32 36 40 - 5| 5 10 15 20 25 30 35 40 45 50 - 6| 6 12 18 24 30 36 42 48 54 60 - 7| 7 14 21 28 35 42 49 56 63 70 - 8| 8 16 24 32 40 48 56 64 72 80 - 9| 9 18 27 36 45 54 63 72 81 90 - 10| 10 20 30 40 50 60 70 80 90 100 </screen> + 1| 1 2 3 4 5 6 7 8 9 10 + 2| 2 4 6 8 10 12 14 16 18 20 + 3| 3 6 9 12 15 18 21 24 27 30 + 4| 4 8 12 16 20 24 28 32 36 40 + 5| 5 10 15 20 25 30 35 40 45 50 + 6| 6 12 18 24 30 36 42 48 54 60 + 7| 7 14 21 28 35 42 49 56 63 70 + 8| 8 16 24 32 40 48 56 64 72 80 + 9| 9 18 27 36 45 54 63 72 81 90 + 10| 10 20 30 40 50 60 70 80 90 100</screen> <para>The number of rows and columns are equal. Provide an appropriate parameter <code language="java">final int limit = @@ -3047,18 +3047,18 @@ for (int row = 0; row < numberOfRows; row++) { <para>It does not make sense to supply both results like e.g. 3 * 4 and 4 * 3. Modify your application to generate:</para> - <screen> 1| 1 - 2| 2 4 - 3| 3 6 9 - 4| 4 8 12 16 - 5| 5 10 15 20 25 - 6| 6 12 18 24 30 36 - 7| 7 14 21 28 35 42 49 - 8| 8 16 24 32 40 48 56 64 - 9| 9 18 27 36 45 54 63 72 81 - 10| 10 20 30 40 50 60 70 80 90 100 + <screen> 1| 1 + 2| 2 4 + 3| 3 6 9 + 4| 4 8 12 16 + 5| 5 10 15 20 25 + 6| 6 12 18 24 30 36 + 7| 7 14 21 28 35 42 49 + 8| 8 16 24 32 40 48 56 64 + 9| 9 18 27 36 45 54 63 72 81 + 10| 10 20 30 40 50 60 70 80 90 100 ---+-------------------------------------------------- - * | 1 2 3 4 5 6 7 8 9 10 </screen> + * | 1 2 3 4 5 6 7 8 9 10</screen> </question> <answer> @@ -3071,7 +3071,7 @@ for (int row = 0; row < numberOfRows; row++) { for (int row = 1; row <= limit; row++) { // Printing rows. System.out.format("%3d| ", row); - + for (int col = 1; <emphasis role="bold">col <= row;</emphasis> col++) { // Printing column values until row index only. System.out.format("%3d ", row * col); } @@ -3105,28 +3105,28 @@ for (int row = 0; row < numberOfRows; row++) { elements require rearranging values in blocks in order to limit wasting space:</para> - <screen> n | n*n n | n*n n | n*n n | n*n n | n*n + <screen> n | n*n n | n*n n | n*n n | n*n n | n*n ----+--------------+--------------+--------------+--------------+---------- - 0 | 0 20 | 400 40 | 1600 60 | 3600 80 | 6400 - 1 | 1 21 | 441 41 | 1681 61 | 3721 81 | 6561 - 2 | 4 22 | 484 42 | 1764 62 | 3844 82 | 6724 - 3 | 9 23 | 529 43 | 1849 63 | 3969 83 | 6889 - 4 | 16 24 | 576 44 | 1936 64 | 4096 84 | 7056 - 5 | 25 25 | 625 45 | 2025 65 | 4225 85 | 7225 - 6 | 36 26 | 676 46 | 2116 66 | 4356 86 | 7396 - 7 | 49 27 | 729 47 | 2209 67 | 4489 87 | 7569 - 8 | 64 28 | 784 48 | 2304 68 | 4624 88 | 7744 - 9 | 81 29 | 841 49 | 2401 69 | 4761 89 | 7921 + 0 | 0 20 | 400 40 | 1600 60 | 3600 80 | 6400 + 1 | 1 21 | 441 41 | 1681 61 | 3721 81 | 6561 + 2 | 4 22 | 484 42 | 1764 62 | 3844 82 | 6724 + 3 | 9 23 | 529 43 | 1849 63 | 3969 83 | 6889 + 4 | 16 24 | 576 44 | 1936 64 | 4096 84 | 7056 + 5 | 25 25 | 625 45 | 2025 65 | 4225 85 | 7225 + 6 | 36 26 | 676 46 | 2116 66 | 4356 86 | 7396 + 7 | 49 27 | 729 47 | 2209 67 | 4489 87 | 7569 + 8 | 64 28 | 784 48 | 2304 68 | 4624 88 | 7744 + 9 | 81 29 | 841 49 | 2401 69 | 4761 89 | 7921 ----+--------------+--------------+--------------+--------------+---------- - 10 | 100 30 | 900 50 | 2500 70 | 4900 90 | 8100 - 11 | 121 31 | 961 51 | 2601 71 | 5041 91 | 8281 - 12 | 144 32 | 1024 52 | 2704 72 | 5184 92 | 8464 - 13 | 169 33 | 1089 53 | 2809 73 | 5329 93 | 8649 - 14 | 196 34 | 1156 54 | 2916 74 | 5476 94 | 8836 - 15 | 225 35 | 1225 55 | 3025 75 | 5625 95 | 9025 - 16 | 256 36 | 1296 56 | 3136 76 | 5776 96 | 9216 - 17 | 289 37 | 1369 57 | 3249 77 | 5929 97 | 9409 - 18 | 324 38 | 1444 58 | 3364 78 | 6084 98 | 9604 + 10 | 100 30 | 900 50 | 2500 70 | 4900 90 | 8100 + 11 | 121 31 | 961 51 | 2601 71 | 5041 91 | 8281 + 12 | 144 32 | 1024 52 | 2704 72 | 5184 92 | 8464 + 13 | 169 33 | 1089 53 | 2809 73 | 5329 93 | 8649 + 14 | 196 34 | 1156 54 | 2916 74 | 5476 94 | 8836 + 15 | 225 35 | 1225 55 | 3025 75 | 5625 95 | 9025 + 16 | 256 36 | 1296 56 | 3136 76 | 5776 96 | 9216 + 17 | 289 37 | 1369 57 | 3249 77 | 5929 97 | 9409 + 18 | 324 38 | 1444 58 | 3364 78 | 6084 98 | 9604 19 | 361 39 | 1521 59 | 3481 79 | 6241 99 | 9801</screen> <para>Building a table this way requires some @@ -3180,7 +3180,7 @@ for (int row = 0; row < numberOfRows; row++) { yBlock < entriesPerBlock; yBlock++) { // vertically ... for (int x = 0; x < numBlocksHorizontal; x++) { // and horizontally // within each line. - final int cellValue = y * entriesPerBlock + final int cellValue = y * entriesPerBlock + x * numRows + yBlock; // The individual value // to be squared. System.out.format("%3d | %4d ", // Pretty print output @@ -3288,16 +3288,16 @@ for (int row = 0; row < numberOfRows; row++) { System.out.println( // Block separating " <tr><td></td></tr>"); // extra row. - for (int yBlock = 0; + for (int yBlock = 0; yBlock < entriesPerBlock; yBlock++) { // Stepping through // values vertically ... System.out.println(" <tr>"); for (int x = 0; x < numBlocksHorizontal; x++) { // and horizontally // within each line. - + final int cellValue = 1 + yBlock // The individual + x * numRows + y * entriesPerBlock; // value to be squared. - + System.out.println( // Pretty print output " <td>" + cellValue + "</td><td>" // values. + cellValue * cellValue + "</td>"); @@ -3345,9 +3345,9 @@ for (int i = 1; i <= limit; i++) { sum += i; } -System.out.println("1 + ... + " + limit + " = " + sum); </programlisting></td> +System.out.println("1 + ... + " + limit + " = " + sum);</programlisting></td> - <td><screen>1 + ... + 5 = 15 </screen></td> + <td><screen>1 + ... + 5 = 15</screen></td> </tr> </informaltable> </figure> @@ -4292,24 +4292,24 @@ for (int i = 1; i < 50; i++) { final int totalNumberCount = 49, drawnNumberCount = 6; - + // No changes below this line - + // Numerator loop long numerator = 1; for (int i = totalNumberCount - drawnNumberCount + 1; i <= totalNumberCount; i++) { numerator *= i; } - + // Denominator loop calculating the "smaller" factorial long factorial = 1; for (int i = 2; i <= drawnNumberCount; i++) { factorial *= i; } - System.out.println("Your chance to win when drawing " + drawnNumberCount + + System.out.println("Your chance to win when drawing " + drawnNumberCount + " out of " + totalNumberCount + " is 1 : " + (numerator / factorial)); } }</programlisting> @@ -4398,7 +4398,7 @@ import java.util.Random; final Scanner scan = new Scanner(System.in); System.out.print("Input a number:"); final int value = scan.nextInt(); // Read user input - + // ToDo: complete the implementation }</programlisting> </question> @@ -4474,26 +4474,26 @@ try (final Scanner scan = new Scanner(System.in)) { <para>We propose the following solution:</para> <programlisting language="java"> public static void main(String[] args) { - + final int highestDivisor = 20; // May be adjusted to other limits. - + int candidate = highestDivisor; // start with highest divisor. boolean atLeastOneRemainder; - + do { candidate++; // next candidate value. atLeastOneRemainder = false; - + for (int i = 2; i <= highestDivisor; i++) { if (0 != candidate % i) { // Is there a non-zero remainder? atLeastOneRemainder = true; // Continue outer while. break; // Leave current for loop. } } - + } while (atLeastOneRemainder); // Increase candidate further? - + System.out.println(candidate); }</programlisting> diff --git a/Doc/Sd1/streams.xml b/Doc/Sd1/streams.xml index 43ae0cd1d..39073f698 100644 --- a/Doc/Sd1/streams.xml +++ b/Doc/Sd1/streams.xml @@ -151,7 +151,7 @@ final BufferedReader inputBufferedReader = new BufferedReader(fileReader);</prog for sample text files like e.g. a Java source file of similar:</para> - <screen>goik >wc BoundedIntegerStore.java + <screen>goik >wc BoundedIntegerStore.java 58 198 1341 BoundedIntegerStore.java </screen> @@ -171,7 +171,7 @@ final BufferedReader inputBufferedReader = new BufferedReader(fileReader);</prog 69 83 2087 bibliography.xml 6809 18252 248894 swd1.xml <emphasis role="bold">6878 18335 250981 total</emphasis> <co - xml:id="sd1PlWcExtraLine"/> + xml:id="sd1PlWcExtraLine"/> </screen> </listitem> @@ -275,8 +275,8 @@ final BufferedReader inputBufferedReader = new BufferedReader(fileReader);</prog <glossdef> <screen>goik >java -jar target/wc-1.0.jar Testdata/* - 9 14 137 Testdata/input.html - 4 5 41 Testdata/model.css + 9 14 137 Testdata/input.html + 4 5 41 Testdata/model.css 13 19 178 total</screen> </glossdef> </glossentry> @@ -295,35 +295,35 @@ final BufferedReader inputBufferedReader = new BufferedReader(fileReader);</prog Assert.assertEquals("Just white space", 0, TextFileStatistics.findNoOfWords(" \t")); } - + @Test public void testSingleWord() { final String s = "We're"; - Assert.assertEquals("text='" + s + "'", 1, + Assert.assertEquals("text='" + s + "'", 1, TextFileStatistics.findNoOfWords(s)); } - + @Test public void testTwoWords() { final String s = "We are"; Assert.assertEquals("text='" + s + "'", 2, TextFileStatistics.findNoOfWords(s)); } - + @Test public void testWordsWhiteHead() { final String s = "\t \tBegin_space"; - Assert.assertEquals("text='" + s + "'", 1, + Assert.assertEquals("text='" + s + "'", 1, TextFileStatistics.findNoOfWords(s)); } - + @Test public void testWordsWhiteTail() { final String s = "End_space \t "; Assert.assertEquals("text='" + s + "'", 1, TextFileStatistics.findNoOfWords(s)); } - + @Test public void testWhiteMulti() { final String s = " some\t\tinterspersed \t spaces \t\t "; @@ -339,32 +339,32 @@ final BufferedReader inputBufferedReader = new BufferedReader(fileReader);</prog <glossdef> <programlisting language="java"> @Test public void testTwoInputFiles() throws FileNotFoundException, IOException { - + final String model_css_filename = "Testdata/model.css", // 4 lines 5 words 41 character - input_html_filename = + input_html_filename = "Testdata/input.html"; // 9 lines 14 words 137 character //_________________________________________ // total 13 lines 19 words 178 character - + final TextFileStatistics model_css = new TextFileStatistics( new BufferedReader(new FileReader(model_css_filename)), model_css_filename), - + input_html = new TextFileStatistics(new BufferedReader( new FileReader(input_html_filename)), input_html_filename); - + // File Testdata/model.css Assert.assertEquals( 4, model_css.numLines); Assert.assertEquals( 5, model_css.numWords); Assert.assertEquals(41, model_css.numCharacters); - + // File Testdata/input.html Assert.assertEquals( 9, input_html.numLines); Assert.assertEquals( 14, input_html.numWords); Assert.assertEquals(137, input_html.numCharacters); - + // Grand total Assert.assertEquals( 13, TextFileStatistics.getTotalNumLines()); Assert.assertEquals( 19, TextFileStatistics.getTotalNumWords()); diff --git a/Doc/Sd1/workingWithNumbers.xml b/Doc/Sd1/workingWithNumbers.xml index 8a95db7be..2ab3b6db1 100644 --- a/Doc/Sd1/workingWithNumbers.xml +++ b/Doc/Sd1/workingWithNumbers.xml @@ -26,7 +26,7 @@ <colgroup width="13%"/> <tr> - <td valign="top"><programlisting language="java">final Stack<Integer> values = new Stack<>(); + <td valign="top"><programlisting language="java">final Stack<Integer> values = new Stack<>(); values.push(3); values.push(1); @@ -91,7 +91,7 @@ values.push(1); values.push(10); while (!values.empty()) { - System.out.println(values.pop(). + System.out.println(values.pop(). getClass().getTypeName()); }</programlisting></td> @@ -122,7 +122,7 @@ Integer iInteger = <co linkends="sd1_numbers_fig_boxingAndUnboxing-2" iPrimitive; int iPrimitiveFromInteger = <co linkends="sd1_numbers_fig_boxingAndUnboxing-3" - xml:id="sd1_numbers_fig_boxingAndUnboxing-3-co"/> + xml:id="sd1_numbers_fig_boxingAndUnboxing-3-co"/> iInteger;</programlisting></td> <td valign="top"><programlisting language="none">int iPrimitive <co @@ -134,7 +134,7 @@ Integer iInteger = <co linkends="sd1_numbers_fig_conventional-2" Integer.valueOf(iPrimitive); int iPrimitiveFromInteger = <co linkends="sd1_numbers_fig_conventional-3" - xml:id="sd1_numbers_fig_conventional-3-co"/> + xml:id="sd1_numbers_fig_conventional-3-co"/> iInteger.intValue();</programlisting></td> </tr> </informaltable> @@ -213,7 +213,7 @@ int iPrimitiveFromInteger = <co linkends="sd1_numbers_fig_conventional-3" <colgroup width="50%"/> <tr> - <td valign="top"><programlisting language="java">final Stack<Integer> values + <td valign="top"><programlisting language="java">final Stack<Integer> values = new Stack<>(); values.push(Integer.valueOf(3)); @@ -221,8 +221,8 @@ values.push(Integer.valueOf(1)); values.push(Integer.valueOf(10)); while (!values.empty()) { - System.out.println(values.pop(). - intValue()); + System.out.println(values.pop(). + intValue()); }</programlisting></td> <td valign="top"><programlisting language="java">final Stack<Integer> values = @@ -233,7 +233,7 @@ values.push(1); values.push(10); while (!values.empty()) { - System.out.println(values.pop()); + System.out.println(values.pop()); }</programlisting></td> </tr> </informaltable> @@ -256,10 +256,10 @@ while (!values.empty()) { <tr> <td valign="top"><programlisting language="java">String userInput = "dummyValue"; try (final Scanner scanner = - new Scanner(System.in)){ + new Scanner(System.in)){ System.out.print("Enter an integer:"); userInput = scanner.nextLine(); - final int value = Integer.parseInt(userInput); + final int value = Integer.parseInt(userInput); System.out.println("You entered " + value); } catch (final NumberFormatException e) { System.out.println("Sorry, but '" + @@ -267,7 +267,7 @@ try (final Scanner scanner = }</programlisting></td> <td valign="top"><screen>Enter an integer:-34 -You entered -34</screen><screen>Enter an integer:five +You entered -34</screen><screen>Enter an integer:five Sorry, but 'five' is not an integer.</screen></td> </tr> @@ -343,14 +343,14 @@ not an integer.</screen></td> <colgroup width="50%"/> <tr> - <td valign="top"><programlisting language="java">final int value = + <td valign="top"><programlisting language="java">final int value = Integer.parseInt("1101", 2); -System.out.println("Value: " + value); </programlisting><screen>Value: 13</screen></td> +System.out.println("Value: " + value);</programlisting><screen>Value: 13</screen></td> <td valign="top"><programlisting language="java">final int value = Integer.parseInt("201", 2); -System.out.println("Value: " + value)</programlisting><screen>Exception in thread "main" - java.lang.NumberFormatException: +System.out.println("Value: " + value)</programlisting><screen>Exception in thread "main" + java.lang.NumberFormatException: For input string: "201" ... at de.hdm_stuttgart.sd1...</screen></td> @@ -639,7 +639,7 @@ System.out.println(de.format(1234.5678));</programlisting> <figure xml:id="sd1_numbers_fig_customFormat"> <title>Create a custom formatter</title> - <programlisting language="java">final DecimalFormatSymbols unusualSymbols = + <programlisting language="java">final DecimalFormatSymbols unusualSymbols = new DecimalFormatSymbols(Locale.getDefault()); unusualSymbols.setDecimalSeparator('|'); unusualSymbols.setGroupingSeparator('^'); @@ -962,7 +962,7 @@ System.out.println(result);</programlisting> }</programlisting> <screen>Enter an integer seed:4237549835735 -false true true true false false false true false true </screen> +false true true true false false false true false true</screen> </figure> </section> </chapter> diff --git a/Doc/Sda1/dom.xml b/Doc/Sda1/dom.xml index bed6fb870..acb0ddbd6 100644 --- a/Doc/Sda1/dom.xml +++ b/Doc/Sda1/dom.xml @@ -197,11 +197,11 @@ 2.2</productname> <abbrev>IDL</abbrev></title> <programlisting language="C++">interface Node { - const unsigned short ELEMENT_NODE = 1; // NodeType + const unsigned short ELEMENT_NODE = 1; // NodeType const unsigned short ATTRIBUTE_NODE = 2; const unsigned short TEXT_NODE = 3; ... - readonly attribute DOMString nodeName; + readonly attribute DOMString nodeName; attribute DOMString nodeValue; readonly attribute unsigned short nodeType; @@ -473,11 +473,11 @@ titel.setAttribute("date", "23.02.2000"); <co final XMLOutputter printer = new XMLOutputter(Format.getPrettyFormat());<co linkends="sda1_dom_createXmlFromScratch-4" - xml:id="sda1_dom_createXmlFromScratch-4-co"/> + xml:id="sda1_dom_createXmlFromScratch-4-co"/> printer.output(titel, System.out); <co linkends="sda1_dom_createXmlFromScratch-5" - xml:id="sda1_dom_createXmlFromScratch-5-co"/> </programlisting> + xml:id="sda1_dom_createXmlFromScratch-5-co"/></programlisting> <screen language="xml">Result: <titel <coref linkend="sda1_dom_createXmlFromScratch-1-co"/> date="23.02.2000"<coref @@ -572,7 +572,7 @@ printer.output(titel, System.out); <co private String getParseExceptionInfo <co linkends="sda1_dom_saxErrorHandler-2" - xml:id="sda1_dom_saxErrorHandler-2-co"/>(SAXParseException ex) { + xml:id="sda1_dom_saxErrorHandler-2-co"/>(SAXParseException ex) { return "Error '" + ex.getMessage() + "' at line " + ex.getLineNumber() + ", column " + ex.getColumnNumber(); } @@ -582,7 +582,7 @@ printer.output(titel, System.out); <co @Override public void warning<co linkends="sda1_dom_saxErrorHandler-4" xml:id="sda1_dom_saxErrorHandler-4-co"/> (SAXParseException exception <co linkends="sda1_dom_saxErrorHandler-5" - xml:id="sda1_dom_saxErrorHandler-5-co"/>) throws SAXException { + xml:id="sda1_dom_saxErrorHandler-5-co"/>) throws SAXException { out.print("Warning:" + getParseExceptionInfo(exception)); } @Override public void error <co linkends="sda1_dom_saxErrorHandler-6" @@ -809,7 +809,7 @@ Element surname, nesting depth = 2 Element to, nesting depth = 1 Element name, nesting depth = 2 Element surname, nesting depth = 2 -Element date, nesting depth = 1, Attributes: year = '2005' month = '1' day = '6' +Element date, nesting depth = 1, Attributes: year = '2005' month = '1' day = '6' Element subject, nesting depth = 1 Element content, nesting depth = 1 Element para, nesting depth = 2 @@ -898,7 +898,7 @@ Document contains 15 elements and 3 attributes.</screen> * names in that order eliminating possible duplicates: <co linkends="sda1CalloutFunctionalJunit-1" xml:id="sda1CalloutFunctionalJunit-1-co"/> - * + * * "Bob", 2, Student.Sex.MALE, "bob@uk.edu" <co linkends="sda1CalloutFunctionalJunit-2" xml:id="sda1CalloutFunctionalJunit-2-co"/> @@ -906,15 +906,15 @@ Document contains 15 elements and 3 attributes.</screen> * "George", 4, Student.Sex.MALE, "george@math.edu" * "Jane", 1, Student.Sex.FEMALE, "jane@kiv.de" * "Kim", 2, Student.Sex.FEMALE, "wilde@serious.de" - * + * * ==> {"Bob", "Fred", "George"} <co linkends="sda1CalloutFunctionalJunit-3" xml:id="sda1CalloutFunctionalJunit-3-co"/> - * + * */ @Test public void allMaleDistinctNameOrderedByEmail() { - + List<String> emails = <co linkends="sda1CalloutFunctionalJunit-4" xml:id="sda1CalloutFunctionalJunit-4-co"/> roster. @@ -924,12 +924,12 @@ Document contains 15 elements and 3 attributes.</screen> map(Student::getName). distinct(). collect(Collectors.toList()); - + assertThat(emails, <co linkends="sda1CalloutFunctionalJunit-5" xml:id="sda1CalloutFunctionalJunit-5-co"/> - Matchers.<List<String>> equalTo( - ImmutableList.of("Bob", "Fred", "George") - ) + Matchers.<List<String>> equalTo( + ImmutableList.of("Bob", "Fred", "George") + ) ); }</programlisting> @@ -1102,9 +1102,9 @@ public class HtmlTree { * Create a HTML skeleton (&lt;html&gt;&lt;head&gt;...&lt;body&gt; ...&lt;/body&gt;&lt;/head&gt; * to be filled in later by calling {@link #appendItem(String, String)}. * - * @param titleText + * @param titleText * The document's title, e.g. "Available articles" - * + * * @param tableHeaderFields * The articles will be displayed as HTML table with these header fields * e.g. {"Article Description", "Order Number" } @@ -1115,16 +1115,16 @@ public class HtmlTree { xml:id="programlisting_catalog2html_htmlskel"/> final DocType doctype = new DocType("html", - "-//W3C//DTD XHTML 1.0 Strict//EN", + "-//W3C//DTD XHTML 1.0 Strict//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"); final Element htmlRoot = new Element("html"); - + final Document htmlOutput = new Document (htmlRoot, doctype); htmlOutput.addContent(0, new Comment(" Static content section")); - + // We create a HTML skeleton including a yet empty table - final Element + final Element head = new Element("head"), body = new Element("body"), table = new Element("table"); @@ -1132,26 +1132,26 @@ public class HtmlTree { htmlRoot.addContent(head).addContent(body); head.addContent(new Element("title").addContent(new Text(titleText))); - + body.addContent(new Element("h1").addContent(new Text(titleText))); body.addContent(table); tableBody = new Element("tbody"); table.addContent(tableBody); - + final Element tr = new Element("tr"); tableBody.addContent(tr); for (final String headerField: tableHeaderFields) { tr.addContent(new Element("th").addContent(new Text(headerField))); } - + tableBody.addContent(new Comment(" End of static, beginning of dynamic section")); } - + /** * Inserting an &lt;item&gt; as a new table row with two &lt;td&gt; elements. - * + * * @param itemName The item's name (e.g. Tennis racket) * @param orderNo The item's order number */ @@ -1245,19 +1245,19 @@ public class HtmlTree { import ... public class Article2Html { - + private final SAXBuilder builder = new SAXBuilder(); private final HtmlTree htmlResult; /** * Instances of this class allow for reading XML catalogs and delegate * XHTML transformation to a {@link HtmlTree} object, - * see {@link #process(String, PrintStream)}. + * see {@link #process(String, PrintStream)}. */ public Article2Html() { - + builder.setErrorHandler(new MySaxErrorHandler(System.out)); - + htmlResult = new HtmlTree("Available articles", new String[] { <co linkends="programlisting_catalog2html_glue_createhtmldom_co" xml:id="programlisting_catalog2html_glue_createhtmldom"/> @@ -1265,25 +1265,25 @@ public class Article2Html { } /** Read an Xml catalog instance and insert product names among with their order numbers - * into a HTML DOM. Then serialize the resulting HTML tree to a stream. - * - * @param + * into a HTML DOM. Then serialize the resulting HTML tree to a stream. + * + * @param * filename of the Xml source. * @param out - * The output stream for HTML serialization. + * The output stream for HTML serialization. * @throws IOException In case filename cannot be opened * @throws JDOMException Parsing error - * + * */ public void process(final String filename, final PrintStream out) throws JDOMException, IOException{ - final List<Element> items = + final List<Element> items = // builder.build(filename).getRootElement().getChildren(); builder.build(getClass().getClassLoader().getResource(filename)).getRootElement().getChildren(); - + for (final Element item : items) { <co linkends="programlisting_catalog2html_glue_prodloop_co" xml:id="programlisting_catalog2html_glue_prodloop"/> - htmlResult.appendItem(item.getText(), + htmlResult.appendItem(item.getText(), item.getAttributeValue("orderNo")); <co linkends="programlisting_catalog2html_glue_insertprod_co" xml:id="programlisting_catalog2html_glue_insertprod"/> @@ -1342,7 +1342,7 @@ public class Article2Html { </head> <body> <img src='a.gif' align='right'/> <!-- Error: pre- HTML5 style --> - + <p>Some inline image without alignment <img src="b.gif"/></p> <p>Some inline image with alignment <img src="c.gif" align="bottom"/><!-- Error: pre- HTML5 style --></p> </body> @@ -1359,8 +1359,8 @@ public class Article2Html { <title>A simple image example</title> </head> <body> - <img src="a.gif" style="float: right" /> - + <img src="a.gif" style="float: right" /> + <p>Some inline image without alignment <img src="b.gif" /></p> <p>Some inline image with alignment <img src="c.gif" style="vertical-align: bottom;" /></p> </body> @@ -1669,7 +1669,7 @@ public class Article2Html { xlink:href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/blob/master/P/Sda1/NoCast/src/main/java/de/hdm_stuttgart/mi/sda1/nocast/DomXpath.java">DomXpath</link> { private final SAXBuilder builder = new SAXBuilder(); - public List<Element> process(final String xhtmlFilename) + public List<Element> process(final String xhtmlFilename) throws JDOMException, IOException { final Document htmlInput = builder.build(xhtmlFilename); @@ -1784,7 +1784,7 @@ static final XPathExpression<Element> xpathSearchImg = <tbody> <tr> <td>An existing picture:</td> - <td><img + <td><img src="https://www.hdm-stuttgart.de/bilder_navigation/laptop.gif" alt="none"/></td> </tr> @@ -1895,7 +1895,7 @@ http://www.hdm-stuttgart.de/rotfl.gif, HTTP Status: false</screen> xlink:href="https://www.w3.org/TR/xpath">XPath</acronym> expression:</para> - <programlisting language="xpath">//html:img[starts-with(@src, 'http://') or + <programlisting language="xpath">//html:img[starts-with(@src, 'http://') or starts-with(@src, 'https://') or starts-with(@src, 'ftp://')]</programlisting> <para>Checking for reachability happens in:</para> @@ -1926,7 +1926,7 @@ break;</programlisting> <programlisting language="none">Map<String, Object> <link xlink:href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/blob/master/P/Sda1/VerifyInternalReferences/src/main/java/dom/xpath/CheckLocalReferences.java">xpathVarsNamespacePrefix</link> = new HashMap<>(); -xpathVarsNamespacePrefix.put("cssClass", null) ; +xpathVarsNamespacePrefix.put("cssClass", null) ; ... XPathExpression<Element> searchCssClass = XPathFactory.instance().compile( "//html:*[@class = <emphasis role="red">$cssClass</emphasis>]", @@ -2153,7 +2153,7 @@ final int targetCount = searchTargetId.evaluate(htmlInput).size();</programlisti style sheet for catalog transformation to HTML.</title> <programlisting language="xml"><?xml version="1.0" encoding="utf-8"?> -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns="http://www.w3.org/1999/xhtml"> <xsl:template match="/catalog"> @@ -2198,20 +2198,20 @@ public class Xml2Html { private final SAXBuilder builder = new SAXBuilder(); final XSLTransformer transformer; - + public Xml2Html(final String xslFilename) throws XSLTransformException { builder.setErrorHandler(new MySaxErrorHandler(System.err)); transformer = new XSLTransformer(xslFilename); } public void transform(final String xmlInFilename, final String resultFilename) throws JDOMException, IOException { - + final Document inDoc = builder.build(xmlInFilename); Document result = transformer.transform(inDoc); - + // Set formatting for the XML output final Format outFormat = Format.getPrettyFormat(); - + // Serialize to console final XMLOutputter printer = new XMLOutputter(outFormat); printer.output(result.getDocument(), System.out); @@ -2231,9 +2231,9 @@ public class Xml2Html { public class Xml2HtmlDriver { ... public static void main(String[] args) { - final String + final String inFilename = "Input/Dom/climbing.xml", - xslFilename = "Input/Dom/catalog2html.xsl", + xslFilename = "Input/Dom/catalog2html.xsl", htmlOutputFilename = "Input/Dom/climbing.html"; try { final Xml2Html converter = new Xml2Html(xslFilename); @@ -2264,9 +2264,9 @@ public class Xml2HtmlDriver { xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0"> - + <xsl:output method="xhtml"/> - + <xsl:template match="/"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> @@ -2283,7 +2283,7 @@ public class Xml2HtmlDriver { </body> </html> </xsl:template> - + <xsl:template match="*"> <xsl:message> <xsl:text>No rule defined for element '</xsl:text> @@ -2291,7 +2291,7 @@ public class Xml2HtmlDriver { <xsl:text>'.</xsl:text> </xsl:message> </xsl:template> - + </xsl:stylesheet></programlisting> <informaltable border="1"> diff --git a/Doc/Sda1/fo.xml b/Doc/Sda1/fo.xml index a67719bbf..1783a75d0 100644 --- a/Doc/Sda1/fo.xml +++ b/Doc/Sda1/fo.xml @@ -195,7 +195,7 @@ <fo:simple-page-master master-name="<emphasis role="bold">simplePageLayout</emphasis>" <co xml:id="programlisting_fobodyreg_simplepagelayout"/> page-width = "50mm" page-height = "80mm" - margin-top = "5mm" margin-bottom = "20mm" + margin-top = "5mm" margin-bottom = "20mm" margin-left = "5mm" margin-right = "10mm"> <fo:region-body <co xml:id="programlisting_fobodyreg_regionbody"/> @@ -330,41 +330,41 @@ <programlisting language="xml"><?xml version="1.0" encoding="utf-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-size="6pt"> - + <fo:layout-master-set> <fo:simple-page-master master-name="simplePageLayout" page-width = "50mm" page-height = "80mm" - margin-top = "5mm" margin-bottom = "20mm" + margin-top = "5mm" margin-bottom = "20mm" margin-left = "5mm" margin-right = "10mm"> - + <fo:region-body margin-top = "10mm" margin-bottom = "5mm" <co xml:id="programlisting_head_foot_bodydef"/> margin-left = "10mm" margin-right = "5mm"/> - + <fo:region-before extent="5mm"/> <co xml:id="programlisting_head_foot_beforedef"/> <fo:region-after extent="5mm"/> <co xml:id="programlisting_head_foot_afterdef"/> - + </fo:simple-page-master> </fo:layout-master-set> - + <fo:page-sequence master-reference="simplePageLayout"> <fo:static-content flow-name="xsl-region-before"> <co xml:id="programlisting_head_foot_beforeflow"/> - <fo:block - font-weight="bold" + <fo:block + font-weight="bold" font-size="8pt">Headertext</fo:block> </fo:static-content> - + <fo:static-content flow-name="xsl-region-after"> <co xml:id="programlisting_head_foot_afterflow"/> <fo:block> <fo:page-number/> </fo:block> </fo:static-content> - + <fo:flow flow-name="xsl-region-body"> <fo:block space-after="8mm">Dumb text .. dumb text.</fo:block> <fo:block space-after="8mm">Dumb text .. dumb text.</fo:block> @@ -537,7 +537,7 @@ <h1>Blocks/spans and CSS</h1> <p style="font-weight: bold; border: 1mm; border-style: solid; border-bottom-style: dashed;" - >A lot of attributes and + >A lot of attributes and <span style="color: white;background-color: black;" >inverted</span> text.</p> </body> @@ -581,7 +581,7 @@ <fo:block>Flowers</fo:block> </fo:list-item-body> </fo:list-item> - + <fo:list-item> <fo:list-item-label end-indent="label-end()"> <fo:block>&#8226;</fo:block> @@ -744,7 +744,7 @@ leader-pattern="dots"/>C<fo:leader leader-pattern="dots"/>D</fo:bloc <fo:flow flow-name="xsl-region-body"> <fo:block>Some text...</fo:block> - <fo:block>More text, more text, + <fo:block>More text, more text, more text.</fo:block> <fo:block>More text, more text, more text.</fo:block> @@ -771,7 +771,7 @@ leader-pattern="dots"/>C<fo:leader leader-pattern="dots"/>D</fo:bloc master-reference="simplePageLayout"> <fo:static-content flow-name="xsl-region-before"> <fo:block font-weight="bold"> - <fo:retrieve-marker retrieve-class-name="alpha" + <fo:retrieve-marker retrieve-class-name="alpha" retrieve-position="first-starting-within-page" />-<fo:retrieve-marker retrieve-position="last-starting-within-page" @@ -911,8 +911,8 @@ leader-pattern="dots"/>C<fo:leader leader-pattern="dots"/>D</fo:bloc <title>Two blocks with mutual page- and hypertext references.</title> <programlisting language="xml"><fo:flow flow-name='xsl-region-body'> - <fo:block id='xml'>Java section see <fo:basic-link color="blue" - internal-destination="java">page<fo:page-number-citation + <fo:block id='xml'>Java section see <fo:basic-link color="blue" + internal-destination="java">page<fo:page-number-citation ref-id='java'/>.</fo:basic-link></fo:block> <fo:block id='java'>XML section see @@ -1006,7 +1006,7 @@ leader-pattern="dots"/>C<fo:leader leader-pattern="dots"/>D</fo:bloc <programlisting language="xml"><?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" - xmlns:fo="http://www.w3.org/1999/XSL/Format" + xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/> @@ -1147,7 +1147,7 @@ leader-pattern="dots"/>C<fo:leader leader-pattern="dots"/>D</fo:bloc <answer> <programlisting language="xml"><?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" - xmlns:fo="http://www.w3.org/1999/XSL/Format" + xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/> @@ -1174,7 +1174,7 @@ leader-pattern="dots"/>C<fo:leader leader-pattern="dots"/>D</fo:bloc </fo:static-content> <fo:flow flow-name="xsl-region-body"> <xsl:apply-templates select="description/para"/> - + <fo:block>Price:<xsl:value-of select="@price"/></fo:block> <fo:block>Order no:<xsl:value-of select="@id"/></fo:block> </fo:flow> diff --git a/Doc/Sda1/jdbc.xml b/Doc/Sda1/jdbc.xml index 214e3ed8f..11bc265eb 100644 --- a/Doc/Sda1/jdbc.xml +++ b/Doc/Sda1/jdbc.xml @@ -412,7 +412,7 @@ abs_path = "/" path_segments <title><productname>... but Mysql</productname> made it into Linux</title> - <screen>Doc> grep -i mysql /etc/services + <screen>Doc> grep -i mysql /etc/services <emphasis role="red">mysql</emphasis> <emphasis role="red">3306</emphasis>/tcp <emphasis role="red">mysql</emphasis> <emphasis role="red">3306</emphasis>/udp mysql-proxy 6446/tcp @@ -740,7 +740,7 @@ mysql-proxy 6446/udp</screen> <title><xref linkend="glo_JDBC"/> connection pooling</title> <programlisting language="java">try (final Connection conn = - <link xlink:href="https://www.developer.com/java/data/understanding-jdbc-connection-pooling.html">C3P0DataSource</link>.getInstance().getConnection()) { + <link xlink:href="https://www.developer.com/java/data/understanding-jdbc-connection-pooling.html">C3P0DataSource</link>.getInstance().getConnection()) { final PreparedStatement pstmt = conn.create...; ... @@ -807,7 +807,7 @@ mysql-proxy 6446/udp</screen> <programlisting language="sql"><emphasis role="strong">CREATE</emphasis> <emphasis role="strong">TABLE</emphasis> Person ( - name CHAR(20) + name CHAR(20) ,email CHAR(20) <emphasis>UNIQUE</emphasis> )</programlisting> </figure> @@ -842,17 +842,17 @@ final Connection conn = DriverManager.<link xlink:href="https://docs.oracle.com/javase/9/docs/api/java/sql/DriverManager.html#getConnection-java.lang.String-">getConnection</link> ( "jdbc:mysql://localhost:3306/hdm", // Connection parameter URL "hdmuser", // Username - "XYZ"); // Password - + "XYZ"); // Password + // Step 2: Create a Statement instance final Statement stmt = conn.<link - xlink:href="https://docs.oracle.com/javase/9/docs/api/java/sql/Connection.html#createStatement--">createStatement()</link>; - + xlink:href="https://docs.oracle.com/javase/9/docs/api/java/sql/Connection.html#createStatement--">createStatement()</link>; + // Step 3: Execute the desired INSERT final int updateCount = stmt.<link xlink:href="https://docs.oracle.com/javase/9/docs/api/java/sql/Statement.html#executeUpdate-java.lang.String-">executeUpdate</link>( - "INSERT INTO Person VALUES('Jim', 'jim@foo.org')"); - + "INSERT INTO Person VALUES('Jim', 'jim@foo.org')"); + // Step 4: Give feedback to the end user System.out.println("Successfully inserted " + updateCount + " dataset(s)");</programlisting> </figure> @@ -964,7 +964,7 @@ goik@goiki Minimum> java -jar /.../Jdbc/Insert/Minimum/target/insert_user-0.1 <programlisting language="none">... = DriverManager.getConnection ( "<emphasis role="red">jdbc:mysql://localhost:3306/hdm</emphasis>", //JDBC URL "<emphasis role="red">hdmuser</emphasis>", // Username - "<emphasis role="red">XYZ</emphasis>") // Password </programlisting> + "<emphasis role="red">XYZ</emphasis>") // Password</programlisting> </glossdef> </glossentry> </glosslist> @@ -1023,7 +1023,7 @@ goik@goiki Minimum> java -jar /.../Jdbc/Insert/Minimum/target/insert_user-0.1 <glossdef> <programlisting language="none">// resources/<emphasis role="red">jdbc</emphasis>.properties -ResourceBundle jdbcProperties = ResourceBundle.getBundle("<emphasis role="red">jdbc</emphasis>"); </programlisting> +ResourceBundle jdbcProperties = ResourceBundle.getBundle("<emphasis role="red">jdbc</emphasis>");</programlisting> </glossdef> </glossentry> @@ -1102,7 +1102,7 @@ ResourceBundle jdbcProperties = ResourceBundle.getBundle("<emphasis role="red">j SimpleInsert.jdbcProperties.getString("jdbcurl"), SimpleInsert.jdbcProperties.getString("username"),...); <emphasis role="red">ScriptUtils.executeSqlScript(conn, new ClassPathResource("schema.sql"));</emphasis> - stmt = conn.createStatement();} + stmt = conn.createStatement();} @Test <co linkends="sda1_jdbc_fig_dbUnitTestImplement-2" xml:id="sda1_jdbc_fig_dbUnitTestImplement-2-co"/> @@ -1644,7 +1644,7 @@ public someClass { <screen>[... 5.5.24-0ubuntu0.12.04.1.%...X*e?I1ZQ...................e,F[yoA5$T[N.mysql_native_password. A...........!.......................<emphasis role="red">hdmuser</emphasis> <co - xml:id="tcpCaptureUsername"/>......U.>S.%..~h...!.xhdm............j..../* + xml:id="tcpCaptureUsername"/>......U.>S.%..~h...!.xhdm............j..../* ... <emphasis role="red">INSERT INTO Person VALUES('Jim', 'jim@foo.org')</emphasis> <co xml:id="tcpCaptureSqlInsert"/>6... @@ -1885,7 +1885,7 @@ Enter <emphasis role="red">Eve', 'eve@my.org');DROP TABLE Person;INSERT INTO Per <para>This <quote>successfully</quote> kills our <code>Person</code> table:</para> - <screen>goik@goikschlepptop MinimumTest> cat A1.log + <screen>goik@goikschlepptop MinimumTest> cat A1.log main INFO insert.SimpleInsert - Executing »INSERT INTO Person VALUES('Eve', 'eve@my.org');DROP TABLE Person;INSERT INTO Person VALUES('jim', 'jim@company.com')« main ERROR insert.SimpleInsert - General database connection problem: java.sql.SQLSyntaxErrorException: Table 'hdm.Person' doesn't exist @@ -2071,11 +2071,11 @@ java.sql.SQLSyntaxErrorException: Table 'hdm.Person' doesn't exist <programlisting language="java">... import java.util.regex.Matcher; import java.util.regex.Pattern; - + public static void main(String[] args) { final String [] wordList = new String [] {"Eric", "126653BBb", "_login","some text"}; final String [] regexpList = new String[] {"[A-K].*", "[^0-9]+.*", "_[a-z]+", ""}; - + for (final String word: wordList) { for (final String regexp: regexpList) { testMatch(word, regexp); @@ -2086,10 +2086,10 @@ public static void main(String[] args) { /** * Matching a given word by a regular expression. A log message is being * written to stdout. - * + * * Hint: The implementation is based on the explanation being given in the * introduction to {@link Pattern} - * + * * @param word This string will be matched by the subsequent argument. * @param regexp The regular expression tested to match the previous argument. * @return true if regexp matches word, false otherwise. @@ -2117,7 +2117,7 @@ import java.util.regex.Pattern; /** * This class is intended to gain some basic experience with * regular expressions and their usage in Java - * + * * @author goik * */ @@ -2138,10 +2138,10 @@ public class RegexpPrimer { /** * Matching a given word by a regular expression. A log message is being * written to stdout. - * + * * Hint: The implementation is based on the explanation being given in the * introduction to {@link Pattern} - * + * * @param word This string will be matched by the subsequent argument. * @param regexp The regular expression tested to match the previous argument. * @return true if regexp matches word, false otherwise. @@ -2279,7 +2279,7 @@ public class RegexpPrimer { ... // Sanitizing user names by regular expression - nameField.addValidator(new RegexpValidator("[^;\"'()]+", + nameField.addValidator(new RegexpValidator("[^;\"'()]+", "Sorry but this does not appear to be a user's name")); // Adding an input validator for sanitizing username and e-mail input values. @@ -2291,12 +2291,12 @@ public class RegexpPrimer { ... void conditionallyActivateInsertButton() { - final boolean isValid = + final boolean isValid = 0 < nameField.getValue().trim().length() && nameField.isValid() && - + // empty fields are not being validated! - 0 < emailField.getValue().trim().length() && + 0 < emailField.getValue().trim().length() && <emphasis role="bold">emailField.isValid();</emphasis> ...</programlisting> </answer> @@ -2361,7 +2361,7 @@ INSERT INTO Person VALUES ('Pete', 'p@rr.com') <figure xml:id="sda1_jdbc_fig_interpretSqlPerformanceMitigation"> <title>Addressing performance mitigation</title> - <programlisting language="sql">INSERT INTO Person VALUES + <programlisting language="sql">INSERT INTO Person VALUES ('Jim', 'jim@q.org'), ('Eve', 'eve@y.org'), ('Pete', 'p@rr.com') ... ;</programlisting> @@ -2448,17 +2448,17 @@ INSERT INTO Person VALUES ('Pete', 'p@rr.com') example</title> <programlisting language="java">final Connection conn = DriverManager.getConnection (... - + final PreparedStatement pStmt = conn.prepareStatement( "INSERT INTO Person VALUES(<emphasis role="bold">?, ?</emphasis>)");<co xml:id="listPrepCreate"/> - + pStmt.setString(1, "Jim");<co xml:id="listPrepSet1"/> pStmt.setString(2, "jim@foo.org");<co xml:id="listPrepSet2"/> - + final int updateCount = pStmt.executeUpdate();<co xml:id="listPrepExec"/> - -System.out.println("Successfully inserted " + updateCount + " dataset(s)"); </programlisting> + +System.out.println("Successfully inserted " + updateCount + " dataset(s)");</programlisting> </figure> <calloutlist> @@ -2504,12 +2504,12 @@ System.out.println("Successfully inserted " + updateCount + " dataset(s)"); <figure xml:id="sda1_jdbc_fig_preparedNoDynamicTableSupport"> <title>No dynamic table support</title> - <programlisting language="java">PreparedSatatement statement = + <programlisting language="java">PreparedSatatement statement = connection.prepareStatement("SELECT ? <co linkends="sda1_jdbc_fig_preparedNoDynamicTableSupport-1.2" xml:id="sda1_jdbc_fig_preparedNoDynamicTableSupport-1.2-co"/> from ?" <co linkends="sda1_jdbc_fig_preparedNoDynamicTableSupport-2.2" - xml:id="sda1_jdbc_fig_preparedNoDynamicTableSupport-2.2-co"/>); + xml:id="sda1_jdbc_fig_preparedNoDynamicTableSupport-2.2-co"/>); statement.setString(1, "birthday") <co linkends="sda1_jdbc_fig_preparedNoDynamicTableSupport-3.2" xml:id="sda1_jdbc_fig_preparedNoDynamicTableSupport-3.2-co"/>; @@ -2611,7 +2611,7 @@ ResultSet rs = statement.executeQuery() <co <para>client receives copies of database server data:</para> - <programlisting language="java">ResultSet result = statement.executeQuery("SELECT ... FROM Person ..."); </programlisting> + <programlisting language="java">ResultSet result = statement.executeQuery("SELECT ... FROM Person ...");</programlisting> </listitem> </itemizedlist> </figure> @@ -2662,13 +2662,13 @@ ResultSet rs = statement.executeQuery() <co <informaltable border="0"> <tr> <td valign="top"><programlisting language="sql">CREATE TABLE Friends ( - id INTEGER NOT NULL PRIMARY KEY + id INTEGER NOT NULL PRIMARY KEY ,nickname char(10) ,birthdate DATE );</programlisting></td> <td valign="top"><programlisting language="sql">INSERT INTO Friends VALUES - (1, 'Jim', '1991-10-10') + (1, 'Jim', '1991-10-10') ,(2, 'Eve', '2003-05-24') ,(3, 'Mick','2001-12-30') ;</programlisting></td> @@ -2684,7 +2684,7 @@ final Statement stmt = conn.createStatement(); <emphasis role="bold">// Step 3: Creating the client side JDBC container holding our data records</emphasis> <emphasis role="bold">final ResultSet data = stmt.executeQuery("SELECT * FROM Friends");</emphasis> <co linkends="listingJdbcRead-1" xml:id="listingJdbcRead-1-co"/> - + <emphasis role="bold">// Step 4: Dataset iteration while (data.next()) {</emphasis> <co linkends="listingJdbcRead-2" xml:id="listingJdbcRead-2-co"/> @@ -2885,13 +2885,13 @@ Date getDate​(int columnIndex) <tr> <td valign="top"><programlisting language="java">final int id = resultSet.getInt("id"); -final String nickName = - resultSet.getString("nickname"); +final String nickName = + resultSet.getString("nickname"); final Date birthDate = resultSet.getDate​("birthdate");</programlisting></td> <td valign="top"><programlisting language="sql">CREATE TABLE Friends ( - id INTEGER NOT NULL PRIMARY KEY + id INTEGER NOT NULL PRIMARY KEY ,nickname char(10) ,birthdate DATE );</programlisting></td> @@ -2906,13 +2906,13 @@ final Date birthDate = <tr> <td valign="top"><programlisting language="java">final int id = resultSet.getInt(1); -final String nickName = - resultSet.getString(2); +final String nickName = + resultSet.getString(2); final Date birthDate = resultSet.getDate(3);</programlisting></td> <td valign="top"><programlisting language="sql">CREATE TABLE Friends ( - id INTEGER NOT NULL PRIMARY KEY + id INTEGER NOT NULL PRIMARY KEY ,nickname char(10) ,birthdate DATE );</programlisting></td> @@ -3227,7 +3227,7 @@ INSERT INTO Description VALUES(2, 2, 'Pre-attached tent poles.');</programlistin <programlisting language="sql">CREATE TABLE Product( orderNo CHAR(10) NOT NULL PRIMARY KEY - ,price DECIMAL (9,2) NOT NULL + ,price DECIMAL (9,2) NOT NULL ); INSERT INTO Product VALUES('x-223', 330.20); @@ -3254,7 +3254,7 @@ INSERT INTO Product VALUES('w-124', 110.40); * @param userName The user's name * @param password The user's password */ - public void connect(final String jdbcUrl, + public void connect(final String jdbcUrl, final String userName, final String password) { ... } diff --git a/Doc/Sda1/jpaintro.xml b/Doc/Sda1/jpaintro.xml index 8ae99b885..11fcad5fb 100644 --- a/Doc/Sda1/jpaintro.xml +++ b/Doc/Sda1/jpaintro.xml @@ -361,7 +361,7 @@ <figure xml:id="sda1_jpaintro_fig_jreCreateStudyCourse"> <title>Transient instance</title> - <programlisting language="java">final StudyCourse csm = new StudyCourse("CSM", "Computer Science and Media"); + <programlisting language="java">final StudyCourse csm = new StudyCourse("CSM", "Computer Science and Media"); System.out.println(csm);</programlisting> <para>Result:</para> @@ -406,7 +406,7 @@ public class StudyCourse { xml:id="sda1_jpaintro_fig_studyCourseEntity-3-co"/>(length = 3 <co linkends="sda1_jpaintro_fig_studyCourseEntity-4" xml:id="sda1_jpaintro_fig_studyCourseEntity-4-co"/>) - private String shortName; + private String shortName; @Column(length = 150 <coref linkend="sda1_jpaintro_fig_studyCourseEntity-4-co"/>, @@ -430,7 +430,7 @@ CREATE TABLE StudyCourse( UNIQUE KEY <coref linkend="sda1_jpaintro_fig_studyCourseEntity-5-co"/>(fullName), fullName varchar(150) NOT NULL <coref - linkend="sda1_jpaintro_fig_studyCourseEntity-6-co"/> + linkend="sda1_jpaintro_fig_studyCourseEntity-6-co"/> )</programlisting></td> </tr> </informaltable> @@ -534,14 +534,14 @@ CREATE TABLE StudyCourse( <programlisting language="none"><persistence...> <persistence-unit name = "<emphasis role="red">strategy_drop-and-create</emphasis>"> <properties> - <property name = "javax.persistence.jdbc.driver" + <property name = "javax.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver"/> <property name = "javax.persistence.jdbc.url" value = "jdbc:mysql://localhost:3306/hdm"/> <property name = "javax.persistence.jdbc.user" value="hdmuser"/> <property name = "javax.persistence.jdbc.password" value="XYZ"/> - <property name = "javax.persistence.schema-generation.database.action" + <property name = "javax.persistence.schema-generation.database.action" value = "<emphasis role="red">drop-and-create</emphasis>"/> </properties> </persistence-unit> @@ -562,10 +562,10 @@ CREATE TABLE StudyCourse( <td valign="top"><programlisting language="none">final EntityManagerFactory factory = <co linkends="sda1_jpaintro_fig_inserByTransaction-1" xml:id="sda1_jpaintro_fig_inserByTransaction-1-co"/> - Persistence.createEntityManagerFactory( + Persistence.createEntityManagerFactory( "<emphasis role="red">strategy_drop-and-create</emphasis>") <co linkends="sda1_jpaintro_fig_inserByTransaction-2.2" - xml:id="sda1_jpaintro_fig_inserByTransaction-2.2-co"/>; + xml:id="sda1_jpaintro_fig_inserByTransaction-2.2-co"/>; final EntityManager entityManager = <co linkends="sda1_jpaintro_fig_inserByTransaction-2" @@ -579,7 +579,7 @@ final EntityTransaction tx = <co <emphasis role="red">tx.begin();</emphasis> <co linkends="sda1_jpaintro_fig_inserByTransaction-4" xml:id="sda1_jpaintro_fig_inserByTransaction-4-co"/> - final StudyCourse csm = new StudyCourse( + final StudyCourse csm = new StudyCourse( "CSM","Computer Science and Media"); <co linkends="sda1_jpaintro_fig_inserByTransaction-5" xml:id="sda1_jpaintro_fig_inserByTransaction-5-co"/> @@ -603,7 +603,7 @@ final EntityTransaction tx = <co insert into <coref linkend="sda1_jpaintro_fig_inserByTransaction-7-co"/> StudyCourse( - fullName, shortName) + fullName, shortName) values(?, ?)</programlisting></td> </tr> </informaltable> @@ -775,7 +775,7 @@ System.out.println("Read '" + studyCourse + "'"); <co final Query query = entityManager. createQuery("SELECT S FROM StudyCourse S" <co linkends="sda1_jpaintro_fig_readStudyCourseAll-1.2" - xml:id="sda1_jpaintro_fig_readStudyCourseAll-1.2-co"/>); + xml:id="sda1_jpaintro_fig_readStudyCourseAll-1.2-co"/>); final List<StudyCourse><co linkends="sda1_jpaintro_fig_readStudyCourseAll-1" @@ -820,7 +820,7 @@ studyCourses.stream().map(s -> "Read '" + s + "'"). <programlisting language="java" linenumbering="numbered" startinglinenumber="23">final Query query = entityManager.createQuery( - "SELECT S.shortName FROM StudyCourse AS S"); + "SELECT S.shortName FROM StudyCourse AS S"); final List<StudyCourse> studyCourses = query.getResultList(); try { <co linkends="sda1_jpaintro_fig_readTypeViolate-1" @@ -937,22 +937,22 @@ public class StudyCourse { <tr> <td valign="top"><programlisting language="java">final StudyCourse csm <co linkends="sda1_jpaintro_fig_updateStudyCourse-1" - xml:id="sda1_jpaintro_fig_updateStudyCourse-1-co"/>= entityManager. + xml:id="sda1_jpaintro_fig_updateStudyCourse-1-co"/>= entityManager. find(StudyCourse.class, "CSM"); final EntityTransaction tx = entityManager.getTransaction(); -tx.begin(); +tx.begin(); csm.setFullName( <co linkends="sda1_jpaintro_fig_updateStudyCourse-2" xml:id="sda1_jpaintro_fig_updateStudyCourse-2-co"/> - "Computerwissenschaft und Medien"); + "Computerwissenschaft und Medien"); tx.commit(); <co linkends="sda1_jpaintro_fig_updateStudyCourse-3" xml:id="sda1_jpaintro_fig_updateStudyCourse-3-co"/></programlisting></td> <td valign="top"><screen>MariaDB [hdm]> - select * from StudyCourse; -+---------+---------------------+ + select * from StudyCourse; ++---------+---------------------+ |shortName| fullName | +---------+---------------------+ | CSM | Computerwissenschaft| @@ -991,7 +991,7 @@ tx.commit(); <co linkends="sda1_jpaintro_fig_updateStudyCourse-3" <title>Populating the database</title> <programlisting language="java">tx.begin(); - entityManager.persist(new StudyCourse("CSM","Computer Science and Media")); + entityManager.persist(new StudyCourse("CSM","Computer Science and Media")); entityManager.persist(new StudyCourse("MMB","Mobile Media")); entityManager.persist(new StudyCourse("CRB","Cross Media Journalism")); entityManager.persist(new StudyCourse("IDB","Information Design")); @@ -1001,8 +1001,8 @@ tx.commit();</programlisting> <figure xml:id="sda1_jpaintro_fig_DomainModelDatabaseInterface"> <title><xref linkend="glo_JPQL"/>: Domain model and database</title> - <programlisting language="none">final <emphasis role="red">List<StudyCourse></emphasis> studyCourses -= + <programlisting language="none">final <emphasis role="red">List<StudyCourse></emphasis> studyCourses += entityManager.createQuery( "<emphasis role="red">SELECT S FROM StudyCourse AS S</emphasis>").getResultList();</programlisting> @@ -1026,7 +1026,7 @@ entityManager.createQuery( <glossdef> <programlisting language="none">entityManager.createQuery( - "<emphasis role="red">SELECT S FROM StudyCourse AS S WHERE S.shortName like 'C%'</emphasis>") </programlisting> + "<emphasis role="red">SELECT S FROM StudyCourse AS S WHERE S.shortName like 'C%'</emphasis>")</programlisting> </glossdef> </glossentry> @@ -1069,8 +1069,8 @@ criteria.where( builder.<emphasis role="red">like</emphasis>( <emphasis "SELECT S FROM StudyCourse AS S WHERE S.shortName like <emphasis role="red">'C%'</emphasis>");</programlisting> <screen>select studycours0_.shortName as shortNam1_0_, - studycours0_.fullName as fullName2_0_ -from StudyCourse studycours0_ + studycours0_.fullName as fullName2_0_ +from StudyCourse studycours0_ where studycours0_.shortName like <emphasis role="red">'C%'</emphasis></screen> <para>But wait: What about security?</para> @@ -1084,8 +1084,8 @@ where studycours0_.shortName like <emphasis role="red">'C%'</emphasis></screen> query.setParameter("pattern", "<emphasis role="red">C%</emphasis>");</programlisting> <programlisting language="sql">select studycours0_.shortName as shortNam1_0_, - studycours0_.fullName as fullName2_0_ -from StudyCourse studycours0_ + studycours0_.fullName as fullName2_0_ +from StudyCourse studycours0_ where studycours0_.shortName like <emphasis role="red">?</emphasis></programlisting> </figure> @@ -1176,7 +1176,7 @@ queryRecords.getResultList().stream(). queryRecords.getResultList().stream(). map(r -> { - final Object[] record = (Object[]) r; + final Object[] record = (Object[]) r; return ((String)record[0]).<emphasis role="red">toUpperCase()</emphasis> + " (" + (String)record[1] + ")" ; }). forEach(System.out::println) ;</programlisting> @@ -1210,7 +1210,7 @@ queryRecords.getResultList().stream(). <programlisting language="none">final CriteriaQuery<StudyCourse> criteria = builder. createQuery( StudyCourse.class ); -final Root<StudyCourse> studyCourseRoot = +final Root<StudyCourse> studyCourseRoot = criteria.from(<emphasis role="red">StudyCourse.class</emphasis>); criteria.select( studyCourseRoot ); criteria.where( builder.like( studyCourseRoot. @@ -1228,8 +1228,8 @@ studyCourses.stream().map(s -> "Read '" + s + "'"). <title>No injection susceptibility</title> <programlisting language="sql">select studycours0_.shortName as shortNam1_0_, - studycours0_.fullName as fullName2_0_ -from StudyCourse studycours0_ + studycours0_.fullName as fullName2_0_ +from StudyCourse studycours0_ where studycours0_.shortName like <emphasis role="red">?</emphasis></programlisting> </figure> </section> @@ -1271,7 +1271,7 @@ where studycours0_.shortName like <emphasis role="red">?</emphasis></programlist <tr> <td valign="top"><programlisting language="java">new JPAQuery(entityManager). from(qStudyCourse). - where(qStudyCourse.shortName.like("C%")). + where(qStudyCourse.shortName.like("C%")). list(qStudyCourse). stream(). map(s -> "Read '" + s + "'"). @@ -1280,8 +1280,8 @@ where studycours0_.shortName like <emphasis role="red">?</emphasis></programlist <td valign="top"><screen>Read 'Cross Media Journalism(CRB)' -Read 'Computer Science - and Media(CSM)' </screen></td> +Read 'Computer Science + and Media(CSM)'</screen></td> </tr> </informaltable> </figure> @@ -1290,9 +1290,9 @@ Read 'Computer Science <title>No injection susceptibility</title> <programlisting language="sql">select studycours0_.shortName as shortNam1_0_, - studycours0_.fullName as fullName2_0_ -from StudyCourse studycours0_ -where studycours0_.shortName like <emphasis role="red">?</emphasis> escape '!' </programlisting> + studycours0_.fullName as fullName2_0_ +from StudyCourse studycours0_ +where studycours0_.shortName like <emphasis role="red">?</emphasis> escape '!'</programlisting> </figure> </section> @@ -1354,7 +1354,7 @@ where studycours0_.shortName like <emphasis role="red">?</emphasis> escape '!' < <glossdef> <programlisting language="none">CREATE TABLE StudyCourse ( - id bigint(20) NOT NULL <emphasis role="red">AUTO_INCREMENT</emphasis>, + id bigint(20) NOT NULL <emphasis role="red">AUTO_INCREMENT</emphasis>, PRIMARY KEY (id),... )</programlisting> </glossdef> </glossentry> @@ -1365,7 +1365,7 @@ where studycours0_.shortName like <emphasis role="red">?</emphasis> escape '!' < <glossdef> <programlisting language="none">CREATE TABLE StudyCourse ( id bigint(20) NOT NULL - <emphasis role="red">GENERATED ALWAYS AS IDENTITY</emphasis>, + <emphasis role="red">GENERATED ALWAYS AS IDENTITY</emphasis>, PRIMARY KEY (id),... )</programlisting> </glossdef> </glossentry> @@ -1396,7 +1396,7 @@ VALUES('Mobile Media ', 'MMB');</programlisting> xml:id="sda1_jpaintro_fig_generatedIdentity-1-co"/> @GeneratedValue <co linkends="sda1_jpaintro_fig_generatedIdentity-2" xml:id="sda1_jpaintro_fig_generatedIdentity-2-co"/> - (strategy=<emphasis role="red">GenerationType.IDENTITY</emphasis>) + (strategy=<emphasis role="red">GenerationType.IDENTITY</emphasis>) <emphasis role="red">Long id</emphasis>; @Column(... unique = true <co linkends="sda1_jpaintro_fig_generatedIdentity-3" @@ -1417,7 +1417,7 @@ VALUES('Mobile Media ', 'MMB');</programlisting> <td valign="top"><screen>CREATE TABLE StudyCourse ( id bigint(20) NOT NULL AUTO_INCREMENT <coref linkend="sda1_jpaintro_fig_generatedIdentity-2-co"/>, - fullName varchar(150) NOT NULL, + fullName varchar(150) NOT NULL, shortName varchar(3) NOT NULL, PRIMARY KEY (id), <coref linkend="sda1_jpaintro_fig_generatedIdentity-1-co"/> UNIQUE KEY ... (fullName), <coref @@ -1460,7 +1460,7 @@ VALUES('Mobile Media ', 'MMB');</programlisting> <tr> <td valign="top"><programlisting language="none">final StudyCourse csm = new StudyCourse( - "CSM", "Computer Science and Media"); + "CSM", "Computer Science and Media"); log.info(csm); tx.begin(); @@ -1468,7 +1468,7 @@ tx.begin(); tx.commit(); log.info(csm);</programlisting></td> - <td valign="top"><screen>13:04:33,027 ...Computer Science ... + <td valign="top"><screen>13:04:33,027 ...Computer Science ... (CSM, <emphasis role="red">id=null</emphasis>) ... insert ...StudyCourse ... @@ -1493,8 +1493,8 @@ log.info(csm);</programlisting></td> <emphasis role="red">@ManyToOne</emphasis> StudyCourse studyCourse; - public Student(final String name) - {this.name = name;} + public Student(final String name) + {this.name = name;} }</programlisting></td> <td valign="top"><programlisting language="none">@Entity class StudyCourse { @@ -1502,7 +1502,7 @@ log.info(csm);</programlisting></td> <emphasis role="red">@OneToMany</emphasis>( <emphasis role="red">mappedBy = "studyCourse"</emphasis>) - final List<Student> students + final List<Student> students = new Vector<>(); ... @@ -1536,11 +1536,11 @@ log.info(csm);</programlisting></td> StudyCourse studyCourse; public void enroll( - final StudyCourse studyCourse) { + final StudyCourse studyCourse) { studyCourse.add(this); this.studyCourse = studyCourse; - } -... + } +... }</programlisting></td> <td valign="top"><programlisting language="none">@Entity @@ -1552,7 +1552,7 @@ public class StudyCourse { final List<Student> students = new Vector<>(); - void add(final Student student){ + void add(final Student student){ students.add(student); } ...}</programlisting></td> </tr> @@ -1827,8 +1827,8 @@ CREATE TABLE Airline ( <screen>... select airline0_.id as id1_0_, airline0_.icaoCode as icaoCode2_0_, - airline0_.name as name3_0_ -from Airline airline0_ + airline0_.name as name3_0_ +from Airline airline0_ where airline0_.icaoCode=? ... TRACE [main] sql.BasicBinder (BasicBinder.java:65) - binding parameter [1] as [VARCHAR] - [DLH] @@ -1839,7 +1839,7 @@ TRACE [main] sql.BasicBinder (BasicBinder.java:65) - binding parameter [1] as [V <screen> ... -select id, icaoCode, name +select id, icaoCode, name from Airline where airline0_.icaoCode=? ... diff --git a/Doc/Sda1/mongodb.xml b/Doc/Sda1/mongodb.xml index b3064833a..3c9aa93ce 100644 --- a/Doc/Sda1/mongodb.xml +++ b/Doc/Sda1/mongodb.xml @@ -122,7 +122,7 @@ WriteResult({ "nInserted" : 0, "<emphasis role="bold">writeError" : { "code" : 11000, - "errmsg" : "E11000 duplicate key error collection: test.university index: + "errmsg" : "E11000 duplicate key error collection: test.university index: lecture_id_1 dup key: { : 143108.0 }"</emphasis> } })</programlisting> diff --git a/Doc/Sda1/prerequisites.xml b/Doc/Sda1/prerequisites.xml index 35389007b..78da0eaf6 100644 --- a/Doc/Sda1/prerequisites.xml +++ b/Doc/Sda1/prerequisites.xml @@ -246,8 +246,8 @@ Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)</screen> <screen>root@goiki:~# aptitude install mysql-server The following NEW packages will be installed: - libdbd-mysql-perl{a} libdbi-perl{a} libnet-daemon-perl{a} libplrpc-perl{a} - mysql-client-5.5{a} mysql-server-5.5 + libdbd-mysql-perl{a} libdbi-perl{a} libnet-daemon-perl{a} libplrpc-perl{a} + mysql-client-5.5{a} mysql-server-5.5 0 packages upgraded, 6 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/17.8 MB of archives. After unpacking 63.2 MB will be used. Do you want to continue? [Y/n/?]</screen> @@ -257,25 +257,25 @@ Do you want to continue? [Y/n/?]</screen> xlink:href="https://www.mysql.com">Mysql</productname> servers <quote>root</quote> (Administrator) password:</para> - <screen>Package configuration - - - ┌───────────────────────────┤ Configuring mysql-server-5.5 ├────────────────────────────┠- │ While not mandatory, it is highly recommended that you set a password for the MySQL │ - │ administrative "root" user. │ - │ │ - │ If this field is left blank, the password will not be changed. │ - │ │ - │ New password for the MySQL "root" user: │ - │ │ - │ ********_____________________________________________________________________________ │ - │ │ - │ <Ok> │ - │ │ - └───────────────────────────────────────────────────────────────────────────────────────┘ - - - </screen> + <screen>Package configuration + + + ┌───────────────────────────┤ Configuring mysql-server-5.5 ├────────────────────────────┠+ │ While not mandatory, it is highly recommended that you set a password for the MySQL │ + │ administrative "root" user. │ + │ │ + │ If this field is left blank, the password will not be changed. │ + │ │ + │ New password for the MySQL "root" user: │ + │ │ + │ ********_____________________________________________________________________________ │ + │ │ + │ <Ok> │ + │ │ + └───────────────────────────────────────────────────────────────────────────────────────┘ + + +</screen> <para>This has to be entered twice. Keep a <emphasis role="bold">permanent</emphasis> record of this entry. Alternatively set @@ -288,7 +288,7 @@ Do you want to continue? [Y/n/?]</screen> exercises:</para> <screen>goik@hopc ~> mysql -u root -p -Enter password: +Enter password: ... messages omitted for brevity ... @@ -300,7 +300,7 @@ Query OK, 1 row affected (0.00 sec)</screen> we add <code>hdmuser</code> as a new user and grant full access to the newly created database <code>hdm to him</code>:</para> - <screen> ... + <screen> ... mysql> <emphasis role="bold">CREATE USER 'hdmuser'@'localhost' IDENTIFIED BY 'XYZ';</emphasis> mysql> <emphasis role="bold">use hdm;</emphasis> mysql> <emphasis role="bold">GRANT ALL PRIVILEGES ON *.* TO 'hdmuser'@'localhost' WITH GRANT OPTION;</emphasis> @@ -505,7 +505,7 @@ lrwxrwxrwx 1 ... 2011 <emphasis role="bold">mysql.jar -> mysql-connector-java id INT NOT NULL ,name CHAR(20) NOT NULL ,airlineCode CHAR(5) NOT NULL - + ,CONSTRAINT _PK_Airline_id PRIMARY KEY(id) ,CONSTRAINT _UN_Airline_name UNIQUE(name) ,CONSTRAINT _UN_Airline_airlineCode UNIQUE(airlineCode) @@ -515,7 +515,7 @@ CREATE TABLE Destination ( id INT NOT NULL ,fullName CHAR(20) NOT NULL ,airportCode CHAR(5) - + ,CONSTRAINT _PK_Destination_id PRIMARY KEY(id) ,CONSTRAINT _UN_Destination_airportCode UNIQUE(airportCode) ); @@ -532,7 +532,7 @@ CREATE TABLE Flight ( -- ,CONSTRAINT _FK_Flight_airline FOREIGN KEY(airline) REFERENCES Airline -- ,CONSTRAINT _FK_Flight_origin FOREIGN KEY(origin) REFERENCES Destination -- ,CONSTRAINT _FK_Flight_destination FOREIGN KEY(destination) REFERENCES Destination - + ,CONSTRAINT _PK_Flight_id UNIQUE(id) ,CONSTRAINT _UN_Flight_flightNumber UNIQUE(flightNumber) ,CONSTRAINT _CK_Flight_origin_destination CHECK(NOT(origin = destination)) diff --git a/Doc/Sda1/sax.xml b/Doc/Sda1/sax.xml index 97afc6f44..caad4f8ec 100644 --- a/Doc/Sda1/sax.xml +++ b/Doc/Sda1/sax.xml @@ -84,7 +84,7 @@ orderNo CHAR(10) PRIMARY KEY ,price Money ) - + INSERT INTO Product VALUES('<emphasis role="bold">3218</emphasis>', 42.57) INSERT INTO Product VALUES('<emphasis role="bold">9921</emphasis>', 121.50)</programlisting> @@ -300,8 +300,8 @@ INSERT INTO Product VALUES('<emphasis role="bold">9921</emphasis>', 121.50)</pro <title>Counting XML elements.</title> <programlisting language="java">package sax.stat.v1; -... - +... + public class ElementCount { public void parse(final String uri) { @@ -367,9 +367,9 @@ public class ElementCount { parser being callable during the parsing process:</para> <programlisting language="java">package sax.stat.v1; -... +... public class MyEventHandler extends <classname>org.xml.sax.helpers.DefaultHandler</classname> { - + public void <emphasis role="bold"><emphasis role="bold">startDocument()</emphasis></emphasis><co xml:id="programlisting_eventhandler_startDocument"/> { System.out.println("Opening Document"); @@ -460,7 +460,7 @@ public class MyEventHandler extends <classname>org.xml.sax.helpers.DefaultHandle completion of a parsing run:</para> <programlisting language="java">package sax.stat.v1; - + public class ElementCountDriver { public static void main(String argv[]) { ElementCount xmlStats = new ElementCount(); @@ -599,7 +599,7 @@ Closing Document xlink:href="http://www.saxproject.org">SAX</acronym> API:</para> <programlisting language="java">package sax.stat.v2; -... +... public class MyErrorHandler implements ErrorHandler { <emphasis role="bold">public void warning(SAXParseException e)</emphasis> { @@ -630,7 +630,7 @@ public class MyErrorHandler implements ErrorHandler { <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <catalog> <item orderNo="3218">Swinging headset</item> - <item orderNo="9921">200W Stereo Amplifier + <item orderNo="9921">200W Stereo Amplifier </catalog></programlisting> <caption> @@ -751,7 +751,7 @@ public class ElementCount { their values:</para> <programlisting language="java">package sax; - + public class AttribEventHandler extends DefaultHandler { public void startElement(String namespaceUri, String localName, @@ -781,10 +781,10 @@ public class AttribEventHandler extends DefaultHandler { within:</para> <screen>Opening Document -<emphasis role="bold">Opening "catalog"</emphasis> +<emphasis role="bold">Opening "catalog"</emphasis> Content " " -<emphasis role="bold">Opening "item"</emphasis> +<emphasis role="bold">Opening "item"</emphasis> Content "Swinging headset" Closing "item" Content " ...</screen> @@ -1029,10 +1029,10 @@ Subject: Firewall problems</screen> public class MemoViewHandler extends DefaultHandler { // These variables help us to keep track of the current event state spanning - // each startElement(...) -- character(...) -- endElement(...) event sequence + // each startElement(...) -- character(...) -- endElement(...) event sequence boolean inFromContext = false, inSubjectContext = false; - + public void startElement(String namespaceUri, String localName, String rawName, Attributes attrs) { switch(rawName) { @@ -1040,13 +1040,13 @@ public class MemoViewHandler extends DefaultHandler { inFromContext = true; System.out.print("Sender: "); break; - case "subject": + case "subject": inSubjectContext = true; System.out.print("Subject: "); break; case "surname": if (inFromContext) { - System.out.print(" "); // Adding additional space between <name> + System.out.print(" "); // Adding additional space between <name> } // and <surname> content. break; } @@ -1056,11 +1056,11 @@ public class MemoViewHandler extends DefaultHandler { public void endElement(String uri, String localName, String rawName) throws SAXException { switch(rawName) { - case "from": + case "from": inFromContext = false; System.out.println(); break; - case "subject": + case "subject": inSubjectContext = false; System.out.println(); break; @@ -1097,7 +1097,7 @@ public class MemoViewHandler extends DefaultHandler { </head> <body> <img src='a.gif' align='top'/> - + <p>Some inline image without alignment <img src="b.gif"/></p> <p>Some inline image with alignment <img src="c.gif" align="bottom"/></p> </body> @@ -1142,7 +1142,7 @@ Found image element 'c.gif' having attribute align='bottom' <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> -<html xmlns:html="http://www.w3.org/1999/xhtml" +<html xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> @@ -1150,25 +1150,25 @@ Found image element 'c.gif' having attribute align='bottom' <body> <h1>Some Title</h1> <!-- Block level image --> - + <div> <img src="dsfcjws.jpeg"/> <co linkends="sda1XhtmlImgBlockInline-1" xml:id="sda1XhtmlImgBlockInline-1-co"/> </div> - + <img src="someimage.png"/> <co linkends="sda1XhtmlImgBlockInline-2" xml:id="sda1XhtmlImgBlockInline-2-co"/> - + <!-- inline image within a paragraph --> <p>This is an <em><img src="fds.gif"/><co linkends="sda1XhtmlImgBlockInline-3" - xml:id="sda1XhtmlImgBlockInline-3-co"/></em> inline image:<img + xml:id="sda1XhtmlImgBlockInline-3-co"/></em> inline image:<img src="otherdata.png"/><co linkends="sda1XhtmlImgBlockInline-4" - xml:id="sda1XhtmlImgBlockInline-4-co"/>.</p> - + xml:id="sda1XhtmlImgBlockInline-4-co"/>.</p> + </body> </html></programlisting> @@ -1251,7 +1251,7 @@ Document contains 2 inline <img> elements.</screen> </xs:sequence> </xs:complexType> </xs:element> - + <xs:element name="item"> <xs:complexType mixed="true"> <xs:attribute name="orderNo" type="xs:int" use="required"/> @@ -1545,7 +1545,7 @@ localName='HTML'</screen> <xref linkend="glo_SAX"/> application:</para> <programlisting language="sql"><emphasis role="bold">INSERT INTO Product VALUES ('mpt', 'Monkey picked tea', NULL);</emphasis> -INSERT INTO Description VALUES('mpt', 0, +INSERT INTO Description VALUES('mpt', 0, 'Picked only by specially trained monkeys'); INSERT INTO Description VALUES('mpt', 1, 'Rare wild Chinese tea'); @@ -1685,7 +1685,7 @@ INSERT INTO Description VALUES('instantTent', 2, 'Exclusive WeatherTec system.') xml:id="xhtmlCombinedNs_Svg"/> xmlns:h="http://www.w3.org/1999/xhtml" <co xml:id="xhtmlCombinedNs_Xhtml"/> exclude-result-prefixes="xs" version="2.0"> - + <xsl:template match="/"> <h:html> <h:head> diff --git a/Doc/Sda1/schema.xml b/Doc/Sda1/schema.xml index b6c30e49d..3b2b7605e 100644 --- a/Doc/Sda1/schema.xml +++ b/Doc/Sda1/schema.xml @@ -367,7 +367,7 @@ WHERE ID=1</programlisting> <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > - + <xs:element name="employee"> <xs:complexType> <xs:sequence> @@ -382,7 +382,7 @@ WHERE ID=1</programlisting> </xs:sequence> </xs:complexType> </xs:element> - + </xs:schema></programlisting> </figure> @@ -416,7 +416,7 @@ WHERE ID=1</programlisting> <title>A list of employees</title> <programlisting language="xml"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > - + <xs:element name="employee"> <co linkends="schemaElementReference-1" xml:id="schemaElementReference-1-co"/> <xs:complexType> @@ -431,7 +431,7 @@ WHERE ID=1</programlisting> </xs:sequence> </xs:complexType> </xs:element> - + <xs:element name="employeeList"> <xs:complexType> <xs:sequence> @@ -446,7 +446,7 @@ WHERE ID=1</programlisting> </xs:sequence> </xs:complexType> </xs:element> - + </xs:schema></programlisting> </figure> @@ -475,7 +475,7 @@ WHERE ID=1</programlisting> <programlisting language="xml"><employeeList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="employee.xsd"> - + <employee> <id>21</id> <givenName>Bob</givenName> @@ -485,7 +485,7 @@ WHERE ID=1</programlisting> <email>hope@exploitation.com</email> <phone>1123-33244</phone> </employee> - + <employee> <id>22</id> <givenName>Gill</givenName> @@ -495,7 +495,7 @@ WHERE ID=1</programlisting> <email>gill@flashmaster.com</email> <phone>9771-43421</phone> </employee> - + </employeeList></programlisting> <qandaset defaultlabel="qanda" xml:id="sda1QandaMediaFormatGrammar"> @@ -680,7 +680,7 @@ WHERE ID=1</programlisting> linkend="fig_ListOfEmployees"/>:</para> <programlisting language="xml"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> - + <xs:element name="trackList"> <xs:complexType> <xs:sequence> @@ -690,7 +690,7 @@ WHERE ID=1</programlisting> </xs:sequence> </xs:complexType> </xs:element> - + <xs:element name="track"> <xs:complexType> <xs:sequence> @@ -703,7 +703,7 @@ WHERE ID=1</programlisting> </xs:sequence> </xs:complexType> </xs:element> - + </xs:schema></programlisting> <para>This allows for an arbitrary number of tracks:</para> @@ -729,7 +729,7 @@ WHERE ID=1</programlisting> <duration>PT5M32S</duration> <mediaformat>flac</mediaformat> </track> - + <!-- maybe more to come ... --> </trackList></programlisting> </figure> @@ -800,7 +800,7 @@ WHERE ID=1</programlisting> <programlisting language="xml"><employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="employee.xsd"> - <id>21</id> + <id>21</id> <givenName>Bob</givenName> ... </employee></programlisting> @@ -912,7 +912,7 @@ WHERE ID=1</programlisting> <xs:complexType> <xs:sequence> <emphasis role="bold"><!-- type referral to previously defined type --> - <xs:element name="id" type="NumericIdentity"/></emphasis> + <xs:element name="id" type="NumericIdentity"/></emphasis> <xs:element name="givenName" type="xs:string"/> <xs:element name="surname" type="xs:string"/> <xs:element name="birthday" type="xs:string"/> @@ -1066,7 +1066,7 @@ WHERE ID=1</programlisting> <givenName>Laura</givenName> <surname>Anderson</surname> <birthday>1956-41-02</birthday> - <sex>f</sex> + <sex>f</sex> <email>anderson@corporate.com</email> <co xml:id="prog_PowerAllEmail"/> <phone>223-324323</phone> <co xml:id="prog_PowerAllPhone"/> @@ -1185,7 +1185,7 @@ WHERE ID=1</programlisting> class="emptytag">xs:attribute</tag> definitions:</para> <programlisting language="xml"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > - + <xs:element name="employee"> <xs:complexType> <xs:attribute name="id" type="xs:unsignedInt"/> @@ -1197,7 +1197,7 @@ WHERE ID=1</programlisting> <xs:attribute name="phone" type="xs:string"/> </xs:complexType> </xs:element> - + </xs:schema></programlisting> <para>We may reference the above schema constructing a valid XML @@ -1263,7 +1263,7 @@ WHERE ID=1</programlisting> requirement for the representation of area codes:</para> <programlisting language="xml"><employee> - ... + ... <phone> <area>9771</area> <local>43421</local> @@ -1345,13 +1345,13 @@ WHERE ID=1</programlisting> <programlisting language="xml"><employeeList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="employee.xsd"> - + <employee> <id>21</id> <givenName>Bob</givenName> ... </employee> - + <employee> <id>21</id> <emphasis role="bold"><!-- Uups: id=21 again? --></emphasis> <givenName>Gill</givenName> diff --git a/Doc/Sda1/vaadin.xml b/Doc/Sda1/vaadin.xml index f2ec6d776..62ab01a27 100644 --- a/Doc/Sda1/vaadin.xml +++ b/Doc/Sda1/vaadin.xml @@ -265,7 +265,7 @@ <para>Notice the separation of problem related messages:</para> <programlisting language="java"> ... } catch (SQLException ex) { - Notification.show("Failed to insert record, see log for details", + Notification.show("Failed to insert record, see log for details", Notification.Type.ERROR_MESSAGE); <co linkends="sda1JdbcMsgEnduserProgrammer-1" xml:id="sda1JdbcMsgEnduserProgrammer-1-co"/> @@ -423,15 +423,15 @@ /** * Inserting a (name, email) record into the database server. Errors are being logged and forwarded * to {@link LoginUI#guiError(String)}. - * + * * <dl> * <dt><b>Precondition:</b></dt> * <dd>must be in <strong>connected</strong> state, see {@link #toggleConnectionState()}</dd> * </dl> - * + * * @param name A person's name * @param email A person's email address - * + * */ public boolean insert(final String name, final String email) {// TODO ... } @@ -517,10 +517,10 @@ public interface PersistView { public class ViewMockup implements PersistView { ... - + @Override public void setStatusConnected() { - ... + ... } @Override @@ -534,7 +534,7 @@ public class ViewMockup implements PersistView { messages:</para> <programlisting language="java">public class DataInsertTest { - + final ViewMockup viewMockup = new ViewMockup(); final PersistenceHandler ph = new PersistenceHandler(viewMockup); @@ -752,7 +752,7 @@ public class ViewMockup implements PersistView { name char(80) NOT NULL ,email CHAR(20) NOT NULL UNIQUE ,login CHAR(10) UNIQUE -- login names must be unique -- - ,password CHAR(20) + ,password CHAR(20) );</programlisting> <para>On clicking <quote>Connect</quote> a user may enter his @@ -985,11 +985,11 @@ public class ViewMockup implements PersistView { <programlisting language="java">package sda.jdbc.intro.auth; ... public class UserInputUnit { - + final JLabel label; <co xml:id="uiuLabel"/> final InputVerifierNotify verifier; <co xml:id="uiuVerifier"/> final JLabel errorMessage; <co xml:id="uiuErrmsg"/> - + public UserInputUnit(final String guiText, final InputVerifierNotify verifier) { this.label = new JLabel(guiText); this.verifier = verifier; @@ -1007,7 +1007,7 @@ public abstract class InputVerifierNotify extends InputVerifier { protected final String errorMessage; public final JLabel validationLabel; public final JTextField field; <co xml:id="verfierGuiField"/> - + public InputVerifierNotify(final JTextField field, final String errorMessage) { ...</programlisting> <para>We need two field verifier classes being derived from @@ -1066,12 +1066,12 @@ public class InsertPerson extends JFrame { new EqualValueVerifier <co linkends="listingInsertUserAuth-3" xml:id="listingInsertUserAuth-3-co"/> (new JPasswordField(10), passwordField, "Passwords do not match")); - + private final UserInputUnit [] userInputUnits = <co linkends="listingInsertUserAuth-4" xml:id="listingInsertUserAuth-4-co"/> {name, email, login, password, passwordRepeat}; -... +... private void userLoginDialog() {...} ... public InsertPerson (){ @@ -1085,7 +1085,7 @@ public class InsertPerson extends JFrame { databaseFieldPanel.add(unit.label); databaseFieldPanel.add(unit.verifier.field); databaseFieldPanel.add(unit.verifier.validationLabel); - } + } insertButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (inputValuesAllValid()) { @@ -1114,7 +1114,7 @@ public class InsertPerson extends JFrame { } } return true; - } + } }</programlisting> <calloutlist> diff --git a/Doc/Sda1/xmlintro.xml b/Doc/Sda1/xmlintro.xml index 5189b0131..5c9255ef7 100644 --- a/Doc/Sda1/xmlintro.xml +++ b/Doc/Sda1/xmlintro.xml @@ -113,7 +113,7 @@ ... /etc/ImageMagick-6/type.xml /etc/alternatives/desktop-background.xml -/etc/bonobo-activation/bonobo-activation-config.xml +/etc/bonobo-activation/bonobo-activation-config.xml /etc/cupshelpers/preferreddrivers.xml /etc/gconf/gconf.xml.defaults ...</screen></td> @@ -439,7 +439,7 @@ Parsing was successful</errortext></screen> <title>Parsing non-wellformed</title> <screen><errortext>goik>xmlparse omitfrom.xml -file:///ma/goik/workspace/Vorlesungen/Input/Memo/omitfrom.xml:7:3: +file:///ma/goik/workspace/Vorlesungen/Input/Memo/omitfrom.xml:7:3: fatal error org.xml.sax.SAXParseException: The element type "from" must be terminated by the matching end-tag "</from>". parsing error</errortext></screen> </figure> @@ -940,7 +940,7 @@ terminated by the matching end-tag "</to>". parsing error</computeroutput> <tr> <td valign="top"><programlisting language="none"><!-- Avoiding &amp; --> <h3><emphasis role="red"><![CDATA[</emphasis>HTML & XML<emphasis - role="red">]]></emphasis></h3> + role="red">]]></emphasis></h3> <!-- Display markup code »as is« --> @@ -1003,7 +1003,7 @@ terminated by the matching end-tag "</to>". parsing error</computeroutput> <programlisting language="none"><h3><emphasis role="red"><![CDATA[</emphasis>A CDATA section is being terminated by »]]>«.<emphasis role="red">]]></emphasis></h3></programlisting> - <screen>xmlparse /tmp/pre.xhtml + <screen>xmlparse /tmp/pre.xhtml file:///tmp/pre.xhtml:1:63: fatal error org.xml.sax.SAXParseException; systemId: file:///tmp/pre.xhtml; lineNumber: 2; columnNumber: 63; The character sequence "]]>" must not appear in content unless used to diff --git a/Doc/Sda1/xmlschema.xml b/Doc/Sda1/xmlschema.xml index a5c8a3020..8e52cae1c 100644 --- a/Doc/Sda1/xmlschema.xml +++ b/Doc/Sda1/xmlschema.xml @@ -347,19 +347,19 @@ double amount = Double.parseDouble(a);</programlisting></td> xml:id="sda1_xmlschema_fig_contactXsd01-3-co"/> <xs:element name="firstName"/> <co linkends="sda1_xmlschema_fig_contactXsd01-4" - xml:id="sda1_xmlschema_fig_contactXsd01-4-co"/> + xml:id="sda1_xmlschema_fig_contactXsd01-4-co"/> <xs:element name="lastName"/> <xs:element name="email"/> </xs:sequence> - </xs:complexType> + </xs:complexType> </xs:element></programlisting></td> - <td valign="top"><programlisting language="xml"><contact + <td valign="top"><programlisting language="xml"><contact xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="organizer.xsd" <co linkends="sda1_xmlschema_fig_contactXsd01-5" - xml:id="sda1_xmlschema_fig_contactXsd01-5-co"/>> + xml:id="sda1_xmlschema_fig_contactXsd01-5-co"/>> <firstName>Eve</firstName> <lastName>Dexter</lastName> <email>dexter@company.com</email> @@ -412,7 +412,7 @@ double amount = Double.parseDouble(a);</programlisting></td> <figure xml:id="sda1_xmlschema_fig_instanceToSchema"> <title>Linking instance to schema</title> - <programlisting language="xml"><contact + <programlisting language="xml"><contact xmlns:<emphasis role="red">xsi</emphasis>="<link xlink:href="https://www.w3.org/TR/xmlschema11-1/#xsi-namespace">http://www.w3.org/2001/XMLSchema-instance</link>" <co linkends="sda1_xmlschema_fig_instanceToSchema-1" @@ -455,10 +455,10 @@ double amount = Double.parseDouble(a);</programlisting></td> <programlisting language="none"><contact xmlns:<emphasis role="red">dummy</emphasis>="<code - xlink:href="https://www.w3.org/TR/xmlschema11-1/#xsi-namespace">http://www.w3.org/2001/XMLSchema-instance</code>" + xlink:href="https://www.w3.org/TR/xmlschema11-1/#xsi-namespace">http://www.w3.org/2001/XMLSchema-instance</code>" <emphasis role="red">dummy</emphasis><link xlink:href="https://www.w3.org/TR/xmlschema11-1/#xsi_schemaLocation">:noNamespaceSchemaLocation</link> = "<filename - xlink:href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/blob/master/Doc/Sda1/Ref/Organizer/V01_start/organizer.xsd">organizer.xsd</filename>"> + xlink:href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/blob/master/Doc/Sda1/Ref/Organizer/V01_start/organizer.xsd">organizer.xsd</filename>"> ... </contact></programlisting> </note> @@ -483,10 +483,10 @@ double amount = Double.parseDouble(a);</programlisting></td> <figure xml:id="sda1_xmlschema_fig_centralizedSchemaDef"> <title>Centralized schema definition</title> - <programlisting language="none"><contact + <programlisting language="none"><contact xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<link - xlink:href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/blob/master/Doc/Sda1/Ref/Organizer/V01_start/organizer.xsd">https://mi.hdm-stuttgart.de/organizer.xsd</link>"> + xlink:href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/blob/master/Doc/Sda1/Ref/Organizer/V01_start/organizer.xsd">https://mi.hdm-stuttgart.de/organizer.xsd</link>"> ... </contact></programlisting> </figure> @@ -544,7 +544,7 @@ Parsing was successfull <co linkends="sda1_xmlschema_fig_validateContact-3" <tr> <td valign="top"><programlisting language="xml"><contact xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="organizer.xsd"> + xsi:noNamespaceSchemaLocation="organizer.xsd"> <firstName>Eve</firstName> <lastName>Dexter</lastName> <!-- no <email> here --> @@ -632,7 +632,7 @@ String s1 = new String(), s2 = new String();</programlisting> <xs:sequence> <xs:element name="firstName"/> <xs:element name="lastName"/> - <xs:element name="email" <emphasis role="red">minOccurs="0"</emphasis>/> + <xs:element name="email" <emphasis role="red">minOccurs="0"</emphasis>/> </xs:sequence> </xs:complexType> </xs:element></programlisting></td> @@ -640,7 +640,7 @@ String s1 = new String(), s2 = new String();</programlisting> <td valign="top"><programlisting language="xml"><contact ...="organizer.xsd"> <firstName>Eve</firstName> <lastName>Dexter</lastName> - <!-- no <email> <emphasis role="red">required</emphasis> here --> + <!-- no <email> <emphasis role="red">required</emphasis> here --> </contact></programlisting></td> </tr> </informaltable> @@ -665,7 +665,7 @@ String s1 = new String(), s2 = new String();</programlisting> ref="<emphasis role="red">contact</emphasis>"/> <emphasis role="red">────â”</emphasis> <co linkends="sda1_xmlschema_fig_organizerMultipleContacts-1" - xml:id="sda1_xmlschema_fig_organizerMultipleContacts-1-co"/> + xml:id="sda1_xmlschema_fig_organizerMultipleContacts-1-co"/> </xs:sequence> <emphasis role="red">│</emphasis> </xs:complexType> <emphasis role="red">│</emphasis> </xs:element> <emphasis role="red">│</emphasis> @@ -676,7 +676,7 @@ String s1 = new String(), s2 = new String();</programlisting> <xs:complexType> <xs:sequence> ... - <xs:element name="email" minOccurs="0"/> + <xs:element name="email" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element></programlisting></td> @@ -689,7 +689,7 @@ String s1 = new String(), s2 = new String();</programlisting> <contact> <firstName>Joe</firstName> <lastName>Simpson</lastName> - <email>touching@the.void</email> + <email>touching@the.void</email> </contact> </organizer></programlisting></td> </tr> @@ -734,7 +734,7 @@ String s1 = new String(), s2 = new String();</programlisting> <xs:complexType> <xs:sequence> <xs:element ref="contact" - minOccurs="0" maxOccurs="unbounded"/> + minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> @@ -743,7 +743,7 @@ String s1 = new String(), s2 = new String();</programlisting> <xs:sequence> <xs:element name="firstName"/> <xs:element name="lastName"/> - <xs:element name="email" minOccurs="0"/> + <xs:element name="email" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element></programlisting></td> @@ -751,7 +751,7 @@ String s1 = new String(), s2 = new String();</programlisting> <td valign="top"><programlisting language="xml"><contact ...="organizer.xsd"> <firstName>Eve</firstName> <lastName>Dexter</lastName> - <email>dexter@company.com</email> + <email>dexter@company.com</email> </contact></programlisting><para><emphasis role="bold">Rule:</emphasis> Every schema element may be chosen as an instance's root.</para></td> @@ -852,7 +852,7 @@ String s1 = new String(), s2 = new String();</programlisting> <xs:element name="lastName"/> <xs:element name="birthDate" minOccurs="0" maxOccurs="1"/> - <xs:element name="email" minOccurs="0"/> + <xs:element name="email" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element></programlisting></td> @@ -862,7 +862,7 @@ String s1 = new String(), s2 = new String();</programlisting> <firstName>Eve</firstName> <lastName>Dexter</lastName> - <!-- valid though incomplete! --> + <!-- valid though incomplete! --> <birthDate>1995-</birthDate> </contact></programlisting></td> </tr> @@ -882,7 +882,7 @@ String s1 = new String(), s2 = new String();</programlisting> <xs:element name="lastName"/> <xs:element name="birthDate" <emphasis role="red">type="xs:date"</emphasis> - minOccurs="0" maxOccurs="1"/> + minOccurs="0" maxOccurs="1"/> <xs:element name="email" minOccurs="0"/> </xs:sequence> @@ -896,12 +896,12 @@ String s1 = new String(), s2 = new String();</programlisting> <!-- '1995-11-39' is no valid value for 'date'. --> <birthDate><emphasis role="red">1995-11-39</emphasis></birthDate> - </contact> + </contact> <contact> ... <!-- '21-th May 2004' is no valid value for 'date'. --> - <birthDate><emphasis role="red">21-th May 2004</emphasis></birthDate> + <birthDate><emphasis role="red">21-th May 2004</emphasis></birthDate> </contact></programlisting></td> </tr> </informaltable> @@ -946,7 +946,7 @@ String s1 = new String(), s2 = new String();</programlisting> minOccurs="0"/> </xs:sequence> <xs:attribute name="birthDate" - type="xs:date" <emphasis role="red">use="optional"</emphasis>/> + type="xs:date" <emphasis role="red">use="optional"</emphasis>/> </xs:complexType> </xs:element></programlisting></td> @@ -954,7 +954,7 @@ String s1 = new String(), s2 = new String();</programlisting> xlink:href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/blob/master/Doc/Sda1/Ref/Organizer/V06_birthdateAttributeType/birthdateAttribute.xml"><contact ...="organizer.xsd"</link> <emphasis role="red">birthDate="1995-11-29"</emphasis>> <firstName>Eve</firstName> - <lastName>Dexter</lastName> + <lastName>Dexter</lastName> </contact></programlisting></td> </tr> </informaltable> @@ -975,7 +975,7 @@ String s1 = new String(), s2 = new String();</programlisting> minOccurs="0"/> </xs:sequence> <emphasis role="red"><xs:attribute name="birthDate" - type="xs:date" use="optional"/></emphasis> + type="xs:date" use="optional"/></emphasis> </xs:complexType> </xs:element></programlisting></td> @@ -983,7 +983,7 @@ String s1 = new String(), s2 = new String();</programlisting> role="red">optional</emphasis>--> <link xlink:href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/blob/master/Doc/Sda1/Ref/Organizer/V06_birthdateAttributeType/birthdateAttribute.xml"><contact ...="organizer.xsd"</link>> <firstName>Eve</firstName> - <lastName>Dexter</lastName> + <lastName>Dexter</lastName> </contact></programlisting></td> </tr> </informaltable> @@ -1007,8 +1007,8 @@ String s1 = new String(), s2 = new String();</programlisting> <td valign="top"><programlisting language="none"><contact ...="organizer.xsd"> <firstName>Eve</firstName> <lastName>Dexter</lastName> - - <!-- Good idea, but no »real« email --> + + <!-- Good idea, but no »real« email --> <email>dexter at my dot com</email> </contact></programlisting></td> @@ -1038,7 +1038,7 @@ String s1 = new String(), s2 = new String();</programlisting> <programlisting language="xml"><xs:simpleType name="emailType" <co linkends="sda1_xmlschema_fig_organizerEmailUserType-1" - xml:id="sda1_xmlschema_fig_organizerEmailUserType-1-co"/>> + xml:id="sda1_xmlschema_fig_organizerEmailUserType-1-co"/>> <xs:restriction <co linkends="sda1_xmlschema_fig_organizerEmailUserType-2" xml:id="sda1_xmlschema_fig_organizerEmailUserType-2-co"/> base="xs:string" <co @@ -1048,7 +1048,7 @@ String s1 = new String(), s2 = new String();</programlisting> "[_\-a-zA-Z0-9\.\+]+@[a-zA-Z0-9](\.?[\-a-zA-Z0-9]*[a-zA-Z0-9])*"/> <co linkends="sda1_xmlschema_fig_organizerEmailUserType-4" - xml:id="sda1_xmlschema_fig_organizerEmailUserType-4-co"/> + xml:id="sda1_xmlschema_fig_organizerEmailUserType-4-co"/> </xs:restriction> </xs:simpleType></programlisting> @@ -1106,7 +1106,7 @@ String s1 = new String(), s2 = new String();</programlisting> minOccurs="0" <emphasis role="red">type="emailType"</emphasis> <emphasis role="red">──┘</emphasis> <co linkends="sda1_xmlschema_fig_organizerEmailUserTypeXsd-2" - xml:id="sda1_xmlschema_fig_organizerEmailUserTypeXsd-2-co"/>/> + xml:id="sda1_xmlschema_fig_organizerEmailUserTypeXsd-2-co"/>/> </xs:sequence> ... </xs:complexType> </xs:element></programlisting></td> @@ -1114,13 +1114,13 @@ String s1 = new String(), s2 = new String();</programlisting> <td valign="top"><programlisting language="none"><contact ...="organizer.xsd"> <firstName>Eve</firstName> <lastName>Dexter</lastName> - + <!-- <emphasis role="red">Value 'dexter at my dot com' is not facet-valid with respect to pattern '[_\-a-z...0-9])*' for type 'emailType'.</emphasis> --> - <email>dexter at my dot com</email> + <email>dexter at my dot com</email> </contact></programlisting></td> </tr> </informaltable> @@ -1147,21 +1147,21 @@ String s1 = new String(), s2 = new String();</programlisting> <xs:sequence> <xs:element name="firstName" <co linkends="sda1_xmlschema_fig_organizerUrType-1" - xml:id="sda1_xmlschema_fig_organizerUrType-1-co"/>/> - <xs:element name="lastName" /> + xml:id="sda1_xmlschema_fig_organizerUrType-1-co"/>/> + <xs:element name="lastName" /> <xs:element name="email" .../> - </xs:sequence> + </xs:sequence> <xs:attribute <link - xlink:href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/blob/master/Doc/Sda1/Ref/Organizer/V07_emailNoSpaces/mindTheUr_type.xml"><contact ...="organizer.xsd"></link> + xlink:href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/blob/master/Doc/Sda1/Ref/Organizer/V07_emailNoSpaces/mindTheUr_type.xml"><contact ...="organizer.xsd"></link> name="birthDate" .../> <firstName>Eve <emphasis role="red"><email></emphasis>eve@y.com<emphasis role="red"></email></emphasis> <co linkends="sda1_xmlschema_fig_organizerUrType-2" - xml:id="sda1_xmlschema_fig_organizerUrType-2-co"/></firstName> + xml:id="sda1_xmlschema_fig_organizerUrType-2-co"/></firstName> </xs:complexType> <lastName>Dexter <emphasis role="red"><pre></emphasis>Gordon<emphasis role="red"></pre></emphasis> <co linkends="sda1_xmlschema_fig_organizerUrType-3" xml:id="sda1_xmlschema_fig_organizerUrType-3-co"/> </lastName> -</xs:element> </contact> </programlisting> +</xs:element> </contact></programlisting> </figure> <calloutlist> @@ -1192,7 +1192,7 @@ String s1 = new String(), s2 = new String();</programlisting> <xs:complexType> <xs:sequence> <xs:element name="firstName" <emphasis role="red">type="xs:string"</emphasis>/> - <xs:element name="lastName" <emphasis role="red">type="xs:string"</emphasis>/> + <xs:element name="lastName" <emphasis role="red">type="xs:string"</emphasis>/> <xs:element name="email" minOccurs="0" type="emailType"/> </xs:sequence> <xs:attribute name="birthDate" type="xs:date" use="optional"/> @@ -1206,7 +1206,7 @@ String s1 = new String(), s2 = new String();</programlisting> <programlisting language="none"><contact xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="organizer.xsd" birthDate="1995-11-29"> - + <!-- Wrong: type string --> <firstName><emphasis role="red">Eve <email>eve@paradise.com</email></emphasis></firstName><co linkends="sda1_xmlschema_fig_organizerAddingTypesInvalid-1" @@ -1255,7 +1255,7 @@ String s1 = new String(), s2 = new String();</programlisting> <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:enumeration value="<emphasis role="red">businessPartner</emphasis>"/> </xs:restriction> </xs:simpleType></programlisting></td> @@ -1334,12 +1334,12 @@ String s1 = new String(), s2 = new String();</programlisting> <tr> <td valign="top"><programlisting language="sql">SELECT name, email from Customer -WHERE dept='finance' +WHERE dept='finance' or category = 12</programlisting></td> <td valign="top"><screen>{ ('John Yates', 'yates@company.com'), - ('Sandra Barnes', 'barnes@testcenter.org'), + ('Sandra Barnes', 'barnes@testcenter.org'), ... }</screen></td> </tr> @@ -1363,14 +1363,14 @@ WHERE dept='finance' <tr> <td valign="top"><programlisting language="sql">SELECT name, email from Customer -WHERE dept='finance' +WHERE dept='finance' or category = 12</programlisting></td> <td valign="top"><programlisting language="xml"><database> - ... - <customer dept='finance'>... + ... + <customer dept='finance'>... -</database></programlisting><programlisting language="xslt">/database//customer[@dept='finance' +</database></programlisting><programlisting language="xslt">/database//customer[@dept='finance' or category='7']</programlisting></td> </tr> </informaltable> @@ -1495,7 +1495,7 @@ WHERE dept='finance' <emphasis role="red"><a></emphasis>Three<emphasis role="red"></a></emphasis> <emphasis role="red"><a></emphasis>Four<emphasis role="red"></a></emphasis> </b> - <c>Mixed<a>content></a>Example</c> + <c>Mixed<a>content></a>Example</c> </top></programlisting></td> </tr> </informaltable> @@ -1530,13 +1530,13 @@ WHERE dept='finance' <td valign="top"><programlisting language="xml"><top> <emphasis role="red"><b id="first"></emphasis> - <a>One</a> + <a>One</a> <a>Two</a> <a>Three</a> <a>Four</a> <emphasis role="red"></b></emphasis> <emphasis role="red"><c></emphasis>Mixed<a>content></a>Example<emphasis - role="red"></c></emphasis> + role="red"></c></emphasis> </top></programlisting></td> </tr> </informaltable> @@ -1577,7 +1577,7 @@ WHERE dept='finance' <emphasis role="red"><a></emphasis>Four<emphasis role="red"></a></emphasis> </b> <c>Mixed <emphasis role="red"><a></emphasis>content<emphasis - role="red"></a> </emphasis>Example</c> + role="red"></a> </emphasis>Example</c> </top></programlisting></td> </tr> </informaltable> @@ -1618,7 +1618,7 @@ WHERE dept='finance' <emphasis role="red"><a></emphasis>Four<emphasis role="red"></a></emphasis> </b> <c>Mixed <emphasis role="red"><a></emphasis>content<emphasis - role="red"></a> </emphasis>Example</c> + role="red"></a> </emphasis>Example</c> </top></programlisting></td> </tr> </informaltable> @@ -1653,12 +1653,12 @@ WHERE dept='finance' <td valign="top"><programlisting language="xml"><top> <b> - <a>One</a> + <a>One</a> <emphasis role="red"><a></emphasis>Two<emphasis role="red"></a></emphasis> <a>Three</a> <a>Four</a> </b> - <c>Mixed<a>content></a>Example</c> + <c>Mixed<a>content></a>Example</c> </top></programlisting></td> </tr> </informaltable> @@ -1694,12 +1694,12 @@ WHERE dept='finance' <td valign="top"><programlisting language="xml"><top> <b> <emphasis role="red"><a></emphasis>One<emphasis role="red"></a></emphasis> - <a>Two</a> + <a>Two</a> <a>Three</a> <a>Four</a> </b> <c>Mixed<emphasis role="red"><a></emphasis>content><emphasis - role="red"></a></emphasis>Example</c> + role="red"></a></emphasis>Example</c> </top></programlisting></td> </tr> </informaltable> @@ -1764,13 +1764,13 @@ WHERE dept='finance' <td valign="top"><programlisting language="xml"><top> <b> - <a>One</a> + <a>One</a> <a>Two</a> <emphasis role="red"><a></emphasis>Three<emphasis role="red"></a></emphasis> <emphasis role="red"><x></emphasis>Four<emphasis role="red"></x></emphasis> <emphasis role="red"><a></emphasis>Five<emphasis role="red"></a></emphasis> </b> - <c>Mixed<a>content></a>Example</c> + <c>Mixed<a>content></a>Example</c> </top></programlisting></td> </tr> </informaltable> @@ -1828,13 +1828,13 @@ WHERE dept='finance' <td valign="top"><programlisting language="xml"><top> <b> - <a>One</a> + <a>One</a> <a>Two</a> <emphasis role="red"><a></emphasis>Three<emphasis role="red"></a></emphasis> <x>Four</x> <emphasis role="red"><a></emphasis>Five<emphasis role="red"></a></emphasis> </b> - <c>Mixed<a>content></a>Example</c> + <c>Mixed<a>content></a>Example</c> </top></programlisting></td> </tr> </informaltable> @@ -1870,13 +1870,13 @@ WHERE dept='finance' <td valign="top"><programlisting language="xml"><top> <b id="first"> - <emphasis role="red"><a></emphasis>A house<emphasis role="red"></a></emphasis> + <emphasis role="red"><a></emphasis>A house<emphasis role="red"></a></emphasis> <emphasis role="red"><a></emphasis>Rent a car<emphasis role="red"></a></emphasis> <emphasis role="red"><a></emphasis>Two houses<emphasis role="red"></a></emphasis> <emphasis role="red"><a></emphasis>Five<emphasis role="red"></a></emphasis> </b> <emphasis role="red"><c></emphasis>Building a house<emphasis - role="red"></c></emphasis> + role="red"></c></emphasis> </top></programlisting></td> </tr> </informaltable> @@ -1913,13 +1913,13 @@ WHERE dept='finance' <td valign="top"><programlisting language="xml"><top> <b id="first"> - <emphasis role="red"><a></emphasis>A house<emphasis role="red"></a></emphasis> + <emphasis role="red"><a></emphasis>A house<emphasis role="red"></a></emphasis> <a>Rent a car</a> <emphasis role="red"><a></emphasis>Two houses<emphasis role="red"></a></emphasis> <a>Five</a> </b> <emphasis role="red"><c></emphasis>Building a house<emphasis - role="red"></c></emphasis> + role="red"></c></emphasis> </top></programlisting></td> </tr> </informaltable> @@ -1955,13 +1955,13 @@ WHERE dept='finance' <td valign="top"><programlisting language="xml"><top> <b id="first"> - <a>A house</a> + <a>A house</a> <a>Rent a car</a> <emphasis role="red"><a></emphasis>Two houses<emphasis role="red"></a></emphasis> <a>Five</a> </b> <emphasis role="red"><c></emphasis>Building a house<emphasis - role="red"></c></emphasis> + role="red"></c></emphasis> </top></programlisting></td> </tr> </informaltable> @@ -1996,13 +1996,13 @@ WHERE dept='finance' <td valign="top"><programlisting language="xml"><top> <emphasis role="red"><b </emphasis>id="start"<emphasis role="red">></emphasis> - <a>A house</a> + <a>A house</a> <a>Rent a car</a> <a>Two houses </a> <a>Five</a> </b> <emphasis role="red"><c</emphasis> id="build"<emphasis role="red">></emphasis>Building a house<emphasis - role="red"></c></emphasis> + role="red"></c></emphasis> </top></programlisting></td> </tr> </informaltable> @@ -2037,13 +2037,13 @@ WHERE dept='finance' <td valign="top"><programlisting language="xml"><top> <b id="first"> - <a>A house</a> + <a>A house</a> <a>Rent a car</a> <a>Two houses </a> <a>Five</a> </b> <emphasis role="red"><c</emphasis> id="build"<emphasis role="red">></emphasis>Building a house<emphasis - role="red"></c></emphasis> + role="red"></c></emphasis> </top></programlisting></td> </tr> </informaltable> @@ -2062,7 +2062,7 @@ WHERE dept='finance' </contact> <emphasis role="red">│</emphasis> <!-- Error: Nicknames must be unique--> <emphasis role="red">│</emphasis> <contact> <!-- O.k.: Nickname <emphasis role="red">│</emphasis> - is optional--> <emphasis role="red">│</emphasis> + is optional--> <emphasis role="red">│</emphasis> <firstName>Petra</firstName> ...<emphasis role="red">│</emphasis> </contact> <emphasis role="red">│</emphasis> <emphasis role="red">│</emphasis> @@ -2092,7 +2092,7 @@ WHERE dept='finance' <td valign="top"><programlisting language="none">CREATE TABLE Contact ( ... - nickname CHAR(10) NULL UNIQUE + nickname CHAR(10) NULL UNIQUE ... )</programlisting></td> </tr> @@ -2108,18 +2108,18 @@ WHERE dept='finance' xlink:href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/blob/master/Doc/Sda1/Ref/Organizer/V17_nickname/organizer.xsd"><xs:element name="organizer"></link> ...<xs:element ref="contact" <co linkends="sda1_xmlschema_fig_organizerContactNicknameUniqueXsd-1" - xml:id="sda1_xmlschema_fig_organizerContactNicknameUniqueXsd-1-co"/>.../> + xml:id="sda1_xmlschema_fig_organizerContactNicknameUniqueXsd-1-co"/>.../> ... ...<xs:unique name="nicknameUnique"> <co linkends="sda1_xmlschema_fig_organizerContactNicknameUniqueXsd-2" xml:id="sda1_xmlschema_fig_organizerContactNicknameUniqueXsd-2-co"/> - <xs:selector xpath = "contact"/> - <xs:field xpath="@nickname"/> <emphasis role="red">│</emphasis> + <xs:selector xpath = "contact"/> + <xs:field xpath="@nickname"/> <emphasis role="red">│</emphasis> </xs:unique> <emphasis role="red">└───â”</emphasis> <emphasis role="red">│</emphasis> <co linkends="sda1_xmlschema_fig_organizerContactNicknameUniqueXsd-3" xml:id="sda1_xmlschema_fig_organizerContactNicknameUniqueXsd-3-co"/> -</xs:element> ... <emphasis role="red">┌─────────┼─────┘</emphasis> +</xs:element> ... <emphasis role="red">┌─────────┼─────┘</emphasis> <emphasis role="red">â–¼</emphasis> <emphasis role="red">│</emphasis> <xs:element name="contact"> <emphasis role="red">â–¼</emphasis> <co @@ -2128,23 +2128,23 @@ WHERE dept='finance' ... <xs:attribute name="nickname" <co linkends="sda1_xmlschema_fig_organizerContactNicknameUniqueXsd-5" xml:id="sda1_xmlschema_fig_organizerContactNicknameUniqueXsd-5-co"/>.../> - ... + ... </xs:element></programlisting></td> <td valign="top"><programlisting language="none"><link xlink:href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/blob/master/Doc/Sda1/Ref/Organizer/V17_nickname/duplicateNickname.xml"><contact nickname=</link>"<emphasis - role="red">Blue</emphasis>"> <emphasis role="red">◀────â”</emphasis> - <firstName>Eve </firstName> <emphasis role="red">│</emphasis> - <lastName>Dexter</lastName> <emphasis role="red">│</emphasis> -</contact> <emphasis role="red">│</emphasis> + role="red">Blue</emphasis>"> <emphasis role="red">◀────â”</emphasis> + <firstName>Eve </firstName> <emphasis role="red">│</emphasis> + <lastName>Dexter</lastName> <emphasis role="red">│</emphasis> +</contact> <emphasis role="red">│</emphasis> + <emphasis role="red">│</emphasis> +<emphasis role="red"><!-- Invalid: Duplicate unique │ + value [Blue] ... --> │</emphasis> <emphasis role="red">│</emphasis> -<emphasis role="red"><!-- Invalid: Duplicate unique │ - value [Blue] ... --> │</emphasis> - <emphasis role="red">│</emphasis> <contact nickname="<emphasis role="red">Blue</emphasis>"> <emphasis - role="red"><emphasis role="red">◀────┘</emphasis></emphasis> - <firstName>Joe</firstName> - <lastName>Simpson</lastName> + role="red"><emphasis role="red">◀────┘</emphasis></emphasis> + <firstName>Joe</firstName> + <lastName>Simpson</lastName> </contact></programlisting></td> </tr> </informaltable> @@ -2200,7 +2200,7 @@ WHERE dept='finance' <contact> <!-- <emphasis role="red">Error: Missing @id</emphasis>--> <firstName>Joe</firstName>...</contact> -<contact id="345"> +<contact id="345"> <firstName>Sue</firstName>...</contact> <contact id="123"> <!-- <emphasis role="red">Error: Duplicate @id value</emphasis>--> @@ -2225,7 +2225,7 @@ WHERE dept='finance' databases</emphasis>: <code language="sql">PRIMARY KEY</code> or UNIQUE + NOT NULL constraint.</para></td> - <td valign="top"><programlisting language="none">CREATE TABLE Contact ( + <td valign="top"><programlisting language="none">CREATE TABLE Contact ( ... id INT PRIMARY KEY ... @@ -2245,20 +2245,20 @@ WHERE dept='finance' ... <xs:element ref="contact".../> ... <xs:key name="primaryKey"> - <xs:selector xpath="contact"/> + <xs:selector xpath="contact"/> <xs:field xpath="@id"/> <emphasis role="red">│</emphasis> </xs:key> <emphasis role="red">┌───┼────┘</emphasis> </xs:element> <emphasis role="red">â–¼</emphasis> <emphasis role="red">└───â”</emphasis> <xs:element name="contact"> <emphasis role="red">â–¼</emphasis> -...<xs:attribute name="id" +...<xs:attribute name="id" type="xs:int" <emphasis role="red">use="optional"</emphasis> <co linkends="sda1_xmlschema_fig_organizerContactIdKeyXsd-1" - xml:id="sda1_xmlschema_fig_organizerContactIdKeyXsd-1-co"/>/> + xml:id="sda1_xmlschema_fig_organizerContactIdKeyXsd-1-co"/>/> ...</programlisting></td> <td valign="top"><programlisting language="none"><emphasis - role="red"><!-- Invalid: Element "organizer" + role="red"><!-- Invalid: Element "organizer" has no value for the key "primaryKey". --></emphasis> <link xlink:href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/blob/master/Doc/Sda1/Ref/Organizer/V20_primaryKeyId/missingId.xml"><contact birthDate="1995-11-29"</link> @@ -2291,17 +2291,17 @@ key "primaryKey". --></emphasis> ... <xs:element ref="contact".../> ... <xs:key name="primaryKey"> - <xs:selector xpath="contact"/> + <xs:selector xpath="contact"/> <xs:field xpath="@id"/> </xs:key> </xs:element> <xs:element name="contact"> -...<xs:attribute name="id" +...<xs:attribute name="id" type="xs:int" <emphasis role="red">use="required"</emphasis> /> ...</programlisting></td> <td valign="top"><programlisting language="none"><emphasis - role="red"><!-- Invalid: Element "organizer" + role="red"><!-- Invalid: Element "organizer" has no value for the key "primaryKey". --></emphasis> <link xlink:href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/blob/master/Doc/Sda1/Ref/Organizer/V20_primaryKeyId/missingId.xml"><contact birthDate="1995-11-29"</link> @@ -2377,7 +2377,7 @@ key "primaryKey". --></emphasis> <programlisting language="none"><contact id="10" > <firstName>Eve </firstName> ... </contact> -<contact id="11" > +<contact id="11" > <firstName>Joe</firstName>... </contact> <contact id="<emphasis role="red">12</emphasis>" > <emphasis role="red">◀──────────────────────────â”</emphasis> <co linkends="sda1_xmlschema_fig_organizerAppointmentInvalidRef-1" @@ -2423,32 +2423,32 @@ key "primaryKey". --></emphasis> <programlisting language="none"><link xlink:href="https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures/blob/master/Doc/Sda1/Ref/Organizer/V33_appointmentParticipants/organizer.xsd"><xs:element name="organizer"></link> <xs:complexType><xs:sequence> ... - <xs:element ... maxOccurs="unbounded" ref="appointment"/> + <xs:element ... maxOccurs="unbounded" ref="appointment"/> ...<xs:key name="primaryKey"> <emphasis role="red">◀─<emphasis role="red">─</emphasis><emphasis role="red"><emphasis role="red"> reference </emphasis><emphasis role="red"><emphasis role="red">─</emphasis></emphasis>â”</emphasis></emphasis> <emphasis - role="red">│</emphasis> + role="red">│</emphasis> <xs:selector xpath="contact"/> <emphasis role="red">│</emphasis> <emphasis role="red">│</emphasis> <co linkends="sda1_xmlschema_fig_organizerEnforceReferentialIntegrity-1" - xml:id="sda1_xmlschema_fig_organizerEnforceReferentialIntegrity-1-co"/> + xml:id="sda1_xmlschema_fig_organizerEnforceReferentialIntegrity-1-co"/> <xs:field xpath="@id"/> <emphasis role="red">│</emphasis> <emphasis role="red">│</emphasis> </xs:key> <emphasis role="red">│</emphasis> <emphasis role="red">│</emphasis> <xs:keyref name="participants" refer="primaryKey"> <emphasis - role="red">│</emphasis> + role="red">│</emphasis> <xs:selector xpath="appointment/participant"/> <emphasis - role="red">│</emphasis> + role="red">│</emphasis> <xs:field xpath="."/> <emphasis role="red">│</emphasis> <emphasis - role="red">│</emphasis> + role="red">│</emphasis> </xs:keyref> <emphasis role="red">└────â”</emphasis> <emphasis - role="red">│</emphasis> + role="red">│</emphasis> </xs:element> <emphasis role="red">│</emphasis> <emphasis - role="red">│</emphasis> -<xs:element name="appointment"> <emphasis role="red">◀──────────────┼───────┘</emphasis> + role="red">│</emphasis> +<xs:element name="appointment"> <emphasis role="red">◀──────────────┼───────┘</emphasis> <xs:complexType><xs:sequence> <emphasis - role="red">â–¼</emphasis> + role="red">â–¼</emphasis> ... <xs:element type="xs:integer" name="participant" <co linkends="sda1_xmlschema_fig_organizerEnforceReferentialIntegrity-2" xml:id="sda1_xmlschema_fig_organizerEnforceReferentialIntegrity-2-co"/></programlisting> @@ -2761,7 +2761,7 @@ key "primaryKey". --></emphasis> <xs:complexType> <xs:sequence> <xs:element ref="contact" - minOccurs="0" maxOccurs="unbounded"/> + minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> @@ -2770,7 +2770,7 @@ key "primaryKey". --></emphasis> <xs:sequence> <xs:element name="firstName"/> <xs:element name="lastName"/> - <xs:element name="email" minOccurs="0"/> + <xs:element name="email" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element></programlisting></td> @@ -3006,7 +3006,7 @@ public class Memo { <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" - xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" + xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" vc:minVersion="1.0" vc:maxVersion="1.1"> @@ -3016,7 +3016,7 @@ public class Memo { <xs:totalDigits value="10"/> </xs:restriction> </xs:simpleType> - + <xs:simpleType name="invoiceStatus"> <xs:restriction base="xs:token"> <xs:enumeration value="open"/> @@ -3032,7 +3032,7 @@ public class Memo { <xs:element ref="invoice" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> - + <xs:key name="customerId"> <xs:annotation> <xs:documentation>Customers' primary key</xs:documentation> @@ -3040,7 +3040,7 @@ public class Memo { <xs:selector xpath="customer"/> <xs:field xpath="@id"/> </xs:key> - + <xs:keyref refer="customerId" name="customerToInvoice"> <xs:annotation> <xs:documentation>Referencing a customer's primary key</xs:documentation> @@ -3049,7 +3049,7 @@ public class Memo { <xs:field xpath="@customer"/> </xs:keyref> </xs:element> - + <xs:element name="customer"> <xs:complexType> <xs:sequence> @@ -3067,23 +3067,23 @@ public class Memo { <xs:attribute name="status" type="invoiceStatus"/> <!-- See xs:simpleType definition above --> <xs:attribute name="customer" type="xs:int" use="required"/> - + </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> - + </xs:schema></programlisting> <para>An example data set:</para> <programlisting language="xml"><data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="invoice.xsd"> - + <customer id="5"> <name>Clarke Jefferson</name> </customer> - + <invoice customer="5" status="due">33.12</invoice> </data></programlisting> @@ -3135,7 +3135,7 @@ public class Memo { <programlisting language="xml"> <customer id="5"> <name>Clarke Jefferson</name> </customer> - + <customer id="5"> <name>Jane Austen</name> </customer></programlisting> @@ -3150,7 +3150,7 @@ public class Memo { <programlisting language="xml"> <customer id="5"> <name>Clarke Jefferson</name> </customer> - + <invoice customer="6" status="due">33.12</invoice></programlisting> </glossdef> </glossentry> @@ -3230,12 +3230,12 @@ public class Memo { <destination id="1" airportCode="EDDF"> <fullName>Frankfurt International Airport – Frankfurt am Main</fullName> </destination> - + <destination id="3" airportCode="EBCI"> <fullName>Brussels South Charleroi Airport – Charleroi</fullName> </destination> </destinations> - + <flights> <flight id="1" airline="2" origin="1" destination="3"> <flightNumber>LH 4234</flightNumber> @@ -3265,21 +3265,21 @@ public class Memo { <programlisting language="xml"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" vc:minVersion="1.1"> - + <xs:simpleType name="ICAOAirportCode"> <xs:restriction base="xs:string"> <xs:length value="4" /> <xs:pattern value="[A-Z09]+"></xs:pattern> </xs:restriction> </xs:simpleType> - + <xs:simpleType name="ICAOAirlineCode"> <xs:restriction base="xs:string"> <xs:length value="3"/> <xs:pattern value="[A-Z]+"></xs:pattern> </xs:restriction> </xs:simpleType> - + <xs:element name="top"> <xs:complexType> <xs:sequence> @@ -3288,22 +3288,22 @@ public class Memo { <xs:element ref="flights"/> </xs:sequence> </xs:complexType> - + <xs:keyref name="_FK_Flight_airline" refer="_PK_Airline_id"> <xs:selector xpath="flights/flight"/> <xs:field xpath="@airline"/> </xs:keyref> - + <xs:keyref name="_FK_Flight_origin" refer="_PK_Destination_id"> <xs:selector xpath="flights/flight"/> <xs:field xpath="@origin"/> </xs:keyref> - + <xs:keyref name="_FK_Flight_destination" refer="_PK_Destination_id"> <xs:selector xpath="flights/flight"/> <xs:field xpath="@destination"/> </xs:keyref> - + </xs:element> <xs:element name="airlines"> @@ -3317,12 +3317,12 @@ public class Memo { <xs:selector xpath="airline"/> <xs:field xpath="@id"/> </xs:key> - + <xs:key name="_UN_Airline_name"> <xs:selector xpath="airline"/> <xs:field xpath="name"/> </xs:key> - + <xs:key name="_UN_Airline_airlineCode"> <xs:selector xpath="airline"/> <xs:field xpath="@airlineCode"/> @@ -3334,23 +3334,23 @@ public class Memo { <xs:sequence> <xs:element name="name" type="xs:string"/> </xs:sequence> - <xs:attribute name="id" type="xs:int" use="required"/> - <xs:attribute name="airlineCode" type="ICAOAirlineCode" use="required"/> + <xs:attribute name="id" type="xs:int" use="required"/> + <xs:attribute name="airlineCode" type="ICAOAirlineCode" use="required"/> </xs:complexType> </xs:element> - + <xs:element name="destinations"> <xs:complexType> <xs:sequence> <xs:element ref="destination" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> - + <xs:key name="_PK_Destination_id"> <xs:selector xpath="destination"/> <xs:field xpath="@id"/> </xs:key> - + <xs:key name="_UN_Destination_airportCode"> <xs:selector xpath="destination"/> <xs:field xpath="@airportCode"/> @@ -3362,28 +3362,28 @@ public class Memo { <xs:sequence> <xs:element name="fullName"/> </xs:sequence> - <xs:attribute name="id" type="xs:int"/> - <xs:attribute name="airportCode" type="ICAOAirportCode"/> + <xs:attribute name="id" type="xs:int"/> + <xs:attribute name="airportCode" type="ICAOAirportCode"/> </xs:complexType> </xs:element> - + <xs:element name="flights"> <xs:complexType> <xs:sequence> <xs:element ref="flight" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> - + <xs:key name="_PK_Flight_id"> <xs:selector xpath="flight"/> <xs:field xpath="@id"/> </xs:key> - + <xs:key name="_UN_Flight_flightNumber"> <xs:selector xpath="flight"/> <xs:field xpath="flightNumber"/> </xs:key> - + </xs:element> <xs:element name="flight"> @@ -3391,10 +3391,10 @@ public class Memo { <xs:sequence> <xs:element name="flightNumber" type="xs:string"/> </xs:sequence> - <xs:attribute name="id" type="xs:int" use="required"/> - <xs:attribute name="airline" type="xs:int" use="required"/> - <xs:attribute name="origin" type="xs:int"/> - <xs:attribute name="destination" type="xs:int"/> + <xs:attribute name="id" type="xs:int" use="required"/> + <xs:attribute name="airline" type="xs:int" use="required"/> + <xs:attribute name="origin" type="xs:int"/> + <xs:attribute name="destination" type="xs:int"/> <xs:assert test="not(@origin = @destination)"> <xs:annotation> <xs:documentation>CHECK constraint _CK_Flight_origin_destination</xs:documentation> @@ -3402,7 +3402,7 @@ public class Memo { </xs:assert> </xs:complexType> </xs:element> - + </xs:schema></programlisting> </answer> </qandaentry> @@ -3520,25 +3520,25 @@ public class Memo { <programlisting language="xml"><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"> - + <xs:simpleType name="money"> <xs:restriction base="xs:decimal"> <xs:fractionDigits value="2"/> </xs:restriction> </xs:simpleType> - - <xs:element name="title" type="xs:string"/> + + <xs:element name="title" type="xs:string"/> <xs:element name="para" type="xs:string"/> - + <xs:element name="description" type="paraSequence"/> <xs:element name="introduction" type="paraSequence"/> - + <xs:complexType name="paraSequence"> <xs:sequence> <xs:element ref="para" minOccurs="1" maxOccurs="unbounded"/> - </xs:sequence> + </xs:sequence> </xs:complexType> - + <xs:element name="product"> <xs:complexType> <xs:sequence> @@ -3558,7 +3558,7 @@ public class Memo { <xs:element ref="product" minOccurs="1" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> - + <xs:key name="uniqueProductId"> <xs:selector xpath="product"></xs:selector> <xs:field xpath="@id"/> @@ -3742,7 +3742,7 @@ public class Memo { <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> - + <!-- Elements having no inner structure (but maybe attributes) --> <xs:element name="title" type="xs:string"/> <xs:element name="emphasis" type="xs:string"/> @@ -3756,7 +3756,7 @@ public class Memo { </xs:sequence> </xs:complexType> </xs:element> - + <xs:element name="chapter"> <xs:complexType> <xs:sequence> <co xml:id="figure_book.dtd_v2_chapter"/> @@ -3768,7 +3768,7 @@ public class Memo { </xs:sequence> </xs:complexType> </xs:element> - + <xs:element name="para"> <xs:complexType mixed="true"> <co xml:id="figure_book.dtd_v2_para"/> @@ -3777,7 +3777,7 @@ public class Memo { </xs:choice> </xs:complexType> </xs:element> - + <xs:element name="itemizedlist"> <xs:complexType> <xs:sequence> @@ -3786,7 +3786,7 @@ public class Memo { </xs:sequence> </xs:complexType> </xs:element> - + <xs:element name="listitem"> <xs:complexType> <xs:choice minOccurs="1" maxOccurs="unbounded"> <co @@ -3796,7 +3796,7 @@ public class Memo { </xs:choice> </xs:complexType> </xs:element> - + </xs:schema></programlisting> <caption> @@ -3983,18 +3983,18 @@ public class Memo { <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" - xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" + xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" vc:minVersion="1.0" vc:maxVersion="1.1"> - - <xs:import namespace="http://www.w3.org/XML/1998/namespace" + + <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd" /> - - + + <xs:include schemaLocation="table.xsd"/> <!-- Type definitions --> - + <xs:attribute name="lang"> <xs:simpleType> <xs:restriction base="xs:string"> @@ -4017,7 +4017,7 @@ public class Memo { xml:id="progamlisting_book_v5_link_linkend"/> type="xs:IDREF" use="required"/> </xs:complexType> </xs:element> - + <!-- Starting the game ... --> <xs:element name="book"> <xs:complexType> @@ -4028,7 +4028,7 @@ public class Memo { <xs:attribute ref="lang" use="optional"/> </xs:complexType> </xs:element> - + <xs:element name="chapter"> <xs:complexType> <xs:sequence> @@ -4045,7 +4045,7 @@ public class Memo { <xs:attribute ref="xml:base"/> <!-- This allows supporting <xi:include ...> --> </xs:complexType> </xs:element> - + <xs:element name="para"> <xs:complexType mixed="true"> <co xml:id="progamlisting_book_v5_mixed_link"/> @@ -4119,7 +4119,7 @@ public class Memo { model:</para> <programlisting language="xml"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> - + <xs:element name="table"> <xs:complexType> <xs:sequence> @@ -4130,7 +4130,7 @@ public class Memo { <xs:attribute name="border"/> </xs:complexType> </xs:element> - + <xs:element name="tr"> <xs:complexType> <xs:sequence> @@ -4138,14 +4138,14 @@ public class Memo { </xs:sequence> </xs:complexType> </xs:element> - + <xs:element name="td"> <xs:complexType mixed="true"> <xs:attribute name="colspan" type="xs:positiveInteger" use="optional"/> <xs:attribute name="rowspan" type="xs:positiveInteger" use="optional"/> </xs:complexType> </xs:element> - + </xs:schema></programlisting> </answer> </qandaentry> diff --git a/Doc/Sda1/xslt.xml b/Doc/Sda1/xslt.xml index 0575855da..67165d310 100644 --- a/Doc/Sda1/xslt.xml +++ b/Doc/Sda1/xslt.xml @@ -81,13 +81,13 @@ <xs:element name="memo"> <xs:complexType> - <xs:sequence> - <xs:element name="from" type="Person"/> + <xs:sequence> + <xs:element name="from" type="Person"/> <xs:element name="to" type="Person" minOccurs="1" maxOccurs="unbounded"/> <xs:element name="subject" type="xs:string"/> <xs:element ref="content"/> </xs:sequence> - <xs:attribute name="date" type="xs:date" use="required"/> + <xs:attribute name="date" type="xs:date" use="required"/> <xs:attribute name="priority" type="Priority" use="optional"/> </xs:complexType> </xs:element> @@ -97,7 +97,7 @@ <xs:extension base="xs:string"> <xs:attribute name="id" type="xs:ID"/> </xs:extension> - </xs:simpleContent> + </xs:simpleContent> </xs:complexType> <xs:element name="content"> @@ -106,7 +106,7 @@ <xs:element ref="para" minOccurs="1" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> - + </xs:element> <xs:element name="para"> @@ -153,7 +153,7 @@ <subject>Firewall problems</subject> <content> <para>Thanks for your excellent work.</para> - <para>Our firewall is definitely broken! This bug has been reported by + <para>Our firewall is definitely broken! This bug has been reported by the <link <emphasis role="bold">linkend="goik"</emphasis>>sender</link>.</para> </content> </memo></programlisting> @@ -165,13 +165,13 @@ <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> - + <xsl:output method="text"/> - + <xsl:template match="/memo"> <xsl:value-of select="from"/> </xsl:template> - + </xsl:stylesheet></programlisting> </figure> @@ -216,18 +216,18 @@ Martin Goik</computeroutput></screen> <programlisting language="xml"><xsl:stylesheet <co xml:id="programlisting_helloxsl_stylesheet"/> xmlns:xsl <co - xml:id="programlisting_helloxsl_namespace_abbv"/> ="http://www.w3.org/1999/XSL/Transform" + xml:id="programlisting_helloxsl_namespace_abbv"/> ="http://www.w3.org/1999/XSL/Transform" version="2.0" <co xml:id="programlisting_helloxsl_xsl_version"/> > - + <xsl:output method="text" <co xml:id="programlisting_helloxsl_method_text"/>/> - + <xsl:template <co xml:id="programlisting_helloxsl_template"/> match <co xml:id="programlisting_helloxsl_match"/> ="/memo"> <xsl:value-of <co xml:id="programlisting_helloxsl_value-of"/> select <co xml:base="" xml:id="programlisting_helloxsl_valueof_select_att"/> ="from" /> </xsl:template> - + </xsl:stylesheet></programlisting> </figure> @@ -356,7 +356,7 @@ Martin Goik</computeroutput></screen> xml:id="programlisting_tolist_xpath_memo_to"/> > <xsl:value-of select="." <co xml:id="programlisting_tolist_value_of"/> /> <xsl:text>,</xsl:text> <co - xml:id="programlisting_tolist_xsl_text"/> + xml:id="programlisting_tolist_xsl_text"/> </xsl:for-each> </xsl:template></programlisting> @@ -665,7 +665,7 @@ INSERT INTO Customer (id, name) VALUES ('eve', 'Eve intruder')</computeroutput>< <programlisting language="xml"><xsl:for-each select="memo/to"> <xsl:value-of select="."/> <xsl:if test="position() &lt; last()"> - <xsl:text>,</xsl:text> + <xsl:text>,</xsl:text> </xsl:if> </xsl:for-each></programlisting> </answer> @@ -727,8 +727,8 @@ INSERT INTO Customer (id, name) VALUES ('eve', 'Eve intruder')</computeroutput>< <xsl:value-of select="."/> <xsl:if test="<emphasis role="bold">position()</emphasis> &lt; <emphasis role="bold">last()</emphasis>"> - <xsl:text>,</xsl:text> - </xsl:if> + <xsl:text>,</xsl:text> + </xsl:if> </xsl:template></programlisting> <calloutlist> @@ -812,13 +812,13 @@ for (int i = 0; i < 10; i++){ <programlisting language="xml"><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> - + <xsl:output method="text"/> - + <xsl:template match="/memo"> <xsl:apply-templates <emphasis role="bold">select="content"</emphasis>/> </xsl:template> - + </xsl:stylesheet></programlisting> <para>Since no suitable template supplying rules for <tag @@ -1064,7 +1064,7 @@ IV: ... <xsl:template match="to"> <li> <xsl:value-of select="."/> - </li> + </li> </xsl:template></programlisting> <para>Processing this style sheet for a <tag class="starttag">memo</tag> @@ -1111,7 +1111,7 @@ IV: ... <xsl:output method="xhtml" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/> - + <xsl:template match="/"> <html><head> ... </xsl:template> @@ -1161,9 +1161,9 @@ IV: ... <answer> <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> - + <xsl:output indent="yes" method="xhtml"/> - + <xsl:template match="/book"> <html> <head> @@ -1175,7 +1175,7 @@ IV: ... </body> </html> </xsl:template> - + <xsl:template match="chapter"> <h2><xsl:value-of select="title"/></h2> <xsl:apply-templates select="para"/> @@ -1392,7 +1392,7 @@ IV: ... class="starttag">emphasis</tag> child nodes:</para> <programlisting language="xml"><content>The <emphasis role="bold"><url href="http://w3.org/XML">XML</url></emphasis> language - is <emphasis role="bold"><emphasis>easy</emphasis></emphasis> to learn. However you need + is <emphasis role="bold"><emphasis>easy</emphasis></emphasis> to learn. However you need some <emphasis role="bold"><emphasis>time</emphasis></emphasis>.</content></programlisting> <para>Embedded element nodes have been set to bold style in order to @@ -2069,15 +2069,15 @@ Jack Eve Jude <----Tolstoi----> <co </xsl:template> <xsl:template match="to"> - <emphasis role="bold"><xsl:result-document</emphasis> - <co xml:id="programlisting_xsl_result_document_main"/> - <emphasis role="bold">href="file_{position()}.txt"</emphasis> - <co xml:id="programlisting_xsl_result_document_href"/> - <emphasis role="bold">method="text"</emphasis> + <emphasis role="bold"><xsl:result-document</emphasis> + <co xml:id="programlisting_xsl_result_document_main"/> + <emphasis role="bold">href="file_{position()}.txt"</emphasis> + <co xml:id="programlisting_xsl_result_document_href"/> + <emphasis role="bold">method="text"</emphasis> <co xml:id="programlisting_xsl_result_document_method"/>> <xsl:value-of select="."/> <co xml:id="programlisting_xsl_result_document_content"/> - + <emphasis role="bold"></xsl:result-document></emphasis> </xsl:template></programlisting> @@ -2147,7 +2147,7 @@ Jack Eve Jude <----Tolstoi----> <co <xsl:result-document href="index.html"> <xsl:apply-templates select="book"/> </xsl:result-document> - + <xsl:for-each select="book/chapter"> <xsl:result-document href="{generate-id(.)}.html"> <xsl:apply-templates select="."/> @@ -2180,7 +2180,7 @@ Jack Eve Jude <----Tolstoi----> <co <xsl:variable name="reftargetNode" select="id(@linkend)"/> <xsl:variable name="reftargetParentChapter" select="$reftargetNode/ancestor-or-self::chapter"/> - + <a href="{generate-id($reftargetParentChapter)}.html#{ generate-id($reftargetNode)}"> <xsl:value-of select="."/> @@ -2353,7 +2353,7 @@ Jack Eve Jude <----Tolstoi----> <co test="node()">...</code> conditionals inside.</para> <programlisting language="xml"> <xsl:output method="xhtml" indent="no"/> - + <xsl:template match="/"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> @@ -2366,7 +2366,7 @@ Jack Eve Jude <----Tolstoi----> <co </body> </html> </xsl:template> - + <!-- Matching elements containing text or other nodes --> <xsl:template match="*[node()]"> <xsl:text>&lt;</xsl:text> @@ -2374,17 +2374,17 @@ Jack Eve Jude <----Tolstoi----> <co <xsl:value-of select="name(.)"/> </span> <xsl:apply-templates select="@*"/> - + <xsl:text>&gt;</xsl:text> <xsl:apply-templates select="node()|text()"/> - + <xsl:text>&lt;/</xsl:text> <span style="color: Blue;"> <xsl:value-of select="name(.)"/> </span> <xsl:text>&gt;</xsl:text> </xsl:template> - + <!-- Matching empty elements --> <xsl:template match="*"> <xsl:text>&lt;</xsl:text> @@ -2392,12 +2392,12 @@ Jack Eve Jude <----Tolstoi----> <co <xsl:value-of select="name(.)"/> </span> <xsl:apply-templates select="@*"/> - + <span style="color: Aqua;"> <xsl:text>/&gt;</xsl:text> </span> </xsl:template> - + <!-- Matching attributes --> <xsl:template match="@*"> <xsl:text> </xsl:text> diff --git a/Doc/Sdi/dns.xml b/Doc/Sdi/dns.xml index c6fead01e..20e1465c4 100644 --- a/Doc/Sdi/dns.xml +++ b/Doc/Sdi/dns.xml @@ -162,7 +162,7 @@ zone "75.62.141.in-addr.arpa" { <glossdef> <screen>; -; BIND data file +; BIND data file ; $TTL 604800 @ IN SOA ns4.mi.hdm-stuttgart.de. root.mi.hdm-stuttgart.de. ( @@ -192,7 +192,7 @@ www4.mi.hdm-stuttgart.de. IN A 141.62.75.104</screen> <glossterm><filename>/etc/bind/zones/db.141.62.75</filename></glossterm> <glossdef> - <screen>; BIND reverse data file + <screen>; BIND reverse data file ; $TTL 604800 @ IN SOA ns4.mi.hdm-stuttgart.de. root.mi.hdm-stuttgart.de. ( diff --git a/Doc/Sdi/docker.xml b/Doc/Sdi/docker.xml index 7b7d659b8..4f056daa7 100644 --- a/Doc/Sdi/docker.xml +++ b/Doc/Sdi/docker.xml @@ -46,14 +46,14 @@ NAME DESCRIPTION <link xlink:href="https://docs.docker.com/docker-hub/repos/#stars">STARS</link> <link xlink:href="https://docs.docker.com/docker-hub/official_repos">OFFICIAL</link> <link xlink:href="https://docs.docker.com/docker-cloud/builds/automated-build">AUTOMATED</link> -nextcloud A safe home … 424 [OK] -linuxserver/nextcloud A Nextcloud … 56 +nextcloud A safe home … 424 [OK] +linuxserver/nextcloud A Nextcloud … 56 greyltc/nextcloud Nextcloud: … 34 [OK] wonderfall/nextcloud All-in-one … 27 [OK] rootlogin/nextcloud Nextcloud … 17 [OK] -lsioarmhf/nextcloud ARMHF based … 8 -ownyourbits/nextcloudpi NextCloud ARM … 7 -... </screen> +lsioarmhf/nextcloud ARMHF based … 8 +ownyourbits/nextcloudpi NextCloud ARM … 7 +...</screen> </figure> <figure xml:id="sdiDocker_figPullImage"> @@ -63,7 +63,7 @@ ownyourbits/nextcloudpi NextCloud ARM … 7 xlink:href="https://docs.docker.com/engine/reference/commandline/image_pull">docker image pull</link> alpine Using default tag: latest latest: Pulling from library/alpine -<emphasis role="red">ff3a5c916c92</emphasis>: Pull complete +<emphasis role="red">ff3a5c916c92</emphasis>: Pull complete Digest: sha256:7df6db5aa61ae9480f52f0b3a06a140ab98d427f86d8d5de0bedab9b8df6b1c0 Status: Downloaded newer image for alpine:latest</screen> </figure> @@ -84,10 +84,10 @@ latest: Pulling from wonderfall/nextcloud xml:id="sdiDocker_figPullNextcloudImage-3-co"/> a542d4c3cffb: Pull complete <co linkends="sdiDocker_figPullNextcloudImage-4" xml:id="sdiDocker_figPullNextcloudImage-4-co"/> -83001cc0bea0: Pull complete -41a33c66b2c1: Pull complete -a70bf67726f3: Pull complete -fea90b3d29ac: Pull complete +83001cc0bea0: Pull complete +41a33c66b2c1: Pull complete +a70bf67726f3: Pull complete +fea90b3d29ac: Pull complete Digest: sha256:472c5c7...2ca20cca45 <co linkends="sdiDocker_figPullNextcloudImage-5" xml:id="sdiDocker_figPullNextcloudImage-5-co"/> @@ -161,12 +161,12 @@ Status: Downloaded newer image for wonderfall/nextcloud:latest</screen> <screen>> docker image pull nextcloud:13.0.2 13.0.2: Pulling from library/nextcloud -3d77ce4481b1: Pull complete -32bfdb6043a8: Pull complete -028453741593: Pull complete -f93d7bd342a3: Pull complete -4a2fac611953: Pull complete -87fdfc7d0f94: Pull complete +3d77ce4481b1: Pull complete +32bfdb6043a8: Pull complete +028453741593: Pull complete +f93d7bd342a3: Pull complete +4a2fac611953: Pull complete +87fdfc7d0f94: Pull complete Digest: sha256:c693921e69cb8...50156d973df035 Status: Downloaded newer image for nextcloud:13.0.2</screen> </figure> @@ -177,7 +177,7 @@ Status: Downloaded newer image for nextcloud:13.0.2</screen> <programlisting language="xml"><dependency> <groupId>junit</groupId> <!-- <emphasis role="red">wonderfall</emphasis> --> <artifactId>junit</artifactId> <!-- <emphasis role="red">nextcloud</emphasis> --> - <version>4.12</version> + <version>4.12</version> </dependency></programlisting> </figure> diff --git a/Doc/Sdi/gettingStarted.xml b/Doc/Sdi/gettingStarted.xml index 1e3afc176..27f547205 100644 --- a/Doc/Sdi/gettingStarted.xml +++ b/Doc/Sdi/gettingStarted.xml @@ -40,7 +40,7 @@ drwx------+ 32 mistudent mi 0 Okt 17 17:44 .. <abbrev>cifs</abbrev> based network file systems using extended ACLs. We may ask <command>getfacl</command> for details:</para> - <screen>mistudent@w10m:~/.ssh$ getfacl authorized_keys + <screen>mistudent@w10m:~/.ssh$ getfacl authorized_keys # file: authorized_keys # owner: mistudent # group: mi @@ -57,7 +57,7 @@ other::---</screen> <screen>mistudent@w10m:~/.ssh$ setfacl -m user:mistudent:--- authorized_keys mistudent@w10m:~/.ssh$ setfacl -m user::rw- authorized_keys -mistudent@w10m:~/.ssh$ getfacl authorized_keys +mistudent@w10m:~/.ssh$ getfacl authorized_keys # file: authorized_keys # owner: mistudent # group: mi @@ -68,7 +68,7 @@ group:users:--- mask::--- other::--- -mistudent@w10m:~/ssh$ ls -al authorized_keys +mistudent@w10m:~/ssh$ ls -al authorized_keys -rw-------+ 1 mistudent mi 396 Okt 17 17:45 authorized_keys</screen> <para>Addressing each file and the directory itself in a similar fashion @@ -91,7 +91,7 @@ The authenticity of host 'sdi4a.mi.hdm-stuttgart.de (141.62.75.104)' can't be es ECDSA key fingerprint is b1:ee:e1:3d:db:3c:0b:06:e9:fb:b3:ae:b8:ed:e2:a8. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'sdi4a.mi.hdm-stuttgart.de,141.62.75.104' (ECDSA) to the list of known hosts. -root@sdi4a.mi.hdm-stuttgart.de's password: +root@sdi4a.mi.hdm-stuttgart.de's password: Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 2.6.32-19-pve x86_64) * Documentation: https://help.ubuntu.com/ @@ -107,8 +107,8 @@ Last login: Fri Mar 27 08:29:40 2015 from 192.168.1.66</screen> still using password access:</para> <screen>root@goiki:~# scp /ma/goik/.ssh/id_rsa.pub root@sdi4a.mi.hdm-stuttgart.de: -root@sdi4a.mi.hdm-stuttgart.de's password: -id_rsa.pub 100% 736 0.7KB/s 00:00 +root@sdi4a.mi.hdm-stuttgart.de's password: +id_rsa.pub 100% 736 0.7KB/s 00:00 </screen> </listitem> diff --git a/Doc/Sdi/ldap.xml b/Doc/Sdi/ldap.xml index ba5cc2dae..563625541 100644 --- a/Doc/Sdi/ldap.xml +++ b/Doc/Sdi/ldap.xml @@ -537,7 +537,7 @@ olcRootPW: {ssha}pHE+EPOG2gyRyOgjvFqsWOb5zGsGl9CD</screen> <para>Activating this configuration my be effected by using <command xlink:href="http://www.openldap.org/software/man.cgi?query=ldapmodify&apropos=0&sektion=0&manpath=OpenLDAP+2.4-Release&format=html">ldapmodify</command>:</para> - <screen>root@sdi8a:~# ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f ~/add_olcRootPW.ldif + <screen>root@sdi8a:~# ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f ~/add_olcRootPW.ldif modifying entry "olcDatabase={0}config,cn=config"</screen> <para>This activation in turn enables a new account:</para> diff --git a/Doc/Sdi/samba.xml b/Doc/Sdi/samba.xml index 0b5fbcecd..228de87b8 100644 --- a/Doc/Sdi/samba.xml +++ b/Doc/Sdi/samba.xml @@ -44,7 +44,7 @@ xlink:href="http://linux.die.net/man/1/smbclient">smbclient</command>:</para> <screen>root@sdi4a:~# smbclient -L localhost --user smbtester -Enter smbtester's password: +Enter smbtester's password: Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.6-Ubuntu] Sharename Type Comment @@ -71,10 +71,10 @@ Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.6-Ubuntu] Mac-OS or Linux):</para> <screen>root@mi-ESPRIMO-P910:~# mount -t cifs //sdi4a.mi.hdm-stuttgart.de/smbtester /mnt/test/ -ouser=smbtester -Password for smbtester@//sdi4a.mi.hdm-stuttgart.de/smbtester: +Password for smbtester@//sdi4a.mi.hdm-stuttgart.de/smbtester: root@mi-ESPRIMO-P910:~# cat /mnt/test/ -.bash_history q.txt .viminfo -root@mi-ESPRIMO-P910:~# cat /mnt/test/q.txt +.bash_history q.txt .viminfo +root@mi-ESPRIMO-P910:~# cat /mnt/test/q.txt Mal sehen ... root@mi-ESPRIMO-P910:~# df /mnt/test/ Filesystem 1K-blocks Used Available Use% Mounted on diff --git a/Doc/Tdoc/general.xml b/Doc/Tdoc/general.xml index e5b37dfbd..5f1eab538 100644 --- a/Doc/Tdoc/general.xml +++ b/Doc/Tdoc/general.xml @@ -868,7 +868,7 @@ <td><programlisting language="html"><code><h1 id="start" >First section</h1> <p>A remark.</p> - + <h2>A subsection</h2> <p>See <a href="#start" >remark</a>.</p> @@ -877,7 +877,7 @@ <th><xref linkend="glo_Docbook"/></th> <td><programlisting language="xml"><code><section xml:id="start"> - <title>First + <title>First section</title> <para>A remark.</para> <section> @@ -1132,7 +1132,7 @@ See remark at page 1.</literallayout></td> <figure xml:id="tdocSectDocbookRepresentation"> <title>Document representation</title> - <programlisting language="xml"><section version="5.1" + <programlisting language="xml"><section version="5.1" xmlns="http://docbook.org/ns/docbook" ...> @@ -1573,7 +1573,7 @@ See remark at page 1.</literallayout></td> <td valign="top"><programlisting language="xml"><itemizedlist> <listitem> - <para>Bee</para> + <para>Bee</para> </listitem> <listitem> <para>Ant</para> @@ -1582,7 +1582,7 @@ See remark at page 1.</literallayout></td> <td valign="top"><programlisting language="xml"><ul> <li> - <p>Bee</p> + <p>Bee</p> </li> <li> <p>Ant</p> @@ -1617,7 +1617,7 @@ See remark at page 1.</literallayout></td> <td valign="top"><programlisting language="xml"><orderedlist> <listitem> - <para>Bee</para> + <para>Bee</para> </listitem> <listitem> @@ -1627,7 +1627,7 @@ See remark at page 1.</literallayout></td> <td valign="top"><programlisting language="xml"><ol> <li> - <p>Bee</p> + <p>Bee</p> </li> <li> <p>Ant</p> @@ -1676,7 +1676,7 @@ See remark at page 1.</literallayout></td> </glossdef> </glossentry> <glossentry> - <glossterm>Mouse</glossterm> + <glossterm>Mouse</glossterm> <glossdef> <para>Mammal</para> </glossdef> @@ -1687,7 +1687,7 @@ See remark at page 1.</literallayout></td> <dt>Bee</dt> <dd>Insect</dd> <dt>Mouse</dt> - <dd>Mammal</dd> + <dd>Mammal</dd> </dl></programlisting></td> </tr> </informaltable> @@ -1734,7 +1734,7 @@ See remark at page 1.</literallayout></td> <para>Tea</para> <itemizedlist> <listitem> - <para>black</para> + <para>black</para> </listitem> <listitem> <para>green</para> @@ -1750,7 +1750,7 @@ See remark at page 1.</literallayout></td> <li> <p>Tea</p> <ul> - <li>black</li> + <li>black</li> <li>green</li> </ul> </li> @@ -1802,7 +1802,7 @@ See remark at page 1.</literallayout></td> <td>A2</td> </tr> <tr> - <td colspan="2">B</td> + <td colspan="2">B</td> </tr> </informaltable></programlisting></td> @@ -1816,7 +1816,7 @@ See remark at page 1.</literallayout></td> <td>A2</td> </tr> <tr> - <td colspan="2">B</td> + <td colspan="2">B</td> </tr> </table></programlisting></td> </tr> @@ -1910,7 +1910,7 @@ See remark at page 1.</literallayout></td> <mathphrase> $ |x| = \left\{ \begin{array}{rl} - -x & \mbox{if $x&lt;0$} \\ + -x & \mbox{if $x&lt;0$} \\ x & \mbox{otherwise} \end{array}\right.$ </mathphrase> @@ -1919,7 +1919,7 @@ See remark at page 1.</literallayout></td> <td valign="top"><programlisting language="xml"><span class="mathphrase"> $ |x| = \left\{ \begin{array}{rl} - -x & \mbox{if $x&lt;0$} \\ + -x & \mbox{if $x&lt;0$} \\ x & \mbox{otherwise} \end{array}\right.$ </span></programlisting></td> @@ -2103,7 +2103,7 @@ See remark at page 1.</literallayout></td> </caution></td> <td valign="top"><programlisting language="xml"><caution> - <para>Beware of overheating!</para> + <para>Beware of overheating!</para> </caution></programlisting></td> </tr> </informaltable> @@ -2134,7 +2134,7 @@ See remark at page 1.</literallayout></td> <informaltable border="1"> <tr> <td valign="top"><programlisting language="xml"><chapter version="5.1" - xmlns="http://docbook.org/ns/docbook"> + xmlns="http://docbook.org/ns/docbook"> <title>Top</title> <section> <title>Level 1</title> @@ -2155,7 +2155,7 @@ See remark at page 1.</literallayout></td> <h2>Level 1</h2> <h3>Level 2</h3> <h4>Level 3</h4> - <p>Hello!</p></body> + <p>Hello!</p></body> </html></programlisting></td> </tr> </informaltable> @@ -2167,7 +2167,7 @@ See remark at page 1.</literallayout></td> <informaltable border="1"> <tr> <td valign="top"><programlisting language="xml"><chapter version="5.1" - xmlns="http://docbook.org/ns/docbook"> + xmlns="http://docbook.org/ns/docbook"> <title>Top</title> <sect1> <title>Level 1</title> @@ -2188,7 +2188,7 @@ See remark at page 1.</literallayout></td> <h2>Level 1</h2> <h3>Level 2</h3> <h4>Level 3</h4> - <p>Hello!</p></body> + <p>Hello!</p></body> </html></programlisting></td> </tr> </informaltable> @@ -2246,7 +2246,7 @@ See <xref linkend="intro"/> ...</programlisting> <glossdef> <para>These are <quote>usual</quote> hypertext links:</para> - <programlisting language="xml"><para>See + <programlisting language="xml"><para>See <link href="http://tdg.docbook.org">Docbook</link> .</para></programlisting> </glossdef> @@ -2445,7 +2445,7 @@ See <xref linkend="intro"/> ...</programlisting> <title>First section</title> <para>A stable link</para> </section> - <section> <!-- no xml:id attribute--> + <section> <!-- no xml:id attribute--> <title>Second section</title> <para>No stable link</para> ...</programlisting></td> @@ -2453,7 +2453,7 @@ See <xref linkend="intro"/> ...</programlisting> <html> ... <h2 id="firstSection" <co linkends="xmlc_colist_permalink-2" - xml:id="xmlc_colist_permalink-2-co"/>>First section</h2> + xml:id="xmlc_colist_permalink-2-co"/>>First section</h2> <p>A stable link</p> <h2 id="d03213" <co linkends="xmlc_colist_permalink-3" @@ -3069,7 +3069,7 @@ div.equation > p.title { <figure xml:id="xmlc_fig_monolithicExample"> <title>A monolithic document</title> - <programlisting language="xml"><book version="5.1" + <programlisting language="xml"><book version="5.1" xmlns="http://docbook.org/ns/docbook"> <chapter version="5.1" xml:id="start"> <title>Start</title> @@ -3107,10 +3107,10 @@ div.equation > p.title { language="xml"><book version="5.1" <co linkends="xmlc_cout_masterExample-1" xml:id="xmlc_cout_masterExample-1-co"/> - xmlns="http://docbook.org/ns/docbook" + xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"> <co linkends="xmlc_cout_masterExample-2" - xml:id="xmlc_cout_masterExample-2-co"/> + xml:id="xmlc_cout_masterExample-2-co"/> <xi:include href="start.xml" <co linkends="xmlc_cout_masterExample-3" xml:id="xmlc_cout_masterExample-3-co"/> xpointer="element(/1)"/> <co linkends="xmlc_cout_masterExample-4" @@ -3126,9 +3126,9 @@ div.equation > p.title { valign="top"><para><filename>start.xml</filename></para><programlisting language="xml"><chapter version="5.1" <coref linkend="xmlc_cout_masterExample-1-co"/> -xmlns="http://docbook.org/ns/docbook"> +xmlns="http://docbook.org/ns/docbook"> <title>Start</title> - <para>See + <para>See <xref linkend="intro"/>.</para> </chapter></programlisting></td> </tr> @@ -3138,7 +3138,7 @@ xmlns="http://docbook.org/ns/docbook"> valign="top"><para><filename>intro.xml</filename></para><programlisting language="xml"><chapter version="5.1" <coref linkend="xmlc_cout_masterExample-1-co"/> -xmlns="http://docbook.org/ns/docbook"> +xmlns="http://docbook.org/ns/docbook"> <title>Introduction</title> <para>Basic stuff.</para> </chapter></programlisting></td> @@ -3258,7 +3258,7 @@ xmlns="http://docbook.org/ns/docbook"> <td valign="top"><programlisting language="xml"><element name="aBook"> <zeroOrMore> <element name="person"> - <element name="fullName"> + <element name="fullName"> <text/> </element> <element name="email"> @@ -3271,7 +3271,7 @@ xmlns="http://docbook.org/ns/docbook"> <td valign="top"><programlisting language="xml"><aBook> <person> <fullName>Jim Bone</fullName> - <email>bone@mycity.com</email> + <email>bone@mycity.com</email> </person> </aBook></programlisting></td> </tr> @@ -3385,20 +3385,20 @@ xmlns="http://docbook.org/ns/docbook"> <filename>mybook.rng</filename>:</para> <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> -<grammar +<grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> <start> <ref name="d.book"/> </start> - + <define name="d.book"> <element name="book"> <text/> </element> </define> - + <emphasis role="bold"><!-- TODO: extend me accordingly ... --></emphasis> </grammar></programlisting> </question> @@ -3425,7 +3425,7 @@ xmlns="http://docbook.org/ns/docbook"> ... <chapter> <title>Introduction</title> - <para>First section.</para> + <para>First section.</para> </chapter> ... </book></programlisting></td> @@ -3433,7 +3433,7 @@ xmlns="http://docbook.org/ns/docbook"> <head>...</head> <body> <h1>Introduction</h1> - <p>First section.</p> ... + <p>First section.</p> ... </body> </html></programlisting></td> </tr> @@ -3451,7 +3451,7 @@ xmlns="http://docbook.org/ns/docbook"> <xsl:value-of select="title"/> </h1> </body> - </html> + </html> </xsl:template></programlisting> </figure> @@ -3463,11 +3463,11 @@ xmlns="http://docbook.org/ns/docbook"> <tr> <td rowspan="3"><programlisting language="xml"><xsl:template match="title"> <h1> - <xsl:value-of select="."/> - </h1> + <xsl:value-of select="."/> + </h1> </xsl:template></programlisting></td> - <td><programlisting language="xml"><title>Some content</title> </programlisting></td> + <td><programlisting language="xml"><title>Some content</title></programlisting></td> </tr> <tr> @@ -3475,7 +3475,7 @@ xmlns="http://docbook.org/ns/docbook"> </tr> <tr> - <td><programlisting language="xml"><h1>Some content</h1> </programlisting></td> + <td><programlisting language="xml"><h1>Some content</h1></programlisting></td> </tr> </informaltable> </figure> @@ -3506,8 +3506,8 @@ xmlns="http://docbook.org/ns/docbook"> <chapter> <title>General</title> <paragraph>Java is a programming language offering:</paragraph> - <itemizedlist> - + <itemizedlist> + <listitem> <paragraph>Procedural elements</paragraph> <itemizedlist> @@ -3528,7 +3528,7 @@ xmlns="http://docbook.org/ns/docbook"> <listitem> <paragraph>Functional elements</paragraph> </listitem> - + </itemizedlist> </chapter> <chapter> @@ -3550,7 +3550,7 @@ xmlns="http://docbook.org/ns/docbook"> xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0"> - + <xsl:output method="xml" indent="yes"/> <xsl:template match="/book"> <html> @@ -3566,19 +3566,19 @@ xmlns="http://docbook.org/ns/docbook"> <!-- See match="chapter" template below --> <xsl:apply-templates select="chapter"/> </body> - </html> + </html> </xsl:template> - + <xsl:template match="chapter"> <!-- TODO: Implement me! --> </xsl:template> - - - <!-- TODO: More templates have to be defined - addressing <title>, <paragraph>, ... + + + <!-- TODO: More templates have to be defined + addressing <title>, <paragraph>, ... --> - - + + <!-- Protecting against missing template definitions --> <xsl:template match="*"> <p style="color:red;"> @@ -3587,7 +3587,7 @@ xmlns="http://docbook.org/ns/docbook"> <xsl:text>'</xsl:text> </p> </xsl:template> - + </xsl:stylesheet></programlisting> </listitem> @@ -3600,7 +3600,7 @@ xmlns="http://docbook.org/ns/docbook"> <title>Introducing Java</title> </head> <body> - <h1>Introducing Java</h1> + <h1>Introducing Java</h1> </body> </html></programlisting> </listitem> @@ -3618,8 +3618,8 @@ xmlns="http://docbook.org/ns/docbook"> <h1>Introducing Java</h1> <h2>General</h2> <p>Java is a programming language offering:</p> - <ul> - + <ul> + <li> <p>Procedural elements</p> <ul> @@ -3640,9 +3640,9 @@ xmlns="http://docbook.org/ns/docbook"> <li> <p>Functional elements</p> </li> - + </ul> - + <h2>JDK</h2> <p>The Java developers kit (JDK) provides both a runtime environment and a compiler.</p> @@ -3687,7 +3687,7 @@ xmlns="http://docbook.org/ns/docbook"> <xsl:template match="paragraph"> ... </xsl:template> - + <!-- Non-default language --> <xsl:template match="paragraph[@lang]"> ... @@ -3771,7 +3771,7 @@ xmlns="http://docbook.org/ns/docbook"> <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> - + <fo:layout-master-set> <!-- Define a simple page layout --> <fo:simple-page-master master-name="simplePageLayout" @@ -3866,11 +3866,11 @@ xmlns="http://docbook.org/ns/docbook"> <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" - xmlns:fo="http://www.w3.org/1999/XSL/Format" + xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - + <xsl:output method="xml" indent="yes"/> - + <xsl:template match="/book"> <fo:root> <fo:layout-master-set> diff --git a/Doc/Tdoc/software.xml b/Doc/Tdoc/software.xml index efcd2fe7e..b78b3a5de 100644 --- a/Doc/Tdoc/software.xml +++ b/Doc/Tdoc/software.xml @@ -150,12 +150,12 @@ \makeindex</emphasis> \begin{document} \section{Introduction} -In this example several keywords\index{keywords} will be used +In this example several keywords\index{keywords} will be used which are important and deserve to appear in the Index\index{Index}. - -Terms like generate\index{generate} and some\index{others} will -also show up. - + +Terms like generate\index{generate} and some\index{others} will +also show up. + <emphasis role="bold">\printindex</emphasis> \end{document}</programlisting> </figure> -- GitLab