Skip to content
Snippets Groups Projects
Commit e8586763 authored by Goik Martin's avatar Goik Martin
Browse files

Sda1 exam summer '16

parent 0e983402
No related branches found
No related tags found
No related merge requests found
Showing
with 467 additions and 0 deletions
/.classpath
/.project
A1.log
-- TODO: Create your schema
DROP TABLE IF EXISTS XYZ;
...
CREATE TABLE XYZ (
);
...
-- TODO:
-- Add INSERT statements as a proof of concept being able
-- to harbour data as in Schema/sampledata.xml.
INSERT INTO XYZ (x, y, z) VALUES (...);
...
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified"
vc:minVersion="1.1">
<!--
TODO: Implement this schama according to the exercise description.
Sample document instances in SchemaTest may be validated by executing
the Junit test class de.hdm_stuttgart.mi.sda1.exam.xsd.SchemaTest
-->
<xs:element name="movieDb">
</xs:element>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<movieDb xsi:noNamespaceSchemaLocation="movie.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<persons>
<person id="rAltmann" birthYear="1925">
<name>Robert Altman</name>
</person>
<person id="aMacDowell" birthYear="1958">
<name>Andie MacDowell</name>
</person>
<person id="sKubrick" birthYear="1928" img="kubrick.jpg">
<name>Stanley Kubrick</name>
</person>
<person id="mModine" birthYear="1959">
<name>Matthew Modine</name>
<biography>The youngest of seven, Matthew was born ...</biography>
</person>
<person id="rLeeEremy" birthYear="1944">
<name>R. Lee Ermey</name>
</person>
</persons>
<movies>
<movie id = "18113" year="1987" director="sKubrick" rating="8.3">
<title>Full Metal Jacket</title>
<cast>
<actor ref="mModine" isStar="true"/>
<actor ref="rLeeEremy"/>
</cast>
</movie>
<movie rating="7.7" id="4342" year="1993" director="rAltmann">
<title>Short Cuts</title>
<cast>
<actor ref="aMacDowell"/>
<actor ref="mModine" isStar="false"/>
</cast>
</movie>
</movies>
</movieDb>
\ No newline at end of file
<movieDb
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/movie.xsd">
<persons>
<person id="sKubrick" birthYear="1928" img="kubrick.jpg">
<name>Stanley Kubrick</name>
</person>
</persons>
<movies>
<movie id="1" year="1987" director="sKubrick" rating="8.3">
<title>Full Metal Jacket</title>
<cast>
<!-- Error: Absence of required attribute 'ref' -->
<actor/>
<!-- Error: No matching <person id="stanleyKubrick" ..> record. -->
<actor ref="stanleyKubrick"/>
</cast>
</movie>
</movies>
</movieDb>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "personRef.xml" ?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<movieDb
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/movie.xsd">
<!-- No person database duplicate! -->
<persons/>
<persons/>
<!-- No movie database duplicate! -->
<movies/>
<movies/>
</movieDb>
<!-- Subsequent lines contain only processing instructions irrelevant to instance's validity -->
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "base_valid.xml" ?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<movieDb
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/movie.xsd">
<persons/>
<movies/>
</movieDb>
<movieDb
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/movie.xsd">
<persons>
<person id="sKubrick" birthYear="1928" img="kubrick.jpg">
<name>Stanley Kubrick</name>
</person>
</persons>
<movies>
<movie id="1" year="1987" director="stanleyKubrick" rating="8.3">
<title>Full Metal Jacket</title>
<cast>
<actor ref="sKubrick"/><!-- Fake reference to keep it simple and syntactically correct -->
</cast>
</movie>
</movies>
</movieDb>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "personRef.xml" ?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<movieDb
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/movie.xsd">
<persons>
<!-- Missing required attributes id and birthYear -->
<person >
<name>K. Ill Me</name>
</person>
</persons>
<movies/>
</movieDb>
<?xmlTest
points = "1"
expectedToBeValid = "false" ?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<movieDb
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/movie.xsd">
<persons>
<person id="sKubrick" birthYear="1928">
<name>Stanley Kubrick</name>
</person>
</persons>
<movies>
<!-- Error: Missing required attributes -->
<movie >
<title>Full Metal Jacket</title>
<cast>
<actor ref="sKubrick"/>
</cast>
</movie>
<movie id="1" year="1987" director="sKubrick" rating="8.3">
<title>Full Metal Jacket</title>
<!-- Error: <cast> is missing -->
</movie>
<movie id="2" year="1987" director="sKubrick" rating="8.3">
<title>Full Metal Jacket</title>
<!-- Error: <cast> cannot be empty -->
<cast/>
</movie>
<movie id="3" year="1987" director="sKubrick" rating="8.3">
<title>Full Metal Jacket</title>
<!-- Error: <cast> must appear exactly once.-->
<cast>
<actor ref="sKubrick"/>
</cast>
<cast>
<actor ref="sKubrick"/>
</cast>
</movie>
</movies>
</movieDb>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "movie_valid.xml" ?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<movieDb
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/movie.xsd">
<persons>
<person id="sKubrick" birthYear="1928">
<name>Stanley Kubrick</name>
</person>
</persons>
<movies>
<movie id="1" year="1987" director="sKubrick" rating="8.3">
<title>Full Metal Jacket</title>
<cast>
<actor ref="sKubrick"/>
</cast>
</movie>
</movies>
</movieDb>
<?xml version="1.0" encoding="UTF-8"?>
<movieDb
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/movie.xsd">
<persons>
<person id="sKubrick" birthYear="1928">
<!-- Error: No name given. -->
</person>
</persons>
<movies/>
</movieDb>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "name_valid.xml" ?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<movieDb
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/movie.xsd">
<persons>
<person id="sKubrick" birthYear="1928">
<name>Stanley Kubrick</name>
</person>
</persons>
<movies/>
</movieDb>
<?xml version="1.0" encoding="UTF-8"?>
<movieDb
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/movie.xsd">
<persons>
<person id="mModine" birthYear="1959">
<name>Matthew Modine</name>
<biography>The youngest of seven, Matthew was born ...</biography>
</person>
</persons>
<movies/>
</movieDb>
<?xmlTest
points = "1"
expectedToBeValid = "true" ?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<movieDb
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/movie.xsd">
<persons>
<!-- id value must not contain spaces -->
<person id="s Kubrick" birthYear="1928">
<name>Stanley Kubrick</name>
</person>
</persons>
<movies/>
</movieDb>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "name_valid.xml" ?>
\ No newline at end of file
<movieDb
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/movie.xsd">
<persons>
<person id="sKubrick" birthYear="1928" img="kubrick.jpg">
<name>Stanley Kubrick</name>
</person>
<person id="rLeeEremy" birthYear="1944">
<name>R. Lee Ermey</name>
</person>
</persons>
<movies>
<movie id="1" year="1987" director="sKubrick" rating="8.3">
<title>Full Metal Jacket</title>
<cast>
<actor ref="sKubrick"/>
<actor ref="rLeeEremy" isStar="true"/>
</cast>
</movie>
</movies>
</movieDb>
\ No newline at end of file
<movieDb
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/movie.xsd">
<persons>
<person id="sKubrick" birthYear="1928" img="kubrick.jpg">
<name>Stanley Kubrick</name>
</person>
<person id="rLeeEremy" birthYear="1944">
<name>R. Lee Ermey</name>
</person>
</persons>
<movies>
<movie id="1" year="1987" director="sKubrick" rating="8.3">
<title>Full Metal Jacket</title>
<cast>
<!-- Missing required attribute @ref -->
<actor/>
<actor ref="rLeeEremy"/>
</cast>
</movie>
</movies>
</movieDb>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "personRef.xml" ?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<movieDb
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/movie.xsd">
<persons>
<!-- Error: Missing required attributes id and birthYear -->
<person >
<name>Some Person</name>
</person>
<!-- Error: Missing required attribute birthYear -->
<person id="x">
<name>Some Person</name>
</person>
<!-- Error: Missing required attribute id. -->
<person birthYear="1984">
<name>Some Person</name>
</person>
</persons>
<movies/>
</movieDb>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "name_valid.xml" ?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<movieDb
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/movie.xsd">
<persons>
<person id="sKubrick" birthYear="1928">
<name>Stanley Kubrick</name>
</person>
</persons>
<movies>
<!-- Error: Absence of required attribute 'rating'. -->
<movie id="1" year="1987" director="sKubrick">
<title>Movie 1</title>
<cast><actor ref="sKubrick"/></cast>
</movie>
<!-- Error: Attribute 'rating' has got upper bound of 9.9 -->
<movie id="2" rating="10" year="1987" director="sKubrick">
<title>Movie 1</title>
<cast><actor ref="sKubrick"/></cast>
</movie>
<!-- Error: Only one decimal place allowed for attribute 'rating'. -->
<movie id="3" rating="8.35" year="1987" director="sKubrick">
<title>Movie 2</title>
<cast><actor ref="sKubrick"/></cast>
</movie>
<!-- Error: No negative values allowed for attribute 'rating'. -->
<movie id="4" rating="-1" year="1987" director="sKubrick">
<title>Movie 3</title>
<cast><actor ref="sKubrick"/></cast>
</movie>
</movies>
</movieDb>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "rating_valid.xml" ?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<movieDb
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/movie.xsd">
<persons>
<person id="sKubrick" birthYear="1928">
<name>Stanley Kubrick</name>
</person>
</persons>
<movies>
<movie id="1" year="1987" director="sKubrick" rating="0.0">
<title>Movie 1</title>
<cast><actor ref="sKubrick"/></cast>
</movie>
<movie id="2" year="1987" director="sKubrick" rating="9.9">
<title>Movie 2</title>
<cast><actor ref="sKubrick"/></cast>
</movie>
<movie id="3" year="1987" director="sKubrick" rating="8.3">
<title>Movie 3</title>
<cast><actor ref="sKubrick"/></cast>
</movie>
</movies>
</movieDb>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment