diff --git a/Klausuren/Sda1/2019summer/Doc/exam.xml b/Klausuren/Sda1/2019summer/Doc/exam.xml new file mode 100644 index 0000000000000000000000000000000000000000..70345f569a81b9488f4a8dd673625ff134cbddf0 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Doc/exam.xml @@ -0,0 +1,366 @@ +<?xml version="1.0" encoding="UTF-8"?> +<book version="5.0" xml:id="klausur_SoSe_2017" xml:lang="en" + xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes" + xmlns:xi="http://www.w3.org/2001/XInclude" + xmlns:trans="http://docbook.org/ns/transclusion" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:m="http://www.w3.org/1998/Math/MathML" + xmlns:html="http://www.w3.org/1999/xhtml" + xmlns:db="http://docbook.org/ns/docbook"> + <info> + <title/> + + <author> + <personname/> + </author> + + <pubdate/> + </info> + + <chapter xml:id="task1"> + <title>Articles and categories</title> + + <section xml:id="aufgabe1_prepare"> + <title>Preparations</title> + + <para>Download and unzip the above file <filename>exam.zip</filename>. + Then:</para> + + <orderedlist> + <listitem> + <para>Import the resulting <filename>Exam</filename> Project into + your <productname>IDEA</productname> IDE by choosing »File --> + Open...« subsequently selecting the + <filename>Exam/pom.xml</filename> file.</para> + </listitem> + + <listitem> + <para>Also import <filename>Exam</filename> into your + <productname>Oxygenxml</productname> IDE using »Project« --> + »Open Project« subsequently selecting the + <filename>Exam/sda1.xpr</filename> file.</para> + </listitem> + </orderedlist> + </section> + + <section xml:id="aufgabe1_descr"> + <title>Description</title> + + <para>Consider a catalog of categories and articles:</para> + + <programlisting language="xml"><catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="catalog.xsd" > + + <categories> + <category id="food">Food and drinking</category> + <category id="hardware">Tools, DIY</category> + <category id="lifestyle">Lifestyle products</category> + </categories> + + <articles> + <article orderNo="232434"> + <name>Super 3D Tin Lunch Box </name> + <cat>lifestyle</cat> + <cat>hardware</cat> + <img src="232434_1" type="png"/> + </article> + + <article orderNo="544343"> + <name>Monthly beer subscription box</name> + <cat>food</cat> + <description>Various brands and flavours on offer.</description> + </article> + + </articles> +</catalog></programlisting> + + <para>The following data integrity rules shall apply:</para> + + <orderedlist> + <listitem> + <para>Each <tag class="starttag">category</tag> has got an + <code>id</code> value being unique with respect to all + categories.</para> + </listitem> + + <listitem> + <para>Each <tag class="starttag">article</tag> carries a positive + integer <code>orderNo</code> attribute being unique with respect to + all articles.</para> + </listitem> + + <listitem> + <para>Each <tag class="starttag">article</tag> is being related to + at least one <tag class="starttag">category</tag> by means of <tag + class="starttag">cat</tag> references. In the given sample the + «Monthly beer subscription box» relates to the «Food and drinking» + category.</para> + </listitem> + + <listitem> + <para>An <tag class="starttag">article</tag> may have one <tag + class="starttag">description</tag> and one <tag + class="starttag">img</tag> element in that order.</para> + </listitem> + + <listitem> + <para>The attributes <code>src</code> and <code>type</code> of <tag + class="starttag">img</tag> are mandatory. The attribute + <code>type</code> is being restricted to the set {<code>gif</code>, + <code>png</code>, <code>svg</code>}.</para> + </listitem> + </orderedlist> + </section> + + <section xml:id="aufgabe1_task"> + <title>Tasks</title> + + <para>Complete your schema's implementation in + <filename>Schema/catalog.xsd</filename> using the + <productname>Oxygenxml</productname> IDE. Hints:</para> + + <orderedlist> + <listitem> + <para>The folder <filename>SchemaTest</filename> contains sample + files testing your schema's correctness.</para> + </listitem> + + <listitem> + <para><productname>Junit</productname> execution of + <classname>de.hdm_stuttgart.mi.sda1.test.ex1.SchemaTest</classname> + from within IntelliJ executes all unit tests based on files residing + in your project's folder <filename>SchemaTest</filename>. Some of + these files, e.g. + <filename>SchemaTest/0101_missingArticles.xml</filename>, contain + comment hints regarding expected errors with respect to the intended + <filename>Schema/catalog.xsd</filename>.</para> + + <programlisting language="xml"> ... <!-- Expected error: <articles > absent -->...</programlisting> + + <para>Clicking on file names within test failure reports will open + e.g. <filename>SchemaTest/0101_missingArticles.xml</filename> in + <productname>IDEA</productname>. However opening the same file in + <productname>Oxygenxml</productname> will likely save time anyway + due to better <abbrev>XML</abbrev> support.</para> + </listitem> + + <listitem> + <para><emphasis role="red">Never</emphasis> touch your project's + unit tests in the <filename>SchemaTest</filename> folder: The + automated tests may end up throwing meaningless exceptions.</para> + </listitem> + + <listitem> + <para>Edit <filename>Schema/catalog.xsd</filename> only by small + steps executing the tests immediately. Schema changes may cause + already working tests to fail again. In case of spoiling your schema + <quote>undo</quote> is your friend.</para> + </listitem> + </orderedlist> + + <tip> + <itemizedlist> + <listitem> + <para>XPath uses the dot (.) for selecting an element's content + e.g. "<emphasis role="red">food</emphasis>" from <tag + class="starttag">cat</tag><emphasis role="red">food</emphasis><tag + class="endtag">cat</tag> .</para> + </listitem> + + <listitem> + <para>Choose appropriate <abbrev>XSD</abbrev> standard types + rather than defining own types by restriction.</para> + </listitem> + </itemizedlist> + </tip> + </section> + + <section version="5.1" xml:id="uploadFirst"> + <title>Project upload</title> + + <para>Export your project by hitting »File« --> »Export to Zip File« + in IDEA creating an <abbrev>e.g.</abbrev> + <filename>solution-1.zip</filename> file. Then enter your + <productname>ILIAS</productname> browser, hit the <quote>choose + file</quote> button selecting <filename>solution-1.zip</filename> and + subsequently click <quote>upload</quote>. Do not forget to advance to + the next question for actually saving your upload. Common + pitfalls:</para> + + <itemizedlist> + <listitem> + <para>Do not select the wrong archive! In particular avoid choosing + the original <filename>exam.zip</filename> skeleton.</para> + </listitem> + + <listitem> + <para>After uploading check for <filename>solution_1.zip</filename> + being visible in the examination system.</para> + </listitem> + + <listitem> + <para>You may upload multiple versions i.e. + <filename>solution_2.zip</filename> etc. . Only your least uploaded + archive will become subject to marking.</para> + </listitem> + </itemizedlist> + </section> + + <section xml:id="examCaveats"> + <title>Caveats</title> + + <itemizedlist> + <listitem> + <para>When approaching examination ending time check your input for + completeness.</para> + </listitem> + + <listitem> + <para>Projects residing just on your local workstation cannot be + recovered after exam termination.</para> + </listitem> + </itemizedlist> + </section> + </chapter> + + <chapter xml:id="task2"> + <title>Relational representation of <tag class="starttag">catalog</tag> + documents</title> + + <section xml:id="task2_prepare"> + <title>Preparation</title> + + <para>If you already started the first task just continue working on + your project using IntelliJ. Otherwise read the first task regarding the + skeleton project import.</para> + + <para>Hint: A global database connection is configured on IDEA + level.</para> + </section> + + <section xml:id="task2_descr"> + <title>Description</title> + + <para>Extend the relational schema skeleton + <filename>Schema/schema.sq</filename>l preparing your RDBMS to import + <tag class="starttag">catalog</tag> instances.</para> + </section> + + <section xml:id="task2_tasks"> + <title>Tasks</title> + + <para>Extend your project's incomplete + <filename>Schema/schema.sql</filename> file yet containing only + <code>INSERT</code> but no <code>CREATE TABLE</code> statements. Try to + map the given <tag class="starttag">catalog</tag> integrity constraints + as closely as possible. Use <code>CHECK(...)</code> constraints where + appropriate.</para> + + <tip> + <itemizedlist> + <listitem> + <para>In presence of an image both its name and type must + <emphasis role="red">not</emphasis> be <code>NULL</code>.</para> + </listitem> + + <listitem> + <para>In absence of an image both its name and type must be + <code>NULL</code>.</para> + </listitem> + </itemizedlist> + </tip> + </section> + + <section version="5.1" xml:id="uploadFollow"> + <title>Solution upload</title> + + <para>Upload your project using the previous task. Then enter «I'm + expecting points for my work on the current task» into the text + field.</para> + </section> + </chapter> + + <chapter xml:id="task3"> + <title>Import XML instances into RDBMS</title> + + <section xml:id="task3_prepare"> + <title>Preparation</title> + + <para>If you already started the first task just continue working on + your project using IntelliJ. Otherwise read the first task regarding the + skeleton project import.</para> + </section> + + <section xml:id="task3_descr"> + <title>Description</title> + + <para>Write a Java application reading <tag + class="starttag">catalog</tag> document instances and writing the + <abbrev>XML</abbrev> content to a relational database. Hints:</para> + + <itemizedlist> + <listitem> + <para><package>de.hdm_stuttgart.mi.sda1</package>.<classname>Category2Rdbms</classname> + contains <abbrev>JDBC</abbrev> related connection parameters and + boilerplate code.</para> + </listitem> + + <listitem> + <para>Upon invocation class + <package>de.hdm_stuttgart.mi.sda1</package>.<classname>Driver</classname> + instantiates + <package>de.hdm_stuttgart.mi.sda1</package>.<classname>Category2Rdbms</classname> + thereby:</para> + + <itemizedlist> + <listitem> + <para>Reading and parsing + <filename>Schema/sampledata.xml</filename>.</para> + </listitem> + + <listitem> + <para>Open a database connection to your local PostgreSQL + server.</para> + </listitem> + </itemizedlist> + </listitem> + </itemizedlist> + </section> + + <section xml:id="task3_tasks"> + <title>Tasks</title> + + <para>Insert data from <filename>Schema/sampledata.xml</filename> into + your local database. Use your schema from the second task.</para> + </section> + + <section xml:id="task3_hints"> + <title>Hints</title> + + <para>Even if your application <abbrev>e.g.</abbrev> just fills in + category data you'll receive points. Also partly completed but not fully + working code may contribute.</para> + </section> + + <section version="5.1" xml:id="task3_upload"> + <title>Solution upload</title> + + <para>Upload your project using the first task. Enter either of the + following two texts:</para> + + <itemizedlist> + <listitem> + <para>I'm expecting points for my work on the current task.</para> + </listitem> + + <listitem> + <para>I did not work on this task.</para> + </listitem> + </itemizedlist> + + <para>You may as well add other marking related comments.</para> + </section> + </chapter> +</book> diff --git a/Klausuren/Sda1/2019summer/Exam/.gitignore b/Klausuren/Sda1/2019summer/Exam/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..a2fa20469808363ab656f8206d63c6b2e92a83b8 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/.gitignore @@ -0,0 +1,5 @@ +/.classpath +/.project +/.settings +/.idea +/*.iml diff --git a/Klausuren/Sda1/2019summer/Exam/Schema/catalog.xsd b/Klausuren/Sda1/2019summer/Exam/Schema/catalog.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a4e367706f23fa423245c95e48b48e40a13040fd --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/Schema/catalog.xsd @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > + + <!-- TODO: define required elements --> + +</xs:schema> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/Schema/sampledata.xml b/Klausuren/Sda1/2019summer/Exam/Schema/sampledata.xml new file mode 100644 index 0000000000000000000000000000000000000000..b92ebffe4703f086bfec6568b7ef1506f13eab3c --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/Schema/sampledata.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="catalog.xsd" > + + <categories> + <category id="food">Food and drinking</category> + <category id="hardware">Tools, DIY</category> + <category id="lifestyle">Lifestyle products</category> + </categories> + + <articles> + <article orderNo="232434"> + <name>Super 3D Tin Lunch Box </name> + <cat>lifestyle</cat> + <cat>hardware</cat> + <img src="232434_1" type="png"/> + </article> + + <article orderNo="544343"> + <name>Monthly beer subscription box</name> + <cat>food</cat> + <description>Various brands and flavours on offer.</description> + </article> + + </articles> +</catalog> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/Schema/schema.sql b/Klausuren/Sda1/2019summer/Exam/Schema/schema.sql new file mode 100644 index 0000000000000000000000000000000000000000..f04d53b7f724aeeb942ced897e8eedc211d81265 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/Schema/schema.sql @@ -0,0 +1,33 @@ +DROP TABLE IF EXISTS Foo; + + +CREATE TABLE ... /* TODO: Create schema closely resembling catalog.xsd integrity rules */ + /* sample data below may be used for checking your schema's consistence */ + +/* Inserting categories */ +INSERT INTO Category +VALUES ('food', 'Food and drinking'); + +INSERT INTO Category +VALUES ('hardware', 'Tools, DIY'); + +INSERT INTO Category +VALUES ('lifestyle', 'Lifestyle products'); + + +/* Inserting articles */ +INSERT INTO Article +VALUES (232434, 'Super 3D Tin Lunch Box', NULL, '232434_1', 'png'); + +INSERT INTO Article +VALUES (544343, 'Monthly beer subscription box', 'Various brands and flavours on offer.', NULL, NULL); + +/* Relating categories and articles */ +INSERT INTO Category2Article +VALUES ('lifestyle', 232434); + +INSERT INTO Category2Article +VALUES ('hardware', 232434); + +INSERT INTO Category2Article +VALUES ('food', 544343); \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0100validMinimum.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0100validMinimum.xml new file mode 100644 index 0000000000000000000000000000000000000000..6f7f968084ab2e06e660e7781aa01f850b676126 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0100validMinimum.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories/> + <articles/> + +</catalog> + +<?xmlTest + points = "1" + expectedToBeValid = "true" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0101_duplicateArticles.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0101_duplicateArticles.xml new file mode 100644 index 0000000000000000000000000000000000000000..74d24de4ae9d440e73107973d05827102849240d --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0101_duplicateArticles.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories/> + <articles/> + <articles/> <!-- Expected error: More than one <articles > element --> + +</catalog> + +<?xmlTest + points = "1" + expectedToBeValid = "false" + preconditionValid = "0100validMinimum.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0101_duplicateCategories.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0101_duplicateCategories.xml new file mode 100644 index 0000000000000000000000000000000000000000..2e259fe17f2602c1468404b693749b31501b217e --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0101_duplicateCategories.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories/> + + <categories/> <!-- Expected error: More than one <categories> element --> + + <articles/> + +</catalog> + +<?xmlTest + points = "1" + expectedToBeValid = "false" + preconditionValid = "0100validMinimum.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0101_missingArticles.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0101_missingArticles.xml new file mode 100644 index 0000000000000000000000000000000000000000..8993f1b027f167fdb9ed640e15f1e4d8204cd5b6 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0101_missingArticles.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + + <categories/> + <!-- Expected error: <articles > absent --> + +</catalog> + +<?xmlTest + points = "1" + expectedToBeValid = "false" + preconditionValid = "0100validMinimum.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0101_missingCategories.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0101_missingCategories.xml new file mode 100644 index 0000000000000000000000000000000000000000..a13177a5763b273df1dbfd74a4e1f045c49ea12d --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0101_missingCategories.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <!-- Expected error: <categories> absent --> + <articles/> + + +</catalog> + +<?xmlTest + points = "1" + expectedToBeValid = "false" + preconditionValid = "0100validMinimum.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0110validSingleCategory.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0110validSingleCategory.xml new file mode 100644 index 0000000000000000000000000000000000000000..268bbbe37335bdb180d5a386e6504920f4ca6acb --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0110validSingleCategory.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id="x">X category</category> + </categories> + <articles/> + +</catalog> + +<?xmlTest + points = "1" + expectedToBeValid = "true" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0111_invalid_EmptyIdValue.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0111_invalid_EmptyIdValue.xml new file mode 100644 index 0000000000000000000000000000000000000000..c87027be3f5e7531d34c2bfd27a50891373dbf56 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0111_invalid_EmptyIdValue.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id=""> <!-- Expected error: Attribue id value must not be empty --> + X category</category> + </categories> + <articles/> + +</catalog> + +<?xmlTest + points = "2" + expectedToBeValid = "false" + preconditionValid = "0110validSingleCategory.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0111_invalid_missing_id.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0111_invalid_missing_id.xml new file mode 100644 index 0000000000000000000000000000000000000000..29cffb83e44fd531ffe838ed8d9a5269d825575e --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0111_invalid_missing_id.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category> <!-- Expected error: Missing id attribute --> + X category</category> + </categories> + <articles/> + +</catalog> + + +<?xmlTest + points = "2" + expectedToBeValid = "false" + preconditionValid = "0110validSingleCategory.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0111_invalid_whitespaceInId.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0111_invalid_whitespaceInId.xml new file mode 100644 index 0000000000000000000000000000000000000000..7cbddbe4dfaae44f2ebe919f1bd013c3a2dba77d --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0111_invalid_whitespaceInId.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id="red green"> <!-- Expected error: Attribute must not contain whitespace characters --> + X category</category> + </categories> + <articles/> + +</catalog> + + +<?xmlTest + points = "1" + expectedToBeValid = "false" + preconditionValid = "0110validSingleCategory.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0120validMultiCategory.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0120validMultiCategory.xml new file mode 100644 index 0000000000000000000000000000000000000000..57c03d143f10627a53265590f043fbe87c7948fc --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0120validMultiCategory.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id="x">X category</category> + <category id="y">Y category</category> + </categories> + <articles/> + +</catalog> + +<?xmlTest + points = "1" + expectedToBeValid = "true" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0121_invalidDuplicateCategoryId.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0121_invalidDuplicateCategoryId.xml new file mode 100644 index 0000000000000000000000000000000000000000..a78253ac0cde11499e6cc7f53f44fc183d40d5ab --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0121_invalidDuplicateCategoryId.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id="x">X category</category> + + <category id="x"> <!-- Expected error: Duplicate id attribute value --> + X category, identical id value</category> + </categories> + <articles/> + +</catalog> + +<?xmlTest + points = "2" + expectedToBeValid = "false" + preconditionValid = "0120validMultiCategory.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0150validMinimumArticle.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0150validMinimumArticle.xml new file mode 100644 index 0000000000000000000000000000000000000000..d753cba1853a11f4066ac3858e2e83e0782d77cc --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0150validMinimumArticle.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id="food">Food and drinking</category> + </categories> + + <articles> + <article orderNo="544343"> + <name>Monthly beer subscription box</name> + <cat>food</cat> + </article> + </articles> + +</catalog> + +<?xmlTest + points = "1" + expectedToBeValid = "true" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0151_invalidMissingOrderNo.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0151_invalidMissingOrderNo.xml new file mode 100644 index 0000000000000000000000000000000000000000..6af644cb63ead3ce39d7dbcac6abfaeb6c3ae55b --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0151_invalidMissingOrderNo.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id="food">Food and drinking</category> + </categories> + + <articles> + <article> <!-- Expected error: Missing orderNo attribute --> + <name>Monthly beer subscription box</name> + <cat>food</cat> + </article> + </articles> + +</catalog> + +<?xmlTest + points = "2" + expectedToBeValid = "false" + preconditionValid = "0150validMinimumArticle.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0151_invalidNegativeOrderNo.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0151_invalidNegativeOrderNo.xml new file mode 100644 index 0000000000000000000000000000000000000000..f5eacedf930f9f275f9dcf1c59ddd9877cf6b951 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0151_invalidNegativeOrderNo.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id="food">Food and drinking</category> + </categories> + + <articles> + <article orderNo="0"> <!-- Expected error: Positive orderNo attribute value required --> + <name>Monthly beer subscription box</name> + <cat>food</cat> + </article> + </articles> + +</catalog> + +<?xmlTest + points = "1" + expectedToBeValid = "false" + preconditionValid = "0150validMinimumArticle.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0151_invalidZeroOrderNo.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0151_invalidZeroOrderNo.xml new file mode 100644 index 0000000000000000000000000000000000000000..4a6d8628d82a94d969644f92a0119ae56f1a672c --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0151_invalidZeroOrderNo.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id="food">Food and drinking</category> + </categories> + + <articles> + <article orderNo="-123"> <!-- Expected error: Negative orderNo attribute value--> + <name>Monthly beer subscription box</name> + <cat>food</cat> + </article> + </articles> + +</catalog> + +<?xmlTest + points = "1" + expectedToBeValid = "false" + preconditionValid = "0150validMinimumArticle.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0160validFullArticle.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0160validFullArticle.xml new file mode 100644 index 0000000000000000000000000000000000000000..17fcd2509f3d1212b72943fc46aab2db714205cb --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0160validFullArticle.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id="food">Food and drinking</category> + </categories> + + <articles> + <article orderNo="544343"> + <name>Monthly beer subscription box</name> + <cat>food</cat> + <description>Enjoy your party!</description> + <img src="box" type="svg"/> + </article> + </articles> + +</catalog> + +<?xmlTest + points = "1" + expectedToBeValid = "true" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0161_invalidDuplicateDescription.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0161_invalidDuplicateDescription.xml new file mode 100644 index 0000000000000000000000000000000000000000..ad10f63fcd9e61611416caca2253a62b8774744f --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0161_invalidDuplicateDescription.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id="food">Food and drinking</category> + </categories> + + <articles> + <article orderNo="544343"> + <name>Monthly beer subscription box</name> + <cat>food</cat> + <description>Enjoy your party!</description> + <description>Once more ... <!-- Expected error: Duplicate <description> --> + </description> + <img src="box" type="png"/> + </article> + </articles> + +</catalog> + +<?xmlTest + points = "1" + expectedToBeValid = "false" + preconditionValid = "0160validFullArticle.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0161_invalidMissingSource.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0161_invalidMissingSource.xml new file mode 100644 index 0000000000000000000000000000000000000000..dc8482c9d128d70b057ea3a8245c4bed77778bbe --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0161_invalidMissingSource.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id="food">Food and drinking</category> + </categories> + + <articles> + <article orderNo="544343"> + <name>Monthly beer subscription box</name> + <cat>food</cat> + <description>Enjoy your party!</description> + <img type="png"/> <!-- Expected error: Missing src attribute --> + </article> + </articles> + +</catalog> + +<?xmlTest + points = "2" + expectedToBeValid = "false" + preconditionValid = "0160validFullArticle.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0161_invalidMissingType.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0161_invalidMissingType.xml new file mode 100644 index 0000000000000000000000000000000000000000..f670fce145bd6c46c6a98b9f07701536efff3be2 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0161_invalidMissingType.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id="food">Food and drinking</category> + </categories> + + <articles> + <article orderNo="544343"> + <name>Monthly beer subscription box</name> + <cat>food</cat> + <description>Enjoy your party!</description> + <img src="box"/> <!-- Expected error: Missing type attribute --> + </article> + </articles> + +</catalog> + +<?xmlTest + points = "1" + expectedToBeValid = "false" + preconditionValid = "0160validFullArticle.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0161_invalidWrongImgType.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0161_invalidWrongImgType.xml new file mode 100644 index 0000000000000000000000000000000000000000..7bed4322a2bdea5dd86f81ae114c6a1fd9155715 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0161_invalidWrongImgType.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id="food">Food and drinking</category> + </categories> + + <articles> + <article orderNo="544343"> + <name>Monthly beer subscription box</name> + <cat>food</cat> + <description>Enjoy your party!</description> + <img src="box" type="ico"/> <!-- Expected error: Invalid image type "ico" --> + </article> + </articles> + +</catalog> + +<?xmlTest + points = "1" + expectedToBeValid = "false" + preconditionValid = "0160validFullArticle.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/02001_invalidDanglingReference.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/02001_invalidDanglingReference.xml new file mode 100644 index 0000000000000000000000000000000000000000..a7a179c98cd9f7247dee02be2114e80096daadb2 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/02001_invalidDanglingReference.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id="food">Food and drinking</category> + <category id="hardware">Tools, DIY</category> + <category id="lifestyle">Lifestyle products</category> + </categories> + + <articles> + <article orderNo="232434"> + <name>Super 3D Tin Lunch Box </name> + <cat>bogus</cat> <!-- Expected error: Reference to inexistent category id "bogus" --> + </article> + </articles> + +</catalog> + +<?xmlTest + points = "2" + expectedToBeValid = "false" + preconditionValid = "0200validTwoArticles.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/02001_invalidDuplicateCat.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/02001_invalidDuplicateCat.xml new file mode 100644 index 0000000000000000000000000000000000000000..3228e1664eac56535f62e0ffc444b2b8bab56680 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/02001_invalidDuplicateCat.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id="food">Food and drinking</category> + <category id="hardware">Tools, DIY</category> + <category id="lifestyle">Lifestyle products</category> + </categories> + + <articles> + <article orderNo="232434"> + <name>Super 3D Tin Lunch Box </name> + <cat>food</cat> + <cat>hardware</cat> + <cat>food</cat> <!-- Expected error: Duplicate category reference "food" --> + </article> + </articles> + +</catalog> + +<?xmlTest + points = "1" + expectedToBeValid = "false" + preconditionValid = "0200validTwoArticles.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/02001_invalidMissingCatRef.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/02001_invalidMissingCatRef.xml new file mode 100644 index 0000000000000000000000000000000000000000..1514f711e6d3421018c910a92f04a424bc588fa4 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/02001_invalidMissingCatRef.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id="food">Food and drinking</category> + <category id="hardware">Tools, DIY</category> + <category id="lifestyle">Lifestyle products</category> + </categories> + + <articles> + <article orderNo="232434"> + <name>Super 3D Tin Lunch Box </name> + <!-- Expected error: Missing <cat ...> reference --> + </article> + + </articles> + +</catalog> + +<?xmlTest + points = "1" + expectedToBeValid = "false" + preconditionValid = "0200validTwoArticles.xml" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/SchemaTest/0200validTwoArticles.xml b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0200validTwoArticles.xml new file mode 100644 index 0000000000000000000000000000000000000000..8ab82158b0d236f6e27a2b58a8fc57b540954c81 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/SchemaTest/0200validTwoArticles.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" > + + <categories> + <category id="food">Food and drinking</category> + <category id="hardware">Tools, DIY</category> + <category id="lifestyle">Lifestyle products</category> + </categories> + + <articles> + <article orderNo="232434"> + <name>Super 3D Tin Lunch Box </name> + <cat>lifestyle</cat> + <cat>hardware</cat> + <img src="232434_1" type="png"/> + </article> + + <article orderNo="544343"> + <name>Monthly beer subscription box</name> + <cat>food</cat> + <description>Various brands and flavours on offer.</description> + </article> + </articles> + +</catalog> + +<?xmlTest + points = "1" + expectedToBeValid = "true" +?> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/pom.xml b/Klausuren/Sda1/2019summer/Exam/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..5376b097de90117b5421dce217761192132adaf9 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/pom.xml @@ -0,0 +1,174 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>de.hdm_stuttgart.mi.sda1</groupId> + <artifactId>sda1_summer2019_exam</artifactId> + <version>0.9</version> + <packaging>jar</packaging> + + <name>sda1_summer2019_exam</name> + + <url>https://freedocs.mi.hdm-stuttgart.de/sd1_sect_mavenCli.html</url> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <oxygenxml.version>21.1.0.0</oxygenxml.version> + </properties> + + <repositories> + + <repository> + <id>hdm-mi-internal-maven-repo</id> + <url>https://maven.mi.hdm-stuttgart.de/nexus/repository/mi-maven</url> + </repository> + <repository> + <id>oxygenxml-repo</id> + <url>https://maven.mi.hdm-stuttgart.de/nexus/repository/oxygen</url> + </repository> + </repositories> + + <dependencies> + + <dependency> + <groupId>com.oxygenxml</groupId> + <artifactId>oxygen-patched-xerces</artifactId> + <version>${oxygenxml.version}</version> + </dependency> + + <dependency> + <groupId>com.oxygenxml</groupId> + <artifactId>oxygen</artifactId> + <version>${oxygenxml.version}</version> + </dependency> + + <!-- Still needed to keep oxygenxml happy using legacy logging --> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.17</version> + </dependency> + + <dependency> + <groupId>com.rackspace.eclipse.webtools.sourceediting</groupId> + <artifactId>org.eclipse.wst.xml.xpath2.processor</artifactId> + <version>2.1.100</version> + </dependency> + + <dependency> + <groupId>org.postgresql</groupId> + <artifactId>postgresql</artifactId> + <version>42.2.6</version> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-core</artifactId> + <version>2.12.0</version> + </dependency> + + <dependency> + <groupId>javax.xml.bind</groupId> + <artifactId>jaxb-api</artifactId> + <version>2.3.1</version> + </dependency> + + <!-- Required for executable jar generation to avoid ClassNotFoundException: + com.fasterxml.jackson.core.type.TypeReference and similar dependency problems. --> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> + <version>2.9.8</version> + </dependency> + + <dependency> + <groupId>org.jdom</groupId> + <artifactId>jdom2</artifactId> + <version>2.0.6</version> + </dependency> + + <dependency> + <groupId>jaxen</groupId> + <artifactId>jaxen</artifactId> + <version>1.1.6</version> + </dependency> + + <dependency> + <groupId>de.hdm_stuttgart.mi.exam</groupId> + <artifactId>unitmarking</artifactId> + <version>1.0</version> + </dependency> + + </dependencies> + + <build> + + <plugins> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.8.1</version> + <configuration> + <source>11</source> + <target>11</target> + <compilerArgument>-proc:none</compilerArgument> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.1.1</version> + <configuration> + <javaApiLinks> + <property> + <name>api_11</name> + <value>https://klausur.mi.hdm-stuttgart.de/doc/openjdk-11-doc/api/</value> + </property> + </javaApiLinks> + + <stylesheetfile>localstyles.css</stylesheetfile> + + <additionalJOptions> + <additionalJOption>-html5</additionalJOption> + </additionalJOptions> + <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable> + </configuration> + </plugin> + + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <version>3.1.1</version> + <configuration> + <descriptors> + <descriptor>src/main/assembly/assembly.xml</descriptor> + </descriptors> + </configuration> + <executions> + <execution> + <id>make-assembly</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <archive> + <manifest> + <mainClass>de.hdm_stuttgart.mi.sda1.test.ex1.ShowReachedPoints</mainClass> + </manifest> + </archive> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/Klausuren/Sda1/2019summer/Exam/sda1.xpr b/Klausuren/Sda1/2019summer/Exam/sda1.xpr new file mode 100644 index 0000000000000000000000000000000000000000..61f17753fecef966b354beff225b3ebe5375dab3 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/sda1.xpr @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="20.1"> + <meta> + <filters directoryPatterns="" filePatterns="" positiveFilePatterns="" showHiddenFiles="false"/> + <options/> + </meta> + <projectTree name="sda1.xpr"> + <folder path="."/> + </projectTree> +</project> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/src/main/assembly/assembly.xml b/Klausuren/Sda1/2019summer/Exam/src/main/assembly/assembly.xml new file mode 100644 index 0000000000000000000000000000000000000000..59dcf95acfa6e968365fa77e16bb08ac95a75559 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/src/main/assembly/assembly.xml @@ -0,0 +1,36 @@ +<assembly + xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> + <id>fat-tests</id> + <formats> + <format>jar</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <dependencySets> + <dependencySet> + <outputDirectory></outputDirectory> + <useProjectArtifact>true</useProjectArtifact> + <unpack>true</unpack> + <scope>test</scope> + </dependencySet> + </dependencySets> + <fileSets> + <fileSet> + <directory>${project.build.directory}/test-classes</directory> + <outputDirectory></outputDirectory> + <includes> + <include>**/*.class</include> + </includes> + <useDefaultExcludes>true</useDefaultExcludes> + </fileSet> + <fileSet> + <directory>${project.build.directory}/classes</directory> + <outputDirectory></outputDirectory> + <includes> + <include>**/*.class</include> + </includes> + <useDefaultExcludes>true</useDefaultExcludes> + </fileSet> + </fileSets> +</assembly> diff --git a/Klausuren/Sda1/2019summer/Exam/src/main/java/de/hdm_stuttgart/mi/sda1/Category2Rdbms.java b/Klausuren/Sda1/2019summer/Exam/src/main/java/de/hdm_stuttgart/mi/sda1/Category2Rdbms.java new file mode 100644 index 0000000000000000000000000000000000000000..42d91b0bfa8ac072819e2f93a5fd838960972c7c --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/src/main/java/de/hdm_stuttgart/mi/sda1/Category2Rdbms.java @@ -0,0 +1,61 @@ +package de.hdm_stuttgart.mi.sda1; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jdom2.*; +import org.jdom2.input.SAXBuilder; + +import java.io.File; +import java.io.IOException; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; + +public class Category2Rdbms implements AutoCloseable { + + static private final Logger log = LogManager.getLogger(Category2Rdbms.class); + + private Connection conn; + + private Element catalog; + + public Category2Rdbms() { + try { + conn = DriverManager.getConnection( + "jdbc:postgresql://localhost/hdm", "hdmuser", "XYZ"); + log.info("Database connected? " + ! conn.isClosed()); + } catch (final SQLException e) { + log.error("Unable to establish connection, exiting", e); + System.exit(1); + } + + + final SAXBuilder builder = new SAXBuilder(); + try { + catalog = builder.build(new File("Schema/sampledata.xml")).getRootElement(); + } catch (final JDOMException e) { + log.error("Unable to parse input, exiting", e); + System.exit(1); + } catch (final IOException e) { + log.error("Unable to read input, exiting", e); + System.exit(1); + } + } + + public void execute() { + log.info("Processing XML input file, producing sample output"); + catalog.getChild("categories"). + getChildren("category"). + stream().map(c -> c.getValue()). + forEach(System.out::println); + } + + @Override + public void close() { + try { + conn.close(); + } catch (final SQLException e) { + e.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/src/main/java/de/hdm_stuttgart/mi/sda1/Driver.java b/Klausuren/Sda1/2019summer/Exam/src/main/java/de/hdm_stuttgart/mi/sda1/Driver.java new file mode 100644 index 0000000000000000000000000000000000000000..844064c315048cd3b2ff35e9a978342484587eef --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/src/main/java/de/hdm_stuttgart/mi/sda1/Driver.java @@ -0,0 +1,11 @@ +package de.hdm_stuttgart.mi.sda1; + +public class Driver { + + public static void main(String[] args) { + + try (final Category2Rdbms category2Rdbms = new Category2Rdbms()) { + category2Rdbms.execute(); + } + } +} \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/src/main/javadoc/localstyles.css b/Klausuren/Sda1/2019summer/Exam/src/main/javadoc/localstyles.css new file mode 100644 index 0000000000000000000000000000000000000000..89340880d2a8a21714da54bd2ce82777d41d4e5c --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/src/main/javadoc/localstyles.css @@ -0,0 +1,927 @@ +/* + * Javadoc style sheet + */ + +/* + * Styles for individual HTML elements. + * + * These are styles that are specific to individual HTML elements. Changing them affects the style of a particular + * HTML element throughout the page. + */ + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; + padding:0; + height:100%; + width:100%; +} +iframe { + margin:0; + padding:0; + height:100%; + width:100%; + overflow-y:scroll; + border:none; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a[href]:hover, a[href]:focus { + text-decoration:none; + color:#bb7a2a; +} +a[name] { + color:#353833; +} +a[name]:before, a[name]:target, a[id]:before, a[id]:target { + content:""; + display:inline-block; + position:relative; + padding-top:129px; + margin-top:-129px; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} + +/* + * Styles for HTML generated by javadoc. + * + * These are style classes that are used by the standard doclet to generate HTML documentation. + */ + +/* + * Styles for document title and copyright. + */ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* + * Styles for navigation bar. + */ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.navPadding { + padding-top: 107px; +} +.fixedNav { + position:fixed; + width:100%; + z-index:999; + background-color:#ffffff; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.navListSearch { + float:right; + margin:0 0 0 0; + padding:0; +} +ul.navListSearch li { + list-style:none; + float:right; + padding: 5px 6px; + text-transform:uppercase; +} +ul.navListSearch li label { + position:relative; + right:-16px; +} +ul.subNavList li { + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* + * Styles for page header and footer. + */ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexNav { + position:relative; + font-size:12px; + background-color:#dee3e9; +} +.indexNav ul { + margin-top:0; + padding:5px; +} +.indexNav ul li { + display:inline; + list-style-type:none; + padding-right:10px; + text-transform:uppercase; +} +.indexNav h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* + * Styles for headings. + */ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* + * Styles for page layout containers. + */ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer, +.allClassesContainer, .allPackagesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* + * Styles for lists. + */ +li.circle { + list-style:circle; +} +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* + * Styles for tables. + */ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary, +.requiresSummary, .packagesSummary, .providesSummary, .usesSummary { + width:100%; + border-spacing:0; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary, .requiresSummary, .packagesSummary, .providesSummary, .usesSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption, +.requiresSummary caption, .packagesSummary caption, .providesSummary caption, .usesSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.constantsSummary caption a:link, .deprecatedSummary caption a:link, +.requiresSummary caption a:link, .packagesSummary caption a:link, .providesSummary caption a:link, +.usesSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.requiresSummary caption a:hover, .packagesSummary caption a:hover, .providesSummary caption a:hover, +.usesSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.constantsSummary caption a:active, .deprecatedSummary caption a:active, +.requiresSummary caption a:active, .packagesSummary caption a:active, .providesSummary caption a:active, +.usesSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.constantsSummary caption a:visited, .deprecatedSummary caption a:visited, +.requiresSummary caption a:visited, .packagesSummary caption a:visited, .providesSummary caption a:visited, +.usesSummary caption a:visited { + color:#FFFFFF; +} +.useSummary caption a:link, .useSummary caption a:hover, .useSummary caption a:active, +.useSummary caption a:visited { + color:#1f389c; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span, +.requiresSummary caption span, .packagesSummary caption span, .providesSummary caption span, +.usesSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span, .packagesSummary caption span.activeTableTab span, +.overviewSummary caption span.activeTableTab span, .typeSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span, .packagesSummary caption span.tableTab span, +.overviewSummary caption span.tableTab span, .typeSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab, +.packagesSummary caption span.tableTab, .packagesSummary caption span.activeTableTab, +.overviewSummary caption span.tableTab, .overviewSummary caption span.activeTableTab, +.typeSummary caption span.tableTab, .typeSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd, +.requiresSummary .tabEnd, .packagesSummary .tabEnd, .providesSummary .tabEnd, .usesSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd, .packagesSummary .activeTableTab .tabEnd, +.overviewSummary .activeTableTab .tabEnd, .typeSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd, .packagesSummary .tableTab .tabEnd, +.overviewSummary .tableTab .tabEnd, .typeSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; +} +.rowColor th, .altColor th { + font-weight:normal; +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td, +.requiresSummary td, .packagesSummary td, .providesSummary td, .usesSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colFirst, th.colSecond, th.colLast, th.colConstructorName, th.colDeprecatedItemName, .useSummary th, +.constantsSummary th, .packagesSummary th, td.colFirst, td.colSecond, td.colLast, .useSummary td, +.constantsSummary td { + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colSecond, th.colLast, th.colConstructorName, th.colDeprecatedItemName, .constantsSummary th, +.packagesSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + font-size:13px; +} +td.colSecond, th.colSecond, td.colLast, th.colConstructorName, th.colDeprecatedItemName, th.colLast { + font-size:13px; +} +.constantsSummary th, .packagesSummary th { + font-size:13px; +} +.providesSummary th.colFirst, .providesSummary th.colLast, .providesSummary td.colFirst, +.providesSummary td.colLast { + white-space:normal; + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.requiresSummary td.colFirst, .requiresSummary th.colFirst, +.packagesSummary td.colFirst, .packagesSummary td.colSecond, .packagesSummary th.colFirst, .packagesSummary th, +.usesSummary td.colFirst, .usesSummary th.colFirst, +.providesSummary td.colFirst, .providesSummary th.colFirst, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colSecond, .memberSummary th.colSecond, .memberSummary th.colConstructorName, +.typeSummary td.colFirst, .typeSummary th.colFirst { + vertical-align:top; +} +.packagesSummary th.colLast, .packagesSummary td.colLast { + white-space:normal; +} +td.colFirst a:link, td.colFirst a:visited, +td.colSecond a:link, td.colSecond a:visited, +th.colFirst a:link, th.colFirst a:visited, +th.colSecond a:link, th.colSecond a:visited, +th.colConstructorName a:link, th.colConstructorName a:visited, +th.colDeprecatedItemName a:link, th.colDeprecatedItemName a:visited, +.constantValuesContainer td a:link, .constantValuesContainer td a:visited, +.allClassesContainer td a:link, .allClassesContainer td a:visited, +.allPackagesContainer td a:link, .allPackagesContainer td a:visited { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor, .altColor th { + background-color:#FFFFFF; +} +.rowColor, .rowColor th { + background-color:#EEEEEF; +} +/* + * Styles for contents. + */ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} +td.colLast div { + padding-top:0px; +} +td.colLast a { + padding-bottom:3px; +} +/* + * Styles for formatting effect. + */ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .implementationLabel, .memberNameLabel, .memberNameLink, +.moduleLabelInPackage, .moduleLabelInType, .overrideSpecifyLabel, .packageLabelInType, +.packageHierarchyLabel, .paramLabel, .returnLabel, .seeLabel, .simpleTagLabel, +.throwsLabel, .typeNameLabel, .typeNameLink, .searchTagLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} +.deprecationBlock { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; + border-style:solid; + border-width:thin; + border-radius:10px; + padding:10px; + margin-bottom:10px; + margin-right:10px; + display:inline-block; +} +div.block div.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} +div.contentContainer ul.blockList li.blockList h2 { + padding-bottom:0px; +} +/* + * Styles for IFRAME. + */ +.mainContainer { + margin:0 auto; + padding:0; + height:100%; + width:100%; + position:fixed; + top:0; + left:0; +} +.leftContainer { + height:100%; + position:fixed; + width:320px; +} +.leftTop { + position:relative; + float:left; + width:315px; + top:0; + left:0; + height:30%; + border-right:6px solid #ccc; + border-bottom:6px solid #ccc; +} +.leftBottom { + position:relative; + float:left; + width:315px; + bottom:0; + left:0; + height:70%; + border-right:6px solid #ccc; + border-top:1px solid #000; +} +.rightContainer { + position:absolute; + left:320px; + top:0; + bottom:0; + height:100%; + right:0; + border-left:1px solid #000; +} +.rightIframe { + margin:0; + padding:0; + height:100%; + right:30px; + width:100%; + overflow:visible; + margin-bottom:30px; +} +/* + * Styles specific to HTML5 elements. + */ +main, nav, header, footer, section { + display:block; +} +/* + * Styles for javadoc search. + */ +.ui-autocomplete-category { + font-weight:bold; + font-size:15px; + padding:7px 0 7px 3px; + background-color:#4D7A97; + color:#FFFFFF; +} +.resultItem { + font-size:13px; +} +.ui-autocomplete { + max-height:85%; + max-width:65%; + overflow-y:scroll; + overflow-x:scroll; + white-space:nowrap; + box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); +} +ul.ui-autocomplete { + position:fixed; + z-index:999999; +} +ul.ui-autocomplete li { + float:left; + clear:both; + width:100%; +} +.resultHighlight { + font-weight:bold; +} +#search { + background-image:url('resources/glass.png'); + background-size:13px; + background-repeat:no-repeat; + background-position:2px 3px; + padding-left:20px; + position:relative; + right:-18px; +} +#reset { + background-color: rgb(255,255,255); + background-image:url('resources/x.png'); + background-position:center; + background-repeat:no-repeat; + background-size:12px; + border:0 none; + width:16px; + height:17px; + position:relative; + left:-4px; + top:-4px; + font-size:0px; +} +.watermark { + color:#545454; +} +.searchTagDescResult { + font-style:italic; + font-size:11px; +} +.searchTagHolderResult { + font-style:italic; + font-size:12px; +} +.searchTagResult:before, .searchTagResult:target { + color:red; +} +.moduleGraph span { + display:none; + position:absolute; +} +.moduleGraph:hover span { + display:block; + margin: -100px 0 0 100px; + z-index: 1; +} +.methodSignature { + white-space:normal; +} + +/* + * Styles for user-provided tables. + * + * borderless: + * No borders, vertical margins, styled caption. + * This style is provided for use with existing doc comments. + * In general, borderless tables should not be used for layout purposes. + * + * plain: + * Plain borders around table and cells, vertical margins, styled caption. + * Best for small tables or for complex tables for tables with cells that span + * rows and columns, when the "striped" style does not work well. + * + * striped: + * Borders around the table and vertical borders between cells, striped rows, + * vertical margins, styled caption. + * Best for tables that have a header row, and a body containing a series of simple rows. + */ + +table.borderless, +table.plain, +table.striped { + margin-top: 10px; + margin-bottom: 10px; +} +table.borderless > caption, +table.plain > caption, +table.striped > caption { + font-weight: bold; + font-size: smaller; +} +table.borderless th, table.borderless td, +table.plain th, table.plain td, +table.striped th, table.striped td { + padding: 2px 5px; +} +table.borderless, +table.borderless > thead > tr > th, table.borderless > tbody > tr > th, table.borderless > tr > th, +table.borderless > thead > tr > td, table.borderless > tbody > tr > td, table.borderless > tr > td { + border: none; +} +table.borderless > thead > tr, table.borderless > tbody > tr, table.borderless > tr { + background-color: transparent; +} +table.plain { + border-collapse: collapse; + border: 1px solid black; +} +table.plain > thead > tr, table.plain > tbody tr, table.plain > tr { + background-color: transparent; +} +table.plain > thead > tr > th, table.plain > tbody > tr > th, table.plain > tr > th, +table.plain > thead > tr > td, table.plain > tbody > tr > td, table.plain > tr > td { + border: 1px solid black; +} +table.striped { + border-collapse: collapse; + border: 1px solid black; +} +table.striped > thead { + background-color: #E3E3E3; +} +table.striped > thead > tr > th, table.striped > thead > tr > td { + border: 1px solid black; +} +table.striped > tbody > tr:nth-child(even) { + background-color: #EEE +} +table.striped > tbody > tr:nth-child(odd) { + background-color: #FFF +} +table.striped > tbody > tr > th, table.striped > tbody > tr > td { + border-left: 1px solid black; + border-right: 1px solid black; +} +table.striped > tbody > tr > th { + font-weight: normal; +} + + +/* Extensions: */ + +table.goikTableDefaults, +table.goikTableDefaults>tbody>tr>th, +table.goikTableDefaults>tbody>tr>td { + border: 1px solid black; + border-collapse: collapse; +} + +table.goikTableDefaults>tbody>tr>td { + vertical-align:top; +} + +.implementationHints { + background-color: hsl(120, 100%, 95%) !important; +} + +section.implementationHints>h3 { + font-weight: bold; + background-color: rgb(222, 227, 233); +} \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/src/main/resources/XMLSchema.xsd b/Klausuren/Sda1/2019summer/Exam/src/main/resources/XMLSchema.xsd new file mode 100644 index 0000000000000000000000000000000000000000..89829f137c946d2135736472ada6bb33a51df385 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/src/main/resources/XMLSchema.xsd @@ -0,0 +1,2471 @@ +<?xml version='1.0' encoding='UTF-8'?> +<xsd:schema targetNamespace="http://www.w3.org/2001/XMLSchema" + blockDefault="#all" elementFormDefault="qualified" version="1.0" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="EN" + xmlns:hfp="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty"> + <xsd:annotation> + <xsd:documentation> + Part 1 version: Id: structures.xsd,v 1.2 2004/01/15 11:34:25 ht Exp + Part 2 version: Id: datatypes.xsd,v 1.3 2004/01/23 18:11:13 ht Exp + </xsd:documentation> + </xsd:annotation> + + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/2004/PER-xmlschema-1-20040318/structures.html"> + The schema corresponding to this document is normative, + with respect to the syntactic constraints it expresses in the + XML Schema language. The documentation (within <documentation> elements) + below, is not normative, but rather highlights important aspects of + the W3C Recommendation of which this is a part</xsd:documentation> + </xsd:annotation> + + <xsd:annotation> + <xsd:documentation> + The simpleType element and all of its members are defined + towards the end of this schema document</xsd:documentation> + </xsd:annotation> + + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"> + <xsd:annotation> + <xsd:documentation> + Get access to the xml: attribute groups for xml:lang + as declared on 'schema' and 'documentation' below + </xsd:documentation> + </xsd:annotation> + </xsd:import> + + <xsd:complexType name="openAttrs"> + <xsd:annotation> + <xsd:documentation> + This type is extended by almost all schema types + to allow attributes from other namespaces to be + added to user schemas. + </xsd:documentation> + </xsd:annotation> + <xsd:complexContent> + <xsd:restriction base="xsd:anyType"> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="annotated"> + <xsd:annotation> + <xsd:documentation> + This type is extended by all types which allow annotation + other than <schema> itself + </xsd:documentation> + </xsd:annotation> + <xsd:complexContent> + <xsd:extension base="xsd:openAttrs"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + </xsd:sequence> + <xsd:attribute name="id" type="xsd:ID"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:group name="schemaTop"> + <xsd:annotation> + <xsd:documentation> + This group is for the + elements which occur freely at the top level of schemas. + All of their types are based on the "annotated" type by extension.</xsd:documentation> + </xsd:annotation> + <xsd:choice> + <xsd:group ref="xsd:redefinable"/> + <xsd:element ref="xsd:element"/> + <xsd:element ref="xsd:attribute"/> + <xsd:element ref="xsd:notation"/> + </xsd:choice> + </xsd:group> + + <xsd:group name="redefinable"> + <xsd:annotation> + <xsd:documentation> + This group is for the + elements which can self-redefine (see <redefine> below).</xsd:documentation> + </xsd:annotation> + <xsd:choice> + <xsd:element ref="xsd:simpleType"/> + <xsd:element ref="xsd:complexType"/> + <xsd:element ref="xsd:group"/> + <xsd:element ref="xsd:attributeGroup"/> + </xsd:choice> + </xsd:group> + + <xsd:simpleType name="formChoice"> + <xsd:annotation> + <xsd:documentation> + A utility type, not for public use</xsd:documentation> + </xsd:annotation> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="qualified"/> + <xsd:enumeration value="unqualified"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="reducedDerivationControl"> + <xsd:annotation> + <xsd:documentation> + A utility type, not for public use</xsd:documentation> + </xsd:annotation> + <xsd:restriction base="xsd:derivationControl"> + <xsd:enumeration value="extension"/> + <xsd:enumeration value="restriction"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="derivationSet"> + <xsd:annotation> + <xsd:documentation> + A utility type, not for public use</xsd:documentation> + <xsd:documentation> + #all or (possibly empty) subset of {extension, restriction}</xsd:documentation> + </xsd:annotation> + <xsd:union> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="#all"/> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType> + <xsd:list itemType="xsd:reducedDerivationControl"/> + </xsd:simpleType> + </xsd:union> + </xsd:simpleType> + + <xsd:simpleType name="typeDerivationControl"> + <xsd:annotation> + <xsd:documentation> + A utility type, not for public use</xsd:documentation> + </xsd:annotation> + <xsd:restriction base="xsd:derivationControl"> + <xsd:enumeration value="extension"/> + <xsd:enumeration value="restriction"/> + <xsd:enumeration value="list"/> + <xsd:enumeration value="union"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="fullDerivationSet"> + <xsd:annotation> + <xsd:documentation> + A utility type, not for public use</xsd:documentation> + <xsd:documentation> + #all or (possibly empty) subset of {extension, restriction, list, union}</xsd:documentation> + </xsd:annotation> + <xsd:union> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="#all"/> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType> + <xsd:list itemType="xsd:typeDerivationControl"/> + </xsd:simpleType> + </xsd:union> + </xsd:simpleType> + + <xsd:element name="schema" id="schema"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-schema"/> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="xsd:openAttrs"> + <xsd:sequence> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element ref="xsd:include"/> + <xsd:element ref="xsd:import"/> + <xsd:element ref="xsd:redefine"/> + <xsd:element ref="xsd:annotation"/> + </xsd:choice> + <xsd:sequence minOccurs="0" maxOccurs="unbounded"> + <xsd:group ref="xsd:schemaTop"/> + <xsd:element ref="xsd:annotation" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + </xsd:sequence> + <xsd:attribute name="targetNamespace" type="xsd:anyURI"/> + <xsd:attribute name="version" type="xsd:token"/> + <xsd:attribute name="finalDefault" type="xsd:fullDerivationSet" use="optional" default=""/> + <xsd:attribute name="blockDefault" type="xsd:blockSet" use="optional" default=""/> + <xsd:attribute name="attributeFormDefault" type="xsd:formChoice" use="optional" default="unqualified"/> + <xsd:attribute name="elementFormDefault" type="xsd:formChoice" use="optional" default="unqualified"/> + <xsd:attribute name="id" type="xsd:ID"/> + <xsd:attribute ref="xml:lang"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:key name="element"> + <xsd:selector xpath="xsd:element"/> + <xsd:field xpath="@name"/> + </xsd:key> + + <xsd:key name="attribute"> + <xsd:selector xpath="xsd:attribute"/> + <xsd:field xpath="@name"/> + </xsd:key> + + <xsd:key name="type"> + <xsd:selector xpath="xsd:complexType|xsd:simpleType"/> + <xsd:field xpath="@name"/> + </xsd:key> + + <xsd:key name="group"> + <xsd:selector xpath="xsd:group"/> + <xsd:field xpath="@name"/> + </xsd:key> + + <xsd:key name="attributeGroup"> + <xsd:selector xpath="xsd:attributeGroup"/> + <xsd:field xpath="@name"/> + </xsd:key> + + <xsd:key name="notation"> + <xsd:selector xpath="xsd:notation"/> + <xsd:field xpath="@name"/> + </xsd:key> + + <xsd:key name="identityConstraint"> + <xsd:selector xpath=".//xsd:key|.//xsd:unique|.//xsd:keyref"/> + <xsd:field xpath="@name"/> + </xsd:key> + + </xsd:element> + + <xsd:simpleType name="allNNI"> + <xsd:annotation><xsd:documentation> + for maxOccurs</xsd:documentation></xsd:annotation> + <xsd:union memberTypes="xsd:nonNegativeInteger"> + <xsd:simpleType> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="unbounded"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:union> + </xsd:simpleType> + + <xsd:attributeGroup name="occurs"> + <xsd:annotation><xsd:documentation> + for all particles</xsd:documentation></xsd:annotation> + <xsd:attribute name="minOccurs" type="xsd:nonNegativeInteger" use="optional" default="1"/> + <xsd:attribute name="maxOccurs" type="xsd:allNNI" use="optional" default="1"/> + </xsd:attributeGroup> + + <xsd:attributeGroup name="defRef"> + <xsd:annotation><xsd:documentation> + for element, group and attributeGroup, + which both define and reference</xsd:documentation></xsd:annotation> + <xsd:attribute name="name" type="xsd:NCName"/> + <xsd:attribute name="ref" type="xsd:QName"/> + </xsd:attributeGroup> + + <xsd:group name="typeDefParticle"> + <xsd:annotation> + <xsd:documentation> + 'complexType' uses this</xsd:documentation></xsd:annotation> + <xsd:choice> + <xsd:element name="group" type="xsd:groupRef"/> + <xsd:element ref="xsd:all"/> + <xsd:element ref="xsd:choice"/> + <xsd:element ref="xsd:sequence"/> + </xsd:choice> + </xsd:group> + + + + <xsd:group name="nestedParticle"> + <xsd:choice> + <xsd:element name="element" type="xsd:localElement"/> + <xsd:element name="group" type="xsd:groupRef"/> + <xsd:element ref="xsd:choice"/> + <xsd:element ref="xsd:sequence"/> + <xsd:element ref="xsd:any"/> + </xsd:choice> + </xsd:group> + + <xsd:group name="particle"> + <xsd:choice> + <xsd:element name="element" type="xsd:localElement"/> + <xsd:element name="group" type="xsd:groupRef"/> + <xsd:element ref="xsd:all"/> + <xsd:element ref="xsd:choice"/> + <xsd:element ref="xsd:sequence"/> + <xsd:element ref="xsd:any"/> + </xsd:choice> + </xsd:group> + + <xsd:complexType name="attribute"> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:sequence> + <xsd:element name="simpleType" minOccurs="0" type="xsd:localSimpleType"/> + </xsd:sequence> + <xsd:attributeGroup ref="xsd:defRef"/> + <xsd:attribute name="type" type="xsd:QName"/> + <xsd:attribute name="use" use="optional" default="optional"> + <xsd:simpleType> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="prohibited"/> + <xsd:enumeration value="optional"/> + <xsd:enumeration value="required"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="default" type="xsd:string"/> + <xsd:attribute name="fixed" type="xsd:string"/> + <xsd:attribute name="form" type="xsd:formChoice"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="topLevelAttribute"> + <xsd:complexContent> + <xsd:restriction base="xsd:attribute"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + <xsd:element name="simpleType" minOccurs="0" type="xsd:localSimpleType"/> + </xsd:sequence> + <xsd:attribute name="ref" use="prohibited"/> + <xsd:attribute name="form" use="prohibited"/> + <xsd:attribute name="use" use="prohibited"/> + <xsd:attribute name="name" use="required" type="xsd:NCName"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:group name="attrDecls"> + <xsd:sequence> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element name="attribute" type="xsd:attribute"/> + <xsd:element name="attributeGroup" type="xsd:attributeGroupRef"/> + </xsd:choice> + <xsd:element ref="xsd:anyAttribute" minOccurs="0"/> + </xsd:sequence> + </xsd:group> + + <xsd:element name="anyAttribute" type="xsd:wildcard" id="anyAttribute"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-anyAttribute"/> + </xsd:annotation> + </xsd:element> + + <xsd:group name="complexTypeModel"> + <xsd:choice> + <xsd:element ref="xsd:simpleContent"/> + <xsd:element ref="xsd:complexContent"/> + <xsd:sequence> + <xsd:annotation> + <xsd:documentation> + This branch is short for + <complexContent> + <restriction base="xsd:anyType"> + ... + </restriction> + </complexContent></xsd:documentation> + </xsd:annotation> + <xsd:group ref="xsd:typeDefParticle" minOccurs="0"/> + <xsd:group ref="xsd:attrDecls"/> + </xsd:sequence> + </xsd:choice> + </xsd:group> + + <xsd:complexType name="complexType" abstract="true"> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:group ref="xsd:complexTypeModel"/> + <xsd:attribute name="name" type="xsd:NCName"> + <xsd:annotation> + <xsd:documentation> + Will be restricted to required or forbidden</xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="mixed" type="xsd:boolean" use="optional" default="false"> + <xsd:annotation> + <xsd:documentation> + Not allowed if simpleContent child is chosen. + May be overriden by setting on complexContent child.</xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="abstract" type="xsd:boolean" use="optional" default="false"/> + <xsd:attribute name="final" type="xsd:derivationSet"/> + <xsd:attribute name="block" type="xsd:derivationSet"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="topLevelComplexType"> + <xsd:complexContent> + <xsd:restriction base="xsd:complexType"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + <xsd:group ref="xsd:complexTypeModel"/> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:NCName" use="required"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="localComplexType"> + <xsd:complexContent> + <xsd:restriction base="xsd:complexType"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + <xsd:group ref="xsd:complexTypeModel"/> + </xsd:sequence> + <xsd:attribute name="name" use="prohibited"/> + <xsd:attribute name="abstract" use="prohibited"/> + <xsd:attribute name="final" use="prohibited"/> + <xsd:attribute name="block" use="prohibited"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="restrictionType"> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:sequence> + <xsd:choice minOccurs="0"> + <xsd:group ref="xsd:typeDefParticle"/> + <xsd:group ref="xsd:simpleRestrictionModel"/> + </xsd:choice> + <xsd:group ref="xsd:attrDecls"/> + </xsd:sequence> + <xsd:attribute name="base" type="xsd:QName" use="required"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="complexRestrictionType"> + <xsd:complexContent> + <xsd:restriction base="xsd:restrictionType"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + <xsd:choice minOccurs="0"> + <xsd:annotation> + <xsd:documentation>This choice is added simply to + make this a valid restriction per the REC</xsd:documentation> + </xsd:annotation> + <xsd:group ref="xsd:typeDefParticle"/> + </xsd:choice> + <xsd:group ref="xsd:attrDecls"/> + </xsd:sequence> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="extensionType"> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:sequence> + <xsd:group ref="xsd:typeDefParticle" minOccurs="0"/> + <xsd:group ref="xsd:attrDecls"/> + </xsd:sequence> + <xsd:attribute name="base" type="xsd:QName" use="required"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:element name="complexContent" id="complexContent"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-complexContent"/> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:choice> + <xsd:element name="restriction" type="xsd:complexRestrictionType"/> + <xsd:element name="extension" type="xsd:extensionType"/> + </xsd:choice> + <xsd:attribute name="mixed" type="xsd:boolean"> + <xsd:annotation> + <xsd:documentation> + Overrides any setting on complexType parent.</xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="simpleRestrictionType"> + <xsd:complexContent> + <xsd:restriction base="xsd:restrictionType"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + <xsd:choice minOccurs="0"> + <xsd:annotation> + <xsd:documentation>This choice is added simply to + make this a valid restriction per the REC</xsd:documentation> + </xsd:annotation> + <xsd:group ref="xsd:simpleRestrictionModel"/> + </xsd:choice> + <xsd:group ref="xsd:attrDecls"/> + </xsd:sequence> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="simpleExtensionType"> + <xsd:complexContent> + <xsd:restriction base="xsd:extensionType"> + <xsd:sequence> + <xsd:annotation> + <xsd:documentation> + No typeDefParticle group reference</xsd:documentation> + </xsd:annotation> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + <xsd:group ref="xsd:attrDecls"/> + </xsd:sequence> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:element name="simpleContent" id="simpleContent"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-simpleContent"/> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:choice> + <xsd:element name="restriction" type="xsd:simpleRestrictionType"/> + <xsd:element name="extension" type="xsd:simpleExtensionType"/> + </xsd:choice> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="complexType" type="xsd:topLevelComplexType" id="complexType"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-complexType"/> + </xsd:annotation> + </xsd:element> + + + <xsd:simpleType name="blockSet"> + <xsd:annotation> + <xsd:documentation> + A utility type, not for public use</xsd:documentation> + <xsd:documentation> + #all or (possibly empty) subset of {substitution, extension, + restriction}</xsd:documentation> + </xsd:annotation> + <xsd:union> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="#all"/> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType> + <xsd:list> + <xsd:simpleType> + <xsd:restriction base="xsd:derivationControl"> + <xsd:enumeration value="extension"/> + <xsd:enumeration value="restriction"/> + <xsd:enumeration value="substitution"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:list> + </xsd:simpleType> + </xsd:union> + </xsd:simpleType> + + <xsd:complexType name="element" abstract="true"> + <xsd:annotation> + <xsd:documentation> + The element element can be used either + at the top level to define an element-type binding globally, + or within a content model to either reference a globally-defined + element or type or declare an element-type binding locally. + The ref form is not allowed at the top level.</xsd:documentation> + </xsd:annotation> + + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:sequence> + <xsd:choice minOccurs="0"> + <xsd:element name="simpleType" type="xsd:localSimpleType"/> + <xsd:element name="complexType" type="xsd:localComplexType"/> + </xsd:choice> + <xsd:group ref="xsd:identityConstraint" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attributeGroup ref="xsd:defRef"/> + <xsd:attribute name="type" type="xsd:QName"/> + <xsd:attribute name="substitutionGroup" type="xsd:QName"/> + <xsd:attributeGroup ref="xsd:occurs"/> + <xsd:attribute name="default" type="xsd:string"/> + <xsd:attribute name="fixed" type="xsd:string"/> + <xsd:attribute name="nillable" type="xsd:boolean" use="optional" default="false"/> + <xsd:attribute name="abstract" type="xsd:boolean" use="optional" default="false"/> + <xsd:attribute name="final" type="xsd:derivationSet"/> + <xsd:attribute name="block" type="xsd:blockSet"/> + <xsd:attribute name="form" type="xsd:formChoice"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="topLevelElement"> + <xsd:complexContent> + <xsd:restriction base="xsd:element"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + <xsd:choice minOccurs="0"> + <xsd:element name="simpleType" type="xsd:localSimpleType"/> + <xsd:element name="complexType" type="xsd:localComplexType"/> + </xsd:choice> + <xsd:group ref="xsd:identityConstraint" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="ref" use="prohibited"/> + <xsd:attribute name="form" use="prohibited"/> + <xsd:attribute name="minOccurs" use="prohibited"/> + <xsd:attribute name="maxOccurs" use="prohibited"/> + <xsd:attribute name="name" use="required" type="xsd:NCName"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="localElement"> + <xsd:complexContent> + <xsd:restriction base="xsd:element"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + <xsd:choice minOccurs="0"> + <xsd:element name="simpleType" type="xsd:localSimpleType"/> + <xsd:element name="complexType" type="xsd:localComplexType"/> + </xsd:choice> + <xsd:group ref="xsd:identityConstraint" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="substitutionGroup" use="prohibited"/> + <xsd:attribute name="final" use="prohibited"/> + <xsd:attribute name="abstract" use="prohibited"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:element name="element" type="xsd:topLevelElement" id="element"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-element"/> + </xsd:annotation> + </xsd:element> + + <xsd:complexType name="group" abstract="true"> + <xsd:annotation> + <xsd:documentation> + group type for explicit groups, named top-level groups and + group references</xsd:documentation> + </xsd:annotation> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:group ref="xsd:particle" minOccurs="0" maxOccurs="unbounded"/> + <xsd:attributeGroup ref="xsd:defRef"/> + <xsd:attributeGroup ref="xsd:occurs"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="realGroup"> + <xsd:complexContent> + <xsd:restriction base="xsd:group"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + <xsd:choice minOccurs="0" maxOccurs="1"> + <xsd:element ref="xsd:all"/> + <xsd:element ref="xsd:choice"/> + <xsd:element ref="xsd:sequence"/> + </xsd:choice> + </xsd:sequence> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="namedGroup"> + <xsd:complexContent> + <xsd:restriction base="xsd:realGroup"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + <xsd:choice minOccurs="1" maxOccurs="1"> + <xsd:element name="all"> + <xsd:complexType> + <xsd:complexContent> + <xsd:restriction base="xsd:all"> + <xsd:group ref="xsd:allModel"/> + <xsd:attribute name="minOccurs" use="prohibited"/> + <xsd:attribute name="maxOccurs" use="prohibited"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + <xsd:element name="choice" type="xsd:simpleExplicitGroup"/> + <xsd:element name="sequence" type="xsd:simpleExplicitGroup"/> + </xsd:choice> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:NCName"/> + <xsd:attribute name="ref" use="prohibited"/> + <xsd:attribute name="minOccurs" use="prohibited"/> + <xsd:attribute name="maxOccurs" use="prohibited"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="groupRef"> + <xsd:complexContent> + <xsd:restriction base="xsd:realGroup"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + </xsd:sequence> + <xsd:attribute name="ref" use="required" type="xsd:QName"/> + <xsd:attribute name="name" use="prohibited"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="explicitGroup"> + <xsd:annotation> + <xsd:documentation> + group type for the three kinds of group</xsd:documentation> + </xsd:annotation> + <xsd:complexContent> + <xsd:restriction base="xsd:group"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + <xsd:group ref="xsd:nestedParticle" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:NCName" use="prohibited"/> + <xsd:attribute name="ref" type="xsd:QName" use="prohibited"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="simpleExplicitGroup"> + <xsd:complexContent> + <xsd:restriction base="xsd:explicitGroup"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + <xsd:group ref="xsd:nestedParticle" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="minOccurs" use="prohibited"/> + <xsd:attribute name="maxOccurs" use="prohibited"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:group name="allModel"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:annotation> + <xsd:documentation>This choice with min/max is here to + avoid a pblm with the Elt:All/Choice/Seq + Particle derivation constraint</xsd:documentation> + </xsd:annotation> + <xsd:element name="element" type="xsd:narrowMaxMin"/> + </xsd:choice> + </xsd:sequence> + </xsd:group> + + + <xsd:complexType name="narrowMaxMin"> + <xsd:annotation> + <xsd:documentation>restricted max/min</xsd:documentation> + </xsd:annotation> + <xsd:complexContent> + <xsd:restriction base="xsd:localElement"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + <xsd:choice minOccurs="0"> + <xsd:element name="simpleType" type="xsd:localSimpleType"/> + <xsd:element name="complexType" type="xsd:localComplexType"/> + </xsd:choice> + <xsd:group ref="xsd:identityConstraint" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="minOccurs" use="optional" default="1"> + <xsd:simpleType> + <xsd:restriction base="xsd:nonNegativeInteger"> + <xsd:enumeration value="0"/> + <xsd:enumeration value="1"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="maxOccurs" use="optional" default="1"> + <xsd:simpleType> + <xsd:restriction base="xsd:allNNI"> + <xsd:enumeration value="0"/> + <xsd:enumeration value="1"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="all"> + <xsd:annotation> + <xsd:documentation> + Only elements allowed inside</xsd:documentation> + </xsd:annotation> + <xsd:complexContent> + <xsd:restriction base="xsd:explicitGroup"> + <xsd:group ref="xsd:allModel"/> + <xsd:attribute name="minOccurs" use="optional" default="1"> + <xsd:simpleType> + <xsd:restriction base="xsd:nonNegativeInteger"> + <xsd:enumeration value="0"/> + <xsd:enumeration value="1"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="maxOccurs" use="optional" default="1"> + <xsd:simpleType> + <xsd:restriction base="xsd:allNNI"> + <xsd:enumeration value="1"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:element name="all" id="all" type="xsd:all"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-all"/> + </xsd:annotation> + </xsd:element> + + <xsd:element name="choice" type="xsd:explicitGroup" id="choice"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-choice"/> + </xsd:annotation> + </xsd:element> + + <xsd:element name="sequence" type="xsd:explicitGroup" id="sequence"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-sequence"/> + </xsd:annotation> + </xsd:element> + + <xsd:element name="group" type="xsd:namedGroup" id="group"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-group"/> + </xsd:annotation> + </xsd:element> + + <xsd:complexType name="wildcard"> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:attribute name="namespace" type="xsd:namespaceList" use="optional" default="##any"/> + <xsd:attribute name="processContents" use="optional" default="strict"> + <xsd:simpleType> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="skip"/> + <xsd:enumeration value="lax"/> + <xsd:enumeration value="strict"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:element name="any" id="any"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-any"/> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="xsd:wildcard"> + <xsd:attributeGroup ref="xsd:occurs"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:annotation> + <xsd:documentation> + simple type for the value of the 'namespace' attr of + 'any' and 'anyAttribute'</xsd:documentation> + </xsd:annotation> + <xsd:annotation> + <xsd:documentation> + Value is + ##any - - any non-conflicting WFXML/attribute at all + + ##other - - any non-conflicting WFXML/attribute from + namespace other than targetNS + + ##local - - any unqualified non-conflicting WFXML/attribute + + one or - - any non-conflicting WFXML/attribute from + more URI the listed namespaces + references + (space separated) + + ##targetNamespace or ##local may appear in the above list, to + refer to the targetNamespace of the enclosing + schema or an absent targetNamespace respectively</xsd:documentation> + </xsd:annotation> + + <xsd:simpleType name="namespaceList"> + <xsd:annotation> + <xsd:documentation> + A utility type, not for public use</xsd:documentation> + </xsd:annotation> + <xsd:union> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="##any"/> + <xsd:enumeration value="##other"/> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType> + <xsd:list> + <xsd:simpleType> + <xsd:union memberTypes="xsd:anyURI"> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="##targetNamespace"/> + <xsd:enumeration value="##local"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:union> + </xsd:simpleType> + </xsd:list> + </xsd:simpleType> + </xsd:union> + </xsd:simpleType> + + <xsd:element name="attribute" type="xsd:topLevelAttribute" id="attribute"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-attribute"/> + </xsd:annotation> + </xsd:element> + + <xsd:complexType name="attributeGroup" abstract="true"> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:group ref="xsd:attrDecls"/> + <xsd:attributeGroup ref="xsd:defRef"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="namedAttributeGroup"> + <xsd:complexContent> + <xsd:restriction base="xsd:attributeGroup"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + <xsd:group ref="xsd:attrDecls"/> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:NCName"/> + <xsd:attribute name="ref" use="prohibited"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="attributeGroupRef"> + <xsd:complexContent> + <xsd:restriction base="xsd:attributeGroup"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + </xsd:sequence> + <xsd:attribute name="ref" use="required" type="xsd:QName"/> + <xsd:attribute name="name" use="prohibited"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:element name="attributeGroup" type="xsd:namedAttributeGroup" id="attributeGroup"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-attributeGroup"/> + </xsd:annotation> + </xsd:element> + + <xsd:element name="include" id="include"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-include"/> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:attribute name="schemaLocation" type="xsd:anyURI" use="required"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="redefine" id="redefine"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-redefine"/> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="xsd:openAttrs"> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element ref="xsd:annotation"/> + <xsd:group ref="xsd:redefinable"/> + </xsd:choice> + <xsd:attribute name="schemaLocation" type="xsd:anyURI" use="required"/> + <xsd:attribute name="id" type="xsd:ID"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="import" id="import"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-import"/> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:attribute name="namespace" type="xsd:anyURI"/> + <xsd:attribute name="schemaLocation" type="xsd:anyURI"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="selector" id="selector"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-selector"/> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:attribute name="xpath" use="required"> + <xsd:simpleType> + <xsd:annotation> + <xsd:documentation>A subset of XPath expressions for use +in selectors</xsd:documentation> + <xsd:documentation>A utility type, not for public +use</xsd:documentation> + </xsd:annotation> + <xsd:restriction base="xsd:token"> + <xsd:annotation> + <xsd:documentation>The following pattern is intended to allow XPath + expressions per the following EBNF: + Selector ::= Path ( '|' Path )* + Path ::= ('.//')? Step ( '/' Step )* + Step ::= '.' | NameTest + NameTest ::= QName | '*' | NCName ':' '*' + child:: is also allowed + </xsd:documentation> + </xsd:annotation> + <xsd:pattern value="(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)*"> + </xsd:pattern> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="field" id="field"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-field"/> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:attribute name="xpath" use="required"> + <xsd:simpleType> + <xsd:annotation> + <xsd:documentation>A subset of XPath expressions for use +in fields</xsd:documentation> + <xsd:documentation>A utility type, not for public +use</xsd:documentation> + </xsd:annotation> + <xsd:restriction base="xsd:token"> + <xsd:annotation> + <xsd:documentation>The following pattern is intended to allow XPath + expressions per the same EBNF as for selector, + with the following change: + Path ::= ('.//')? ( Step '/' )* ( Step | '@' NameTest ) + </xsd:documentation> + </xsd:annotation> + <xsd:pattern value="(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*))))(\|(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*)))))*"> + </xsd:pattern> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="keybase"> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:sequence> + <xsd:element ref="xsd:selector"/> + <xsd:element ref="xsd:field" minOccurs="1" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:NCName" use="required"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:group name="identityConstraint"> + <xsd:annotation> + <xsd:documentation>The three kinds of identity constraints, all with + type of or derived from 'keybase'. + </xsd:documentation> + </xsd:annotation> + <xsd:choice> + <xsd:element ref="xsd:unique"/> + <xsd:element ref="xsd:key"/> + <xsd:element ref="xsd:keyref"/> + </xsd:choice> + </xsd:group> + + <xsd:element name="unique" type="xsd:keybase" id="unique"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-unique"/> + </xsd:annotation> + </xsd:element> + <xsd:element name="key" type="xsd:keybase" id="key"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-key"/> + </xsd:annotation> + </xsd:element> + <xsd:element name="keyref" id="keyref"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-keyref"/> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="xsd:keybase"> + <xsd:attribute name="refer" type="xsd:QName" use="required"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="notation" id="notation"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-notation"/> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:attribute name="name" type="xsd:NCName" use="required"/> + <xsd:attribute name="public" type="xsd:public"/> + <xsd:attribute name="system" type="xsd:anyURI"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:simpleType name="public"> + <xsd:annotation> + <xsd:documentation> + A utility type, not for public use</xsd:documentation> + <xsd:documentation> + A public identifier, per ISO 8879</xsd:documentation> + </xsd:annotation> + <xsd:restriction base="xsd:token"/> + </xsd:simpleType> + + <xsd:element name="appinfo" id="appinfo"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-appinfo"/> + </xsd:annotation> + <xsd:complexType mixed="true"> + <xsd:sequence minOccurs="0" maxOccurs="unbounded"> + <xsd:any processContents="lax"/> + </xsd:sequence> + <xsd:attribute name="source" type="xsd:anyURI"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:complexType> + </xsd:element> + + <xsd:element name="documentation" id="documentation"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-documentation"/> + </xsd:annotation> + <xsd:complexType mixed="true"> + <xsd:sequence minOccurs="0" maxOccurs="unbounded"> + <xsd:any processContents="lax"/> + </xsd:sequence> + <xsd:attribute name="source" type="xsd:anyURI"/> + <xsd:attribute ref="xml:lang"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:complexType> + </xsd:element> + + <xsd:element name="annotation" id="annotation"> + <xsd:annotation> + <xsd:documentation source="http://www.w3.org/TR/xmlschema-1/#element-annotation"/> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:extension base="xsd:openAttrs"> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element ref="xsd:appinfo"/> + <xsd:element ref="xsd:documentation"/> + </xsd:choice> + <xsd:attribute name="id" type="xsd:ID"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:annotation> + <xsd:documentation> + notations for use within XML Schema schemas</xsd:documentation> + </xsd:annotation> + + <xsd:notation name="XMLSchemaStructures" public="structures" system="http://www.w3.org/2000/08/XMLSchema.xsd"/> + <xsd:notation name="XML" public="REC-xml-19980210" system="http://www.w3.org/TR/1998/REC-xml-19980210"/> + + <xsd:complexType name="anyType" mixed="true"> + <xsd:annotation> + <xsd:documentation> + Not the real urType, but as close an approximation as we can + get in the XML representation</xsd:documentation> + </xsd:annotation> + <xsd:sequence> + <xsd:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/> + </xsd:sequence> + <xsd:anyAttribute processContents="lax"/> + </xsd:complexType> + + <xsd:annotation> + <xsd:documentation> + First the built-in primitive datatypes. These definitions are for + information only, the real built-in definitions are magic. + </xsd:documentation> + + <xsd:documentation> + For each built-in datatype in this schema (both primitive and + derived) can be uniquely addressed via a URI constructed + as follows: + 1) the base URI is the URI of the XML Schema namespace + 2) the fragment identifier is the name of the datatype + + For example, to address the int datatype, the URI is: + + http://www.w3.org/2001/XMLSchema#int + + Additionally, each facet definition element can be uniquely + addressed via a URI constructed as follows: + 1) the base URI is the URI of the XML Schema namespace + 2) the fragment identifier is the name of the facet + + For example, to address the maxInclusive facet, the URI is: + + http://www.w3.org/2001/XMLSchema#maxInclusive + + Additionally, each facet usage in a built-in datatype definition + can be uniquely addressed via a URI constructed as follows: + 1) the base URI is the URI of the XML Schema namespace + 2) the fragment identifier is the name of the datatype, followed + by a period (".") followed by the name of the facet + + For example, to address the usage of the maxInclusive facet in + the definition of int, the URI is: + + http://www.w3.org/2001/XMLSchema#int.maxInclusive + + </xsd:documentation> + </xsd:annotation> + + <xsd:simpleType name="string" id="string"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="length"/> + <hfp:hasFacet name="minLength"/> + <hfp:hasFacet name="maxLength"/> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasProperty name="ordered" value="false"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#string"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="preserve" id="string.preserve"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="boolean" id="boolean"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasProperty name="ordered" value="false"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" value="finite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#boolean"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="boolean.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="float" id="float"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasFacet name="maxInclusive"/> + <hfp:hasFacet name="maxExclusive"/> + <hfp:hasFacet name="minInclusive"/> + <hfp:hasFacet name="minExclusive"/> + <hfp:hasProperty name="ordered" value="total"/> + <hfp:hasProperty name="bounded" value="true"/> + <hfp:hasProperty name="cardinality" value="finite"/> + <hfp:hasProperty name="numeric" value="true"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#float"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="float.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="double" id="double"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasFacet name="maxInclusive"/> + <hfp:hasFacet name="maxExclusive"/> + <hfp:hasFacet name="minInclusive"/> + <hfp:hasFacet name="minExclusive"/> + <hfp:hasProperty name="ordered" value="total"/> + <hfp:hasProperty name="bounded" value="true"/> + <hfp:hasProperty name="cardinality" value="finite"/> + <hfp:hasProperty name="numeric" value="true"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#double"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="double.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="decimal" id="decimal"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="totalDigits"/> + <hfp:hasFacet name="fractionDigits"/> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="maxInclusive"/> + <hfp:hasFacet name="maxExclusive"/> + <hfp:hasFacet name="minInclusive"/> + <hfp:hasFacet name="minExclusive"/> + <hfp:hasProperty name="ordered" value="total"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="true"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#decimal"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="decimal.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="duration" id="duration"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasFacet name="maxInclusive"/> + <hfp:hasFacet name="maxExclusive"/> + <hfp:hasFacet name="minInclusive"/> + <hfp:hasFacet name="minExclusive"/> + <hfp:hasProperty name="ordered" value="partial"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#duration"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="duration.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="dateTime" id="dateTime"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasFacet name="maxInclusive"/> + <hfp:hasFacet name="maxExclusive"/> + <hfp:hasFacet name="minInclusive"/> + <hfp:hasFacet name="minExclusive"/> + <hfp:hasProperty name="ordered" value="partial"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#dateTime"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="dateTime.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="time" id="time"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasFacet name="maxInclusive"/> + <hfp:hasFacet name="maxExclusive"/> + <hfp:hasFacet name="minInclusive"/> + <hfp:hasFacet name="minExclusive"/> + <hfp:hasProperty name="ordered" value="partial"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#time"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="time.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="date" id="date"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasFacet name="maxInclusive"/> + <hfp:hasFacet name="maxExclusive"/> + <hfp:hasFacet name="minInclusive"/> + <hfp:hasFacet name="minExclusive"/> + <hfp:hasProperty name="ordered" value="partial"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#date"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="date.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="gYearMonth" id="gYearMonth"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasFacet name="maxInclusive"/> + <hfp:hasFacet name="maxExclusive"/> + <hfp:hasFacet name="minInclusive"/> + <hfp:hasFacet name="minExclusive"/> + <hfp:hasProperty name="ordered" value="partial"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#gYearMonth"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="gYearMonth.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="gYear" id="gYear"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasFacet name="maxInclusive"/> + <hfp:hasFacet name="maxExclusive"/> + <hfp:hasFacet name="minInclusive"/> + <hfp:hasFacet name="minExclusive"/> + <hfp:hasProperty name="ordered" value="partial"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#gYear"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="gYear.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="gMonthDay" id="gMonthDay"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasFacet name="maxInclusive"/> + <hfp:hasFacet name="maxExclusive"/> + <hfp:hasFacet name="minInclusive"/> + <hfp:hasFacet name="minExclusive"/> + <hfp:hasProperty name="ordered" value="partial"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#gMonthDay"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="gMonthDay.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="gDay" id="gDay"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasFacet name="maxInclusive"/> + <hfp:hasFacet name="maxExclusive"/> + <hfp:hasFacet name="minInclusive"/> + <hfp:hasFacet name="minExclusive"/> + <hfp:hasProperty name="ordered" value="partial"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#gDay"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="gDay.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="gMonth" id="gMonth"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasFacet name="maxInclusive"/> + <hfp:hasFacet name="maxExclusive"/> + <hfp:hasFacet name="minInclusive"/> + <hfp:hasFacet name="minExclusive"/> + <hfp:hasProperty name="ordered" value="partial"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#gMonth"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="gMonth.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="hexBinary" id="hexBinary"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="length"/> + <hfp:hasFacet name="minLength"/> + <hfp:hasFacet name="maxLength"/> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasProperty name="ordered" value="false"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#binary"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="hexBinary.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="base64Binary" id="base64Binary"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="length"/> + <hfp:hasFacet name="minLength"/> + <hfp:hasFacet name="maxLength"/> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasProperty name="ordered" value="false"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#base64Binary"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="base64Binary.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="anyURI" id="anyURI"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="length"/> + <hfp:hasFacet name="minLength"/> + <hfp:hasFacet name="maxLength"/> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasProperty name="ordered" value="false"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#anyURI"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="anyURI.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="QName" id="QName"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="length"/> + <hfp:hasFacet name="minLength"/> + <hfp:hasFacet name="maxLength"/> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasProperty name="ordered" value="false"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#QName"/> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="QName.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="NOTATION" id="NOTATION"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="length"/> + <hfp:hasFacet name="minLength"/> + <hfp:hasFacet name="maxLength"/> + <hfp:hasFacet name="pattern"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasProperty name="ordered" value="false"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#NOTATION"/> + <xsd:documentation> + NOTATION cannot be used directly in a schema; rather a type + must be derived from it by specifying at least one enumeration + facet whose value is the name of a NOTATION declared in the + schema. + </xsd:documentation> + </xsd:annotation> + <xsd:restriction base="xsd:anySimpleType"> + <xsd:whiteSpace value="collapse" fixed="true" + id="NOTATION.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:annotation> + <xsd:documentation> + Now the derived primitive types + </xsd:documentation> + </xsd:annotation> + + <xsd:simpleType name="normalizedString" id="normalizedString"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#normalizedString"/> + </xsd:annotation> + <xsd:restriction base="xsd:string"> + <xsd:whiteSpace value="replace" + id="normalizedString.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="token" id="token"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#token"/> + </xsd:annotation> + <xsd:restriction base="xsd:normalizedString"> + <xsd:whiteSpace value="collapse" id="token.whiteSpace"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="language" id="language"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#language"/> + </xsd:annotation> + <xsd:restriction base="xsd:token"> + <xsd:pattern + value="[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*" + id="language.pattern"> + <xsd:annotation> + <xsd:documentation + source="http://www.ietf.org/rfc/rfc3066.txt"> + pattern specifies the content of section 2.12 of XML 1.0e2 + and RFC 3066 (Revised version of RFC 1766). + </xsd:documentation> + </xsd:annotation> + </xsd:pattern> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="IDREFS" id="IDREFS"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="length"/> + <hfp:hasFacet name="minLength"/> + <hfp:hasFacet name="maxLength"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasFacet name="pattern"/> + <hfp:hasProperty name="ordered" value="false"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#IDREFS"/> + </xsd:annotation> + <xsd:restriction> + <xsd:simpleType> + <xsd:list itemType="xsd:IDREF"/> + </xsd:simpleType> + <xsd:minLength value="1" id="IDREFS.minLength"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="ENTITIES" id="ENTITIES"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="length"/> + <hfp:hasFacet name="minLength"/> + <hfp:hasFacet name="maxLength"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasFacet name="pattern"/> + <hfp:hasProperty name="ordered" value="false"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#ENTITIES"/> + </xsd:annotation> + <xsd:restriction> + <xsd:simpleType> + <xsd:list itemType="xsd:ENTITY"/> + </xsd:simpleType> + <xsd:minLength value="1" id="ENTITIES.minLength"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="NMTOKEN" id="NMTOKEN"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#NMTOKEN"/> + </xsd:annotation> + <xsd:restriction base="xsd:token"> + <xsd:pattern value="\c+" id="NMTOKEN.pattern"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/REC-xml#NT-Nmtoken"> + pattern matches production 7 from the XML spec + </xsd:documentation> + </xsd:annotation> + </xsd:pattern> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="NMTOKENS" id="NMTOKENS"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasFacet name="length"/> + <hfp:hasFacet name="minLength"/> + <hfp:hasFacet name="maxLength"/> + <hfp:hasFacet name="enumeration"/> + <hfp:hasFacet name="whiteSpace"/> + <hfp:hasFacet name="pattern"/> + <hfp:hasProperty name="ordered" value="false"/> + <hfp:hasProperty name="bounded" value="false"/> + <hfp:hasProperty name="cardinality" + value="countably infinite"/> + <hfp:hasProperty name="numeric" value="false"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#NMTOKENS"/> + </xsd:annotation> + <xsd:restriction> + <xsd:simpleType> + <xsd:list itemType="xsd:NMTOKEN"/> + </xsd:simpleType> + <xsd:minLength value="1" id="NMTOKENS.minLength"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="Name" id="Name"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#Name"/> + </xsd:annotation> + <xsd:restriction base="xsd:token"> + <xsd:pattern value="\i\c*" id="Name.pattern"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/REC-xml#NT-Name"> + pattern matches production 5 from the XML spec + </xsd:documentation> + </xsd:annotation> + </xsd:pattern> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="NCName" id="NCName"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#NCName"/> + </xsd:annotation> + <xsd:restriction base="xsd:Name"> + <xsd:pattern value="[\i-[:]][\c-[:]]*" id="NCName.pattern"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/REC-xml-names/#NT-NCName"> + pattern matches production 4 from the Namespaces in XML spec + </xsd:documentation> + </xsd:annotation> + </xsd:pattern> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="ID" id="ID"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#ID"/> + </xsd:annotation> + <xsd:restriction base="xsd:NCName"/> + </xsd:simpleType> + + <xsd:simpleType name="IDREF" id="IDREF"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#IDREF"/> + </xsd:annotation> + <xsd:restriction base="xsd:NCName"/> + </xsd:simpleType> + + <xsd:simpleType name="ENTITY" id="ENTITY"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#ENTITY"/> + </xsd:annotation> + <xsd:restriction base="xsd:NCName"/> + </xsd:simpleType> + + <xsd:simpleType name="integer" id="integer"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#integer"/> + </xsd:annotation> + <xsd:restriction base="xsd:decimal"> + <xsd:fractionDigits value="0" fixed="true" id="integer.fractionDigits"/> + <xsd:pattern value="[\-+]?[0-9]+"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="nonPositiveInteger" id="nonPositiveInteger"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#nonPositiveInteger"/> + </xsd:annotation> + <xsd:restriction base="xsd:integer"> + <xsd:maxInclusive value="0" id="nonPositiveInteger.maxInclusive"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="negativeInteger" id="negativeInteger"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#negativeInteger"/> + </xsd:annotation> + <xsd:restriction base="xsd:nonPositiveInteger"> + <xsd:maxInclusive value="-1" id="negativeInteger.maxInclusive"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="long" id="long"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasProperty name="bounded" value="true"/> + <hfp:hasProperty name="cardinality" value="finite"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#long"/> + </xsd:annotation> + <xsd:restriction base="xsd:integer"> + <xsd:minInclusive value="-9223372036854775808" id="long.minInclusive"/> + <xsd:maxInclusive value="9223372036854775807" id="long.maxInclusive"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="int" id="int"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#int"/> + </xsd:annotation> + <xsd:restriction base="xsd:long"> + <xsd:minInclusive value="-2147483648" id="int.minInclusive"/> + <xsd:maxInclusive value="2147483647" id="int.maxInclusive"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="short" id="short"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#short"/> + </xsd:annotation> + <xsd:restriction base="xsd:int"> + <xsd:minInclusive value="-32768" id="short.minInclusive"/> + <xsd:maxInclusive value="32767" id="short.maxInclusive"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="byte" id="byte"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#byte"/> + </xsd:annotation> + <xsd:restriction base="xsd:short"> + <xsd:minInclusive value="-128" id="byte.minInclusive"/> + <xsd:maxInclusive value="127" id="byte.maxInclusive"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="nonNegativeInteger" id="nonNegativeInteger"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger"/> + </xsd:annotation> + <xsd:restriction base="xsd:integer"> + <xsd:minInclusive value="0" id="nonNegativeInteger.minInclusive"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="unsignedLong" id="unsignedLong"> + <xsd:annotation> + <xsd:appinfo> + <hfp:hasProperty name="bounded" value="true"/> + <hfp:hasProperty name="cardinality" value="finite"/> + </xsd:appinfo> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#unsignedLong"/> + </xsd:annotation> + <xsd:restriction base="xsd:nonNegativeInteger"> + <xsd:maxInclusive value="18446744073709551615" + id="unsignedLong.maxInclusive"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="unsignedInt" id="unsignedInt"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#unsignedInt"/> + </xsd:annotation> + <xsd:restriction base="xsd:unsignedLong"> + <xsd:maxInclusive value="4294967295" + id="unsignedInt.maxInclusive"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="unsignedShort" id="unsignedShort"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#unsignedShort"/> + </xsd:annotation> + <xsd:restriction base="xsd:unsignedInt"> + <xsd:maxInclusive value="65535" + id="unsignedShort.maxInclusive"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="unsignedByte" id="unsignedByte"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#unsignedByte"/> + </xsd:annotation> + <xsd:restriction base="xsd:unsignedShort"> + <xsd:maxInclusive value="255" id="unsignedByte.maxInclusive"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="positiveInteger" id="positiveInteger"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#positiveInteger"/> + </xsd:annotation> + <xsd:restriction base="xsd:nonNegativeInteger"> + <xsd:minInclusive value="1" id="positiveInteger.minInclusive"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="derivationControl"> + <xsd:annotation> + <xsd:documentation> + A utility type, not for public use</xsd:documentation> + </xsd:annotation> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="substitution"/> + <xsd:enumeration value="extension"/> + <xsd:enumeration value="restriction"/> + <xsd:enumeration value="list"/> + <xsd:enumeration value="union"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:group name="simpleDerivation"> + <xsd:choice> + <xsd:element ref="xsd:restriction"/> + <xsd:element ref="xsd:list"/> + <xsd:element ref="xsd:union"/> + </xsd:choice> + </xsd:group> + + <xsd:simpleType name="simpleDerivationSet"> + <xsd:annotation> + <xsd:documentation> + #all or (possibly empty) subset of {restriction, union, list} + </xsd:documentation> + <xsd:documentation> + A utility type, not for public use</xsd:documentation> + </xsd:annotation> + <xsd:union> + <xsd:simpleType> + <xsd:restriction base="xsd:token"> + <xsd:enumeration value="#all"/> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType> + <xsd:list> + <xsd:simpleType> + <xsd:restriction base="xsd:derivationControl"> + <xsd:enumeration value="list"/> + <xsd:enumeration value="union"/> + <xsd:enumeration value="restriction"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:list> + </xsd:simpleType> + </xsd:union> + </xsd:simpleType> + + <xsd:complexType name="simpleType" abstract="true"> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:group ref="xsd:simpleDerivation"/> + <xsd:attribute name="final" type="xsd:simpleDerivationSet"/> + <xsd:attribute name="name" type="xsd:NCName"> + <xsd:annotation> + <xsd:documentation> + Can be restricted to required or forbidden + </xsd:documentation> + </xsd:annotation> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="topLevelSimpleType"> + <xsd:complexContent> + <xsd:restriction base="xsd:simpleType"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + <xsd:group ref="xsd:simpleDerivation"/> + </xsd:sequence> + <xsd:attribute name="name" use="required" + type="xsd:NCName"> + <xsd:annotation> + <xsd:documentation> + Required at the top level + </xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="localSimpleType"> + <xsd:complexContent> + <xsd:restriction base="xsd:simpleType"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + <xsd:group ref="xsd:simpleDerivation"/> + </xsd:sequence> + <xsd:attribute name="name" use="prohibited"> + <xsd:annotation> + <xsd:documentation> + Forbidden when nested + </xsd:documentation> + </xsd:annotation> + </xsd:attribute> + <xsd:attribute name="final" use="prohibited"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:element name="simpleType" type="xsd:topLevelSimpleType" id="simpleType"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#element-simpleType"/> + </xsd:annotation> + </xsd:element> + + <xsd:group name="facets"> + <xsd:annotation> + <xsd:documentation> + We should use a substitution group for facets, but + that's ruled out because it would allow users to + add their own, which we're not ready for yet. + </xsd:documentation> + </xsd:annotation> + <xsd:choice> + <xsd:element ref="xsd:minExclusive"/> + <xsd:element ref="xsd:minInclusive"/> + <xsd:element ref="xsd:maxExclusive"/> + <xsd:element ref="xsd:maxInclusive"/> + <xsd:element ref="xsd:totalDigits"/> + <xsd:element ref="xsd:fractionDigits"/> + <xsd:element ref="xsd:length"/> + <xsd:element ref="xsd:minLength"/> + <xsd:element ref="xsd:maxLength"/> + <xsd:element ref="xsd:enumeration"/> + <xsd:element ref="xsd:whiteSpace"/> + <xsd:element ref="xsd:pattern"/> + </xsd:choice> + </xsd:group> + + <xsd:group name="simpleRestrictionModel"> + <xsd:sequence> + <xsd:element name="simpleType" type="xsd:localSimpleType" minOccurs="0"/> + <xsd:group ref="xsd:facets" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + </xsd:group> + + <xsd:element name="restriction" id="restriction"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#element-restriction"> + base attribute and simpleType child are mutually + exclusive, but one or other is required + </xsd:documentation> + </xsd:annotation> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:group ref="xsd:simpleRestrictionModel"/> + <xsd:attribute name="base" type="xsd:QName" use="optional"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="list" id="list"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#element-list"> + itemType attribute and simpleType child are mutually + exclusive, but one or other is required + </xsd:documentation> + </xsd:annotation> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:sequence> + <xsd:element name="simpleType" type="xsd:localSimpleType" + minOccurs="0"/> + </xsd:sequence> + <xsd:attribute name="itemType" type="xsd:QName" use="optional"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="union" id="union"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#element-union"> + memberTypes attribute must be non-empty or there must be + at least one simpleType child + </xsd:documentation> + </xsd:annotation> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:sequence> + <xsd:element name="simpleType" type="xsd:localSimpleType" + minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="memberTypes" use="optional"> + <xsd:simpleType> + <xsd:list itemType="xsd:QName"/> + </xsd:simpleType> + </xsd:attribute> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="facet"> + <xsd:complexContent> + <xsd:extension base="xsd:annotated"> + <xsd:attribute name="value" use="required"/> + <xsd:attribute name="fixed" type="xsd:boolean" use="optional" + default="false"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="noFixedFacet"> + <xsd:complexContent> + <xsd:restriction base="xsd:facet"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + </xsd:sequence> + <xsd:attribute name="fixed" use="prohibited"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:element name="minExclusive" id="minExclusive" type="xsd:facet"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#element-minExclusive"/> + </xsd:annotation> + </xsd:element> + <xsd:element name="minInclusive" id="minInclusive" type="xsd:facet"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#element-minInclusive"/> + </xsd:annotation> + </xsd:element> + + <xsd:element name="maxExclusive" id="maxExclusive" type="xsd:facet"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#element-maxExclusive"/> + </xsd:annotation> + </xsd:element> + <xsd:element name="maxInclusive" id="maxInclusive" type="xsd:facet"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#element-maxInclusive"/> + </xsd:annotation> + </xsd:element> + + <xsd:complexType name="numFacet"> + <xsd:complexContent> + <xsd:restriction base="xsd:facet"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + </xsd:sequence> + <xsd:attribute name="value" type="xsd:nonNegativeInteger" use="required"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:element name="totalDigits" id="totalDigits"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#element-totalDigits"/> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:restriction base="xsd:numFacet"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + </xsd:sequence> + <xsd:attribute name="value" type="xsd:positiveInteger" use="required"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + <xsd:element name="fractionDigits" id="fractionDigits" type="xsd:numFacet"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#element-fractionDigits"/> + </xsd:annotation> + </xsd:element> + + <xsd:element name="length" id="length" type="xsd:numFacet"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#element-length"/> + </xsd:annotation> + </xsd:element> + <xsd:element name="minLength" id="minLength" type="xsd:numFacet"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#element-minLength"/> + </xsd:annotation> + </xsd:element> + <xsd:element name="maxLength" id="maxLength" type="xsd:numFacet"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#element-maxLength"/> + </xsd:annotation> + </xsd:element> + + <xsd:element name="enumeration" id="enumeration" type="xsd:noFixedFacet"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#element-enumeration"/> + </xsd:annotation> + </xsd:element> + + <xsd:element name="whiteSpace" id="whiteSpace"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#element-whiteSpace"/> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:restriction base="xsd:facet"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + </xsd:sequence> + <xsd:attribute name="value" use="required"> + <xsd:simpleType> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="preserve"/> + <xsd:enumeration value="replace"/> + <xsd:enumeration value="collapse"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + + <xsd:element name="pattern" id="pattern"> + <xsd:annotation> + <xsd:documentation + source="http://www.w3.org/TR/xmlschema-2/#element-pattern"/> + </xsd:annotation> + <xsd:complexType> + <xsd:complexContent> + <xsd:restriction base="xsd:noFixedFacet"> + <xsd:sequence> + <xsd:element ref="xsd:annotation" minOccurs="0"/> + </xsd:sequence> + <xsd:attribute name="value" type="xsd:string" use="required"/> + <xsd:anyAttribute namespace="##other" processContents="lax"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + </xsd:element> + +</xsd:schema> diff --git a/Klausuren/Sda1/2019summer/Exam/src/main/resources/log4j2.xml b/Klausuren/Sda1/2019summer/Exam/src/main/resources/log4j2.xml new file mode 100644 index 0000000000000000000000000000000000000000..e64f0bd8b45a5a75eb455f18bb1fbf4f05736953 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/src/main/resources/log4j2.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Configuration> + <Appenders> + <File name="A1" fileName="A1.log" append="false"> + <PatternLayout pattern="%t %-5p %c{2} - %m%n"/> + </File> + <Console name="STDOUT" target="SYSTEM_OUT"> + <PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/> + </Console> + </Appenders> + <Loggers> + <!-- You may want to enable more detailed hibernate logging --> + <Logger name="org.hibernate" level="error"> + <AppenderRef ref="A1"/> + </Logger> + <Root level="info"> + <AppenderRef ref="STDOUT"/> + </Root> + </Loggers> +</Configuration> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/src/main/resources/xml.xsd b/Klausuren/Sda1/2019summer/Exam/src/main/resources/xml.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e60e8c5981266215cba190f36b070b758b05c47b --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/src/main/resources/xml.xsd @@ -0,0 +1,286 @@ +<?xml version='1.0'?> +<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns ="http://www.w3.org/1999/xhtml" + xml:lang="en"> + + <xs:annotation> + <xs:documentation> + <div> + <h1>About the XML namespace</h1> + + <div class="bodytext"> + <p> + This schema document describes the XML namespace, in a form + suitable for import by other schema documents. + </p> + <p> + See <a href="http://www.w3.org/XML/1998/namespace.html"> + http://www.w3.org/XML/1998/namespace.html</a> and + <a href="http://www.w3.org/TR/REC-xml"> + http://www.w3.org/TR/REC-xml</a> for information + about this namespace. + </p> + <p> + Note that local names in this namespace are intended to be + defined only by the World Wide Web Consortium or its subgroups. + The names currently defined in this namespace are listed below. + They should not be used with conflicting semantics by any Working + Group, specification, or document instance. + </p> + <p> + See further below in this document for more information about <a + href="#usage">how to refer to this schema document from your own + XSD schema documents</a> and about <a href="#nsversioning">the + namespace-versioning policy governing this schema document</a>. + </p> + </div> + </div> + </xs:documentation> + </xs:annotation> + + <xs:attribute name="lang"> + <xs:annotation> + <xs:documentation> + <div> + + <h3>lang (as an attribute name)</h3> + <p> + denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification.</p> + + </div> + <div> + <h4>Notes</h4> + <p> + Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. + </p> + <p> + See BCP 47 at <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt"> + http://www.rfc-editor.org/rfc/bcp/bcp47.txt</a> + and the IANA language subtag registry at + <a href="http://www.iana.org/assignments/language-subtag-registry"> + http://www.iana.org/assignments/language-subtag-registry</a> + for further information. + </p> + <p> + The union allows for the 'un-declaration' of xml:lang with + the empty string. + </p> + </div> + </xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:union memberTypes="xs:language"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value=""/> + </xs:restriction> + </xs:simpleType> + </xs:union> + </xs:simpleType> + </xs:attribute> + + <xs:attribute name="space"> + <xs:annotation> + <xs:documentation> + <div> + + <h3>space (as an attribute name)</h3> + <p> + denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification.</p> + + </div> + </xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:restriction base="xs:NCName"> + <xs:enumeration value="default"/> + <xs:enumeration value="preserve"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + + <xs:attribute name="base" type="xs:anyURI"> <xs:annotation> + <xs:documentation> + <div> + + <h3>base (as an attribute name)</h3> + <p> + denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification.</p> + + <p> + See <a + href="http://www.w3.org/TR/xmlbase/">http://www.w3.org/TR/xmlbase/</a> + for information about this attribute. + </p> + </div> + </xs:documentation> + </xs:annotation> + </xs:attribute> + + <xs:attribute name="id" type="xs:ID"> + <xs:annotation> + <xs:documentation> + <div> + + <h3>id (as an attribute name)</h3> + <p> + denotes an attribute whose value + should be interpreted as if declared to be of type ID. + This name is reserved by virtue of its definition in the + xml:id specification.</p> + + <p> + See <a + href="http://www.w3.org/TR/xml-id/">http://www.w3.org/TR/xml-id/</a> + for information about this attribute. + </p> + </div> + </xs:documentation> + </xs:annotation> + </xs:attribute> + + <xs:attributeGroup name="specialAttrs"> + <xs:attribute ref="xml:base"/> + <xs:attribute ref="xml:lang"/> + <xs:attribute ref="xml:space"/> + <xs:attribute ref="xml:id"/> + </xs:attributeGroup> + + <xs:annotation> + <xs:documentation> + <div> + + <h3>Father (in any context at all)</h3> + + <div class="bodytext"> + <p> + denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: + </p> + <blockquote> + <p> + In appreciation for his vision, leadership and + dedication the W3C XML Plenary on this 10th day of + February, 2000, reserves for Jon Bosak in perpetuity + the XML name "xml:Father". + </p> + </blockquote> + </div> + </div> + </xs:documentation> + </xs:annotation> + + <xs:annotation> + <xs:documentation> + <div xml:id="usage" id="usage"> + <h2><a name="usage">About this schema document</a></h2> + + <div class="bodytext"> + <p> + This schema defines attributes and an attribute group suitable + for use by schemas wishing to allow <code>xml:base</code>, + <code>xml:lang</code>, <code>xml:space</code> or + <code>xml:id</code> attributes on elements they define. + </p> + <p> + To enable this, such a schema must import this schema for + the XML namespace, e.g. as follows: + </p> + <pre> + <schema . . .> + . . . + <import namespace="http://www.w3.org/XML/1998/namespace" + schemaLocation="http://www.w3.org/2001/xml.xsd"/> + </pre> + <p> + or + </p> + <pre> + <import namespace="http://www.w3.org/XML/1998/namespace" + schemaLocation="http://www.w3.org/2009/01/xml.xsd"/> + </pre> + <p> + Subsequently, qualified reference to any of the attributes or the + group defined below will have the desired effect, e.g. + </p> + <pre> + <type . . .> + . . . + <attributeGroup ref="xml:specialAttrs"/> + </pre> + <p> + will define a type which will schema-validate an instance element + with any of those attributes. + </p> + </div> + </div> + </xs:documentation> + </xs:annotation> + + <xs:annotation> + <xs:documentation> + <div id="nsversioning" xml:id="nsversioning"> + <h2><a name="nsversioning">Versioning policy for this schema document</a></h2> + <div class="bodytext"> + <p> + In keeping with the XML Schema WG's standard versioning + policy, this schema document will persist at + <a href="http://www.w3.org/2009/01/xml.xsd"> + http://www.w3.org/2009/01/xml.xsd</a>. + </p> + <p> + At the date of issue it can also be found at + <a href="http://www.w3.org/2001/xml.xsd"> + http://www.w3.org/2001/xml.xsd</a>. + </p> + <p> + The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML + Schema itself, or with the XML namespace itself. In other words, + if the XML Schema or XML namespaces change, the version of this + document at <a href="http://www.w3.org/2001/xml.xsd"> + http://www.w3.org/2001/xml.xsd + </a> + will change accordingly; the version at + <a href="http://www.w3.org/2009/01/xml.xsd"> + http://www.w3.org/2009/01/xml.xsd + </a> + will not change. + </p> + <p> + Previous dated (and unchanging) versions of this schema + document are at: + </p> + <ul> + <li><a href="http://www.w3.org/2009/01/xml.xsd"> + http://www.w3.org/2009/01/xml.xsd</a></li> + <li><a href="http://www.w3.org/2007/08/xml.xsd"> + http://www.w3.org/2007/08/xml.xsd</a></li> + <li><a href="http://www.w3.org/2004/10/xml.xsd"> + http://www.w3.org/2004/10/xml.xsd</a></li> + <li><a href="http://www.w3.org/2001/03/xml.xsd"> + http://www.w3.org/2001/03/xml.xsd</a></li> + </ul> + </div> + </div> + </xs:documentation> + </xs:annotation> + +</xs:schema> + diff --git a/Klausuren/Sda1/2019summer/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/test/ex1/SchemaTest.java b/Klausuren/Sda1/2019summer/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/test/ex1/SchemaTest.java new file mode 100644 index 0000000000000000000000000000000000000000..555f20801ff84c956d8825a098db68064c27b0ec --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/test/ex1/SchemaTest.java @@ -0,0 +1,159 @@ +package de.hdm_stuttgart.mi.sda1.test.ex1; + +import de.hdm_stuttgart.mi.exam.unitmarking.ExaminationTestDefaults; +import de.hdm_stuttgart.mi.exam.unitmarking.Marking; +import de.hdm_stuttgart.mi.exam.unitmarking.xml.XmlTestSupport; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +/** + * Generated by de.hdm_stuttgart.mi.unitmarking.xsd.GenerateUnitTestClass + * + * Unit test for an XML instance set. CLI by: + * java -cp target/...-fat-tests.jar org.junit.runner.JUnitCore SchemaTest + */ +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +@SuppressWarnings("static-method") +public class SchemaTest extends ExaminationTestDefaults { + + private final XmlTestSupport xmlTestSupport = new XmlTestSupport("SchemaTest"); + + @Test @Marking(points = 1) + public void test_0100validMinimum() { + xmlTestSupport.assertValid("0100validMinimum.xml"); + } + + @Test @Marking(points = 1) + public void test_0101_duplicateArticles() { + xmlTestSupport.assertInvalid("0101_duplicateArticles.xml"); + xmlTestSupport.assertValid("0100validMinimum.xml"); + } + + @Test @Marking(points = 1) + public void test_0101_duplicateCategories() { + xmlTestSupport.assertInvalid("0101_duplicateCategories.xml"); + xmlTestSupport.assertValid("0100validMinimum.xml"); + } + + @Test @Marking(points = 1) + public void test_0101_missingArticles() { + xmlTestSupport.assertInvalid("0101_missingArticles.xml"); + xmlTestSupport.assertValid("0100validMinimum.xml"); + } + + @Test @Marking(points = 1) + public void test_0101_missingCategories() { + xmlTestSupport.assertInvalid("0101_missingCategories.xml"); + xmlTestSupport.assertValid("0100validMinimum.xml"); + } + + @Test @Marking(points = 1) + public void test_0110validSingleCategory() { + xmlTestSupport.assertValid("0110validSingleCategory.xml"); + } + + @Test @Marking(points = 2) + public void test_0111_invalid_EmptyIdValue() { + xmlTestSupport.assertInvalid("0111_invalid_EmptyIdValue.xml"); + xmlTestSupport.assertValid("0110validSingleCategory.xml"); + } + + @Test @Marking(points = 2) + public void test_0111_invalid_missing_id() { + xmlTestSupport.assertInvalid("0111_invalid_missing_id.xml"); + xmlTestSupport.assertValid("0110validSingleCategory.xml"); + } + + @Test @Marking(points = 1) + public void test_0111_invalid_whitespaceInId() { + xmlTestSupport.assertInvalid("0111_invalid_whitespaceInId.xml"); + xmlTestSupport.assertValid("0110validSingleCategory.xml"); + } + + @Test @Marking(points = 1) + public void test_0120validMultiCategory() { + xmlTestSupport.assertValid("0120validMultiCategory.xml"); + } + + @Test @Marking(points = 2) + public void test_0121_invalidDuplicateCategoryId() { + xmlTestSupport.assertInvalid("0121_invalidDuplicateCategoryId.xml"); + xmlTestSupport.assertValid("0120validMultiCategory.xml"); + } + + @Test @Marking(points = 1) + public void test_0150validMinimumArticle() { + xmlTestSupport.assertValid("0150validMinimumArticle.xml"); + } + + @Test @Marking(points = 2) + public void test_0151_invalidMissingOrderNo() { + xmlTestSupport.assertInvalid("0151_invalidMissingOrderNo.xml"); + xmlTestSupport.assertValid("0150validMinimumArticle.xml"); + } + + @Test @Marking(points = 1) + public void test_0151_invalidNegativeOrderNo() { + xmlTestSupport.assertInvalid("0151_invalidNegativeOrderNo.xml"); + xmlTestSupport.assertValid("0150validMinimumArticle.xml"); + } + + @Test @Marking(points = 1) + public void test_0151_invalidZeroOrderNo() { + xmlTestSupport.assertInvalid("0151_invalidZeroOrderNo.xml"); + xmlTestSupport.assertValid("0150validMinimumArticle.xml"); + } + + @Test @Marking(points = 1) + public void test_0160validFullArticle() { + xmlTestSupport.assertValid("0160validFullArticle.xml"); + } + + @Test @Marking(points = 1) + public void test_0161_invalidDuplicateDescription() { + xmlTestSupport.assertInvalid("0161_invalidDuplicateDescription.xml"); + xmlTestSupport.assertValid("0160validFullArticle.xml"); + } + + @Test @Marking(points = 2) + public void test_0161_invalidMissingSource() { + xmlTestSupport.assertInvalid("0161_invalidMissingSource.xml"); + xmlTestSupport.assertValid("0160validFullArticle.xml"); + } + + @Test @Marking(points = 1) + public void test_0161_invalidMissingType() { + xmlTestSupport.assertInvalid("0161_invalidMissingType.xml"); + xmlTestSupport.assertValid("0160validFullArticle.xml"); + } + + @Test @Marking(points = 1) + public void test_0161_invalidWrongImgType() { + xmlTestSupport.assertInvalid("0161_invalidWrongImgType.xml"); + xmlTestSupport.assertValid("0160validFullArticle.xml"); + } + + @Test @Marking(points = 2) + public void test_02001_invalidDanglingReference() { + xmlTestSupport.assertInvalid("02001_invalidDanglingReference.xml"); + xmlTestSupport.assertValid("0200validTwoArticles.xml"); + } + + @Test @Marking(points = 1) + public void test_02001_invalidDuplicateCat() { + xmlTestSupport.assertInvalid("02001_invalidDuplicateCat.xml"); + xmlTestSupport.assertValid("0200validTwoArticles.xml"); + } + + @Test @Marking(points = 1) + public void test_02001_invalidMissingCatRef() { + xmlTestSupport.assertInvalid("02001_invalidMissingCatRef.xml"); + xmlTestSupport.assertValid("0200validTwoArticles.xml"); + } + + @Test @Marking(points = 1) + public void test_0200validTwoArticles() { + xmlTestSupport.assertValid("0200validTwoArticles.xml"); + } +} \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/test/ex1/ShowReachedPoints.java b/Klausuren/Sda1/2019summer/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/test/ex1/ShowReachedPoints.java new file mode 100644 index 0000000000000000000000000000000000000000..f65ccfbed8614fe33712c682ccffe7d703661217 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/test/ex1/ShowReachedPoints.java @@ -0,0 +1,22 @@ +package de.hdm_stuttgart.mi.sda1.test.ex1; + +import de.hdm_stuttgart.mi.exam.unitmarking.RunTests; + +/** + * Unit test for an XML instance set. CLI by: + * java -cp target/solvejpa-0.9-fat-tests.jar org.junit.runner.JUnitCore ShowReachedPoints + */ +@SuppressWarnings("static-method") +public class ShowReachedPoints { + /** + * Execution reveals the number of reached points. + * + * @param args Unused + */ + public static void main(String[] args) { + RunTests.exec( + "Aufgabe 1", + SchemaTest.class + ); + } +} \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Solve/.gitignore b/Klausuren/Sda1/2019summer/Solve/.gitignore new file mode 120000 index 0000000000000000000000000000000000000000..38be189b78311ce6d01098b1d20f8bb0dfcf59b6 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Solve/.gitignore @@ -0,0 +1 @@ +../Exam/.gitignore \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Solve/Schema/catalog.xsd b/Klausuren/Sda1/2019summer/Solve/Schema/catalog.xsd new file mode 100644 index 0000000000000000000000000000000000000000..197a404eb137a27200c3af9634b3a34a6595e641 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Solve/Schema/catalog.xsd @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > + + <xs:element name="catalog"> + <xs:complexType> + <xs:sequence> + <xs:element ref="categories"/> + <xs:element ref="articles"/> + </xs:sequence> + </xs:complexType> + + <xs:unique name="uniqueCategoryName"> + <xs:selector xpath="categories/category"/> + <xs:field xpath="@id"/> + </xs:unique> + + <xs:keyref refer="uniqueCategoryName" name="categoryOfArticle"> + <xs:selector xpath="articles/article/cat"/> + <xs:field xpath="."/> + </xs:keyref> + </xs:element> + + <xs:element name="category"> + <xs:complexType> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute name="id" type="xs:NMTOKEN" use="required"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + </xs:element> + + <xs:element name="categories"> + <xs:complexType> + <xs:sequence> + <xs:element ref="category" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + + + <xs:element name="img"> + <xs:complexType> + <xs:attribute name="src" type="xs:string" use="required"/> + <xs:attribute name="type" use="required"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="png"/> + <xs:enumeration value="gif"/> + <xs:enumeration value="svg"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + </xs:complexType> + </xs:element> + + <xs:element name="article"> + <xs:complexType> + <xs:sequence> + <xs:element name="name" type="xs:string"/> + <xs:element name="cat" type="xs:NMTOKEN" maxOccurs="unbounded"/> + <xs:element name="description" type="xs:string" minOccurs="0"/> + <xs:element ref="img" minOccurs="0"/> + </xs:sequence> + <xs:attribute name="orderNo" type="xs:positiveInteger" use="required"/> + </xs:complexType> + <xs:unique name="uniqueCategoryRef"> + <xs:selector xpath="cat"/> + <xs:field xpath="."/> + </xs:unique> + </xs:element> + + <xs:element name="articles"> + <xs:complexType> + <xs:sequence> + <xs:element ref="article" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + +</xs:schema> \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Solve/Schema/sampledata.xml b/Klausuren/Sda1/2019summer/Solve/Schema/sampledata.xml new file mode 120000 index 0000000000000000000000000000000000000000..da20ee4641c2d111822f307e0a5e40614fbb9543 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Solve/Schema/sampledata.xml @@ -0,0 +1 @@ +../../Exam/Schema/sampledata.xml \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Solve/Schema/schema.sql b/Klausuren/Sda1/2019summer/Solve/Schema/schema.sql new file mode 100644 index 0000000000000000000000000000000000000000..4004272a33e7a3b1141f3921ef520eb61b4acbea --- /dev/null +++ b/Klausuren/Sda1/2019summer/Solve/Schema/schema.sql @@ -0,0 +1,66 @@ +DROP TABLE IF EXISTS Category2Article; +DROP TABLE IF EXISTS Article; +DROP TABLE IF EXISTS Category; + +CREATE TABLE Category +( + id VARCHAR(255) PRIMARY KEY, + title TEXT NOT NULL +); + +CREATE TABLE Article +( + orderNo INT NOT NULL CHECK (0 < orderNo) PRIMARY KEY, + + name TEXT NOT NULL, + description TEXT NULL, + + img VARCHAR(255) NULL, + imgType CHAR(3) NULL CHECK ((imgType ISNULL) OR (imgType IN ('png', 'gif', 'svg'))), /* better use enum? */ + + CONSTRAINT imageNameAndTypeInSync + CHECK ( (img IS NOT NULL AND imgType IS NOT NULL) OR + (img ISNULL AND imgType ISNULL) ) +); + +CREATE TABLE Category2Article +( + category VARCHAR(255) NOT NULL REFERENCES Category, + orderNo INT NOT NULL REFERENCES Article, + PRIMARY KEY (category, orderNo) +); + +/* Inserting categories */ +INSERT INTO Category +VALUES ('food', 'Food and drinking'); + +INSERT INTO Category +VALUES ('hardware', 'Tools, DIY'); + +INSERT INTO Category +VALUES ('lifestyle', 'Lifestyle products'); + + +/* Inserting articles */ +INSERT INTO Article +VALUES (232434, 'Super 3D Tin Lunch Box', NULL, '232434_1', 'png'); + +INSERT INTO Article +VALUES (544343, 'Monthly beer subscription box', 'Various brands and flavours on offer.', NULL, NULL); + +/* Relating categories and articles */ +INSERT INTO Category2Article +VALUES ('lifestyle', 232434); + +INSERT INTO Category2Article +VALUES ('hardware', 232434); + +INSERT INTO Category2Article +VALUES ('food', 544343); + +SELECT * +FROM Category; +SELECT * +FROM Article; +SELECT * +FROM Category2Article; \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Solve/SchemaTest b/Klausuren/Sda1/2019summer/Solve/SchemaTest new file mode 120000 index 0000000000000000000000000000000000000000..d6eb4b7c5492ca554fff055a638793a987f4b0a8 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Solve/SchemaTest @@ -0,0 +1 @@ +../Exam/SchemaTest/ \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Solve/pom.xml b/Klausuren/Sda1/2019summer/Solve/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..f99d5d37d9ccf070ad851150eb3dae6576bf208a --- /dev/null +++ b/Klausuren/Sda1/2019summer/Solve/pom.xml @@ -0,0 +1,174 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>de.hdm_stuttgart.mi.sda1</groupId> + <artifactId>sda1_summer2019_solve</artifactId> + <version>0.9</version> + <packaging>jar</packaging> + + <name>sda1_summer2019_solve</name> + + <url>https://freedocs.mi.hdm-stuttgart.de/sd1_sect_mavenCli.html</url> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <oxygenxml.version>21.1.0.0</oxygenxml.version> + </properties> + + <repositories> + + <repository> + <id>hdm-mi-internal-maven-repo</id> + <url>https://maven.mi.hdm-stuttgart.de/nexus/repository/mi-maven</url> + </repository> + <repository> + <id>oxygenxml-repo</id> + <url>https://maven.mi.hdm-stuttgart.de/nexus/repository/oxygen</url> + </repository> + </repositories> + + <dependencies> + + <dependency> + <groupId>com.oxygenxml</groupId> + <artifactId>oxygen-patched-xerces</artifactId> + <version>${oxygenxml.version}</version> + </dependency> + + <dependency> + <groupId>com.oxygenxml</groupId> + <artifactId>oxygen</artifactId> + <version>${oxygenxml.version}</version> + </dependency> + + <!-- Still needed to keep oxygenxml happy using legacy logging --> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.17</version> + </dependency> + + <dependency> + <groupId>com.rackspace.eclipse.webtools.sourceediting</groupId> + <artifactId>org.eclipse.wst.xml.xpath2.processor</artifactId> + <version>2.1.100</version> + </dependency> + + <dependency> + <groupId>org.postgresql</groupId> + <artifactId>postgresql</artifactId> + <version>42.2.6</version> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-core</artifactId> + <version>2.12.0</version> + </dependency> + + <dependency> + <groupId>javax.xml.bind</groupId> + <artifactId>jaxb-api</artifactId> + <version>2.3.1</version> + </dependency> + + <!-- Required for executable jar generation to avoid ClassNotFoundException: + com.fasterxml.jackson.core.type.TypeReference and similar dependency problems. --> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> + <version>2.9.8</version> + </dependency> + + <dependency> + <groupId>org.jdom</groupId> + <artifactId>jdom2</artifactId> + <version>2.0.6</version> + </dependency> + + <dependency> + <groupId>jaxen</groupId> + <artifactId>jaxen</artifactId> + <version>1.1.6</version> + </dependency> + + <dependency> + <groupId>de.hdm_stuttgart.mi.exam</groupId> + <artifactId>unitmarking</artifactId> + <version>1.0</version> + </dependency> + + </dependencies> + + <build> + + <plugins> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.8.1</version> + <configuration> + <source>11</source> + <target>11</target> + <compilerArgument>-proc:none</compilerArgument> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.1.1</version> + <configuration> + <javaApiLinks> + <property> + <name>api_11</name> + <value>https://klausur.mi.hdm-stuttgart.de/doc/openjdk-11-doc/api/</value> + </property> + </javaApiLinks> + + <stylesheetfile>localstyles.css</stylesheetfile> + + <additionalJOptions> + <additionalJOption>-html5</additionalJOption> + </additionalJOptions> + <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable> + </configuration> + </plugin> + + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <version>3.1.1</version> + <configuration> + <descriptors> + <descriptor>src/main/assembly/assembly.xml</descriptor> + </descriptors> + </configuration> + <executions> + <execution> + <id>make-assembly</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <archive> + <manifest> + <mainClass>de.hdm_stuttgart.mi.sda1.test.ex1.ShowReachedPoints</mainClass> + </manifest> + </archive> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/Klausuren/Sda1/2019summer/Solve/sda1.xpr b/Klausuren/Sda1/2019summer/Solve/sda1.xpr new file mode 120000 index 0000000000000000000000000000000000000000..5dbd3d6f9da82e669507d253db07ea52ef3a9636 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Solve/sda1.xpr @@ -0,0 +1 @@ +../Exam/sda1.xpr \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Solve/src/main/assembly b/Klausuren/Sda1/2019summer/Solve/src/main/assembly new file mode 120000 index 0000000000000000000000000000000000000000..6ae6e5739e70f6f204b1d09dd7ab020017cc35b2 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Solve/src/main/assembly @@ -0,0 +1 @@ +../../../Exam/src/main/assembly/ \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Solve/src/main/java/de/hdm_stuttgart/mi/sda1/Category2Rdbms.java b/Klausuren/Sda1/2019summer/Solve/src/main/java/de/hdm_stuttgart/mi/sda1/Category2Rdbms.java new file mode 100644 index 0000000000000000000000000000000000000000..880c546002f866f7b3040fbf279050c74c4db745 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Solve/src/main/java/de/hdm_stuttgart/mi/sda1/Category2Rdbms.java @@ -0,0 +1,129 @@ +package de.hdm_stuttgart.mi.sda1; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jdom2.*; +import org.jdom2.input.SAXBuilder; + +import java.io.File; +import java.io.IOException; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.SQLException; + +public class Category2Rdbms implements AutoCloseable { + + static private final Logger log = LogManager.getLogger(Category2Rdbms.class); + + static private final String + insertCategorySql = + "INSERT INTO Category (id, title)" + + "VALUES (?, ?)", + + insertArticleSql = + "INSERT INTO Article (orderNo, name, description, img, imgType) " + + "VALUES (?, ?, ?, ?, ?)", + + insertCategoryArticleSql = + "INSERT INTO Category2Article (category, orderNo)" + + "VALUES (?, ?)"; + + private Connection conn; + + private Element catalog; + + private PreparedStatement insertCategory, insertArticle, relateCategoryArticle; + + public Category2Rdbms() { + try { + conn = DriverManager.getConnection( + "jdbc:postgresql://localhost/hdm", "hdmuser", "XYZ"); + insertCategory = conn.prepareStatement(insertCategorySql); + insertArticle = conn.prepareStatement(insertArticleSql); + relateCategoryArticle = conn.prepareStatement(insertCategoryArticleSql); + } catch (final SQLException e) { + log.error("Unable to establish connection, exiting", e); + System.exit(1); + } + + final SAXBuilder builder = new SAXBuilder(); + try { + catalog = builder.build(new File("Schema/sampledata.xml")).getRootElement(); + } catch (final JDOMException e) { + log.error("Unable to parse input, exiting", e); + System.exit(1); + } catch (final IOException e) { + log.error("Unable to read input, exiting", e); + System.exit(1); + } + } + + public void execute() { + log.info("Parsing XML input file"); + catalog.getChild("categories").getChildren("category").forEach(this::handleCategory); + catalog.getChild("articles").getChildren("article").forEach(this::handleArticle); + } + + private void handleCategory(final Element category) { + log.info("Inserting category "); + final String + id = category.getAttributeValue("id"), + title = category.getValue(); + log.info("Category id = " + id); + try { + insertCategory.setString(1, id); + insertCategory.setString(2, title); + insertCategory.execute(); + } catch (final SQLException e) { + log.error("Failed to insert category id = " + id + ": ", e); + } + } + + private void handleArticle(final Element article) { + log.info("Inserting article"); + + final int orderNo = Integer.parseInt(article.getAttributeValue("orderNo")); + + final Element imgElement = article.getChild("img"); + + final String + name = article.getChildText("name"), + description = article.getChildText("description"), + img = (null == imgElement) ? null : imgElement.getAttributeValue("src"), + imgType = (null == imgElement) ? null : imgElement.getAttributeValue("type"); + + log.info("article orderNo = " + orderNo); + try { + insertArticle.setInt(1, orderNo); + insertArticle.setString(2, name); + insertArticle.setString(3, description); + insertArticle.setString(4, img); + insertArticle.setString(5, imgType); + insertArticle.execute(); + } catch (final SQLException e) { + log.error("Failed to insert article orderNo = " + orderNo + ": ", e); + } + + log.info("Relating article " + orderNo + " to categories"); + article.getChildren("cat").forEach(cat -> { + final String category = cat.getValue(); + try { + relateCategoryArticle.setString(1, category); + relateCategoryArticle.setInt(2, orderNo); + relateCategoryArticle.execute(); + } catch (final SQLException e) { + log.error("Failed to relate article orderNo = " + orderNo + "to category " + category, e); + } + }); + } + + @Override + public void close() { + try { + conn.close(); + } catch (final SQLException e) { + e.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Solve/src/main/java/de/hdm_stuttgart/mi/sda1/Driver.java b/Klausuren/Sda1/2019summer/Solve/src/main/java/de/hdm_stuttgart/mi/sda1/Driver.java new file mode 120000 index 0000000000000000000000000000000000000000..1d7ac468d320b13be36b656d5a0bc65ca3ae16ad --- /dev/null +++ b/Klausuren/Sda1/2019summer/Solve/src/main/java/de/hdm_stuttgart/mi/sda1/Driver.java @@ -0,0 +1 @@ +../../../../../../../../Exam/src/main/java/de/hdm_stuttgart/mi/sda1/Driver.java \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Solve/src/main/javadoc b/Klausuren/Sda1/2019summer/Solve/src/main/javadoc new file mode 120000 index 0000000000000000000000000000000000000000..c16a3402b582836bd0cc68987dac7ee5a9aad866 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Solve/src/main/javadoc @@ -0,0 +1 @@ +../../../Exam/src/main/javadoc/ \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Solve/src/main/resources b/Klausuren/Sda1/2019summer/Solve/src/main/resources new file mode 120000 index 0000000000000000000000000000000000000000..79a378d7ffb965a5c4613515460b4993a9827343 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Solve/src/main/resources @@ -0,0 +1 @@ +../../../Exam/src/main/resources/ \ No newline at end of file diff --git a/Klausuren/Sda1/2019summer/Solve/src/test b/Klausuren/Sda1/2019summer/Solve/src/test new file mode 120000 index 0000000000000000000000000000000000000000..f8ecac4b69f2f999658f51af74d0a602548ab400 --- /dev/null +++ b/Klausuren/Sda1/2019summer/Solve/src/test @@ -0,0 +1 @@ +../../Exam/src/test/ \ No newline at end of file