Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GoikLectures
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Goik Martin
GoikLectures
Commits
3683fb20
Commit
3683fb20
authored
10 years ago
by
Goik Martin
Browse files
Options
Downloads
Patches
Plain Diff
pom.xml problems, better exercise description
parent
12969db0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sd1/Makefile
+1
-1
1 addition, 1 deletion
Sd1/Makefile
Sda1/Etest/SaxMemo2Html/exercise1.xhtml
+32
-33
32 additions, 33 deletions
Sda1/Etest/SaxMemo2Html/exercise1.xhtml
with
33 additions
and
34 deletions
Sd1/Makefile
+
1
−
1
View file @
3683fb20
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Sda1/Etest/SaxMemo2Html/exercise1.xhtml
+
32
−
33
View file @
3683fb20
...
...
@@ -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 application
s
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>
<
html
><
/html
>
</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;"
>
<
memo
>
<
from
>
M. Goik
<
/from
>
...
...
@@ -52,9 +46,10 @@
<
to
>
A. June
<
/to
>
<
subject
>
Best wishes
<
/subject
>
<
content
>
Hi all, congratulations to your splendid party
<
/content
>
<
/memo
>
</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>
<
html
>
<
/memo
>
</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>
<
html
>
<
head
>
<
title
>
Memo message
<
/title
>
<
/head
>
...
...
@@ -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>
<
html
>
<
head
><
title
>
Memo from M. Goik
<
/title
><
/head
>
...
...
@@ -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>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment