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

pom.xml problems, better exercise description

parent 12969db0
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ BUILDROOT=/tmp
#
# Directories containing pom.xml files
#
POMDIRS= $(shell find P -name pom.xml|grep -v target/classes/META-INF|sed -e s/\\/pom.xml//g)
POMDIRS= $(shell find P -name pom.xml|grep -v target/classes|grep -v src/main/resources/archetype-resources|sed -e s/\\/pom.xml//g)
#
# Dependent destinations
......
......@@ -5,46 +5,40 @@
<title>Exercise 1</title>
</head>
<body><h2>Objective</h2><p>Implementing a SAX based Java application
<body><h2>Objective</h2><p>Implementing two SAX based Java applications
transforming memo documents to HTML.</p><h2>Preparations</h2><ol>
<li>Download <a
href="/iliasData/goik/sax_hahHzh66-99DDDwsq/saxmemo2html.zip">saxmemo2html.zip</a>
and import it as a project into your Eclipse workspace.</li>
<li><p>Your resulting Project <code>Bsaxmemo2html</code>contains among
other files:</p><dl>
<dt>src/main/resources/memo.xml</dt>
<li><p>Your resulting Project <code>saxmemo2html</code>contains among
other files:</p><ul>
<li><p><strong>src/main/resources/memo.xml</strong></p><p>A sample
memo input document.</p></li>
<dd>A sample memo input document.</dd>
<dt>de.hdm_stuttgart.mi.sda1.saxhtml.v1.Memo2HtmlHandler</dt>
<dd>A SAX event handler which currently just creates static
<li><p><strong>de.hdm_stuttgart.mi.sda1.saxhtml.v1.Memo2HtmlHandler</strong></p><p>A
SAX event handler which currently just creates static
<code>&lt;html&gt;&lt;/html&gt;</code> output. The non-default
constructor expects a <a
href="http://docs.oracle.com/javase/8/docs/api/java/io/PrintStream.html">java.io.PrintStream</a>
allowing unit tests to redirect output to a file for subsequent
result analysis.</dd>
<dt>de.hdm_stuttgart.mi.sda1.saxhtml.v1.Driver</dt>
result analysis.</p></li>
<dd>Executing this class converts <code>memo.xml</code> to
<li><p><strong>de.hdm_stuttgart.mi.sda1.saxhtml.v1.Driver</strong></p><p>Executing
this class converts <code>memo.xml</code> to
<code>src/main/resources/memo.xml.1.html</code> by using
<code>de.hdm_stuttgart.mi.sda1.saxhtml.v1.Memo2HtmlHandler</code>
and writing to output console.</dd>
<dt>src/main/resources/memo.xml.1.sample.html</dt>
<dd>The intended output corresponding to be generated from
<code>memo.xml</code> by <code>Memo2HtmlHandler</code>.</dd>
and writing to output console.</p></li>
<dt>de.hdm_stuttgart.de.sda1.saxhtml.v1.test.ConversionTest</dt>
<li><p><strong>src/main/resources/memo.xml.1.sample.html</strong></p><p>The
intended output corresponding to be generated from </p></li>
<dd>This Junit class executes your handler and writes the
corresponding output to src/main/resources/memo.xml.1.html. The
latter file then becomes subject to a series of XPath expression
tests checking for correctness of your output.</dd>
</dl></li>
<li><p><strong>de.hdm_stuttgart.de.sda1.saxhtml.v1.test.ConversionTest</strong></p><p>This
Junit class executes your handler and writes the corresponding
output to src/main/resources/memo.xml.1.html. The latter file then
becomes subject to a series of XPath expression tests checking for
correctness of your output.</p></li>
</ul></li>
</ol><h2>Description</h2><p>Our sample document memo document
contains:</p><pre style="font-family:monospace;">&lt;memo&gt;
&lt;from&gt;M. Goik&lt;/from&gt;
......@@ -52,9 +46,10 @@
&lt;to&gt;A. June&lt;/to&gt;
&lt;subject&gt;Best wishes&lt;/subject&gt;
&lt;content&gt;Hi all, congratulations to your splendid party&lt;/content&gt;
&lt;/memo&gt;</pre><h2>ToDo, Part 1</h2><p>Complete the implementation of
<code>Memo2HtmlHandler</code> to generate the content of
<code>memo.xml.1.sample.html</code>:</p><pre>&lt;html&gt;
&lt;/memo&gt;</pre><h2>ToDo, Part 1</h2><p>This exercise deals with Java
classes from packages containing the string <strong>v1</strong> in their
names. Complete the implementation of <code>Memo2HtmlHandler</code> to
generate the content of <code>memo.xml.1.sample.html</code>:</p><pre>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Memo message&lt;/title&gt;
&lt;/head&gt;
......@@ -73,7 +68,11 @@
satisfied with your result execute the Junit test
<code>de.hdm_stuttgart.de.sda1.saxhtml.v1.test.ConversionTest</code>. When
you are finished export your Maven project as a compressed .zip archive and
upload it.</p><h2>ToDo, Part 2</h2><p>Your project contains a second set of
upload it.</p><h2>ToDo, Part 2</h2><p>This second exercise deals with Java
classes from packages containing the string <strong>v2</strong> in their
names. So you might want to close <strong>all</strong> file tabs in your
current Eclipse project to avoid confusing yourself with files from the
first part of this exercise.</p><p>Your project contains a second set of
files intended to create more sophisticated output as being contained in
<code>memo.xml.2.sample.html</code>:</p><pre>&lt;html&gt;
&lt;head&gt;&lt;title&gt;Memo from M. Goik&lt;/title&gt;&lt;/head&gt;
......@@ -101,10 +100,10 @@
<code>de.hdm_stuttgart.de.sda1.saxhtml.v2.test.ConversionTest</code>.</p><p>When
you are finished zip your project again and upload it. Only the last .zip
file will become subject to marking.</p><h3>Hint:</h3><p>In this second part
the order of XML input is not being preserved. Furthermore some input
(sender's name) has to be duplicated. To deal with these challenges you may
first collect all relevant input during the SAX parsing process and
completely defer HTML output generation to the <a
the order of content from your XML input is not being preserved. Furthermore
some input (sender's name) has to be duplicated. To deal with these
challenges you may first collect all relevant input during the SAX parsing
process and completely defer HTML output generation to the <a
href="http://docs.oracle.com/javase/8/docs/api/org/xml/sax/ContentHandler.html#endDocument--">endDocument()</a>
method.</p></body>
</html>
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