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

HTML solutions file

parent 00080822
No related branches found
No related tags found
No related merge requests found
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Solutions</title>
<meta charset="UTF-8" />
</head>
<body><h1>Test solutions</h1><h2>Test 3</h2><h3>Well-formed and
valid</h3><p>“well-formed” XML document instances obey the constraints of
well-formedness like:</p><ul>
<li>Proper nesting of elements</li>
<li>Exactly one root element</li>
<li>quoting of attribute values. (Unlike HTML in its SGML variant
allowing e.g. <code>&lt;img align=top&gt;</code>)</li>
</ul><p>“valid” XML document instances are “well-formed” and in
addition conform to a grammar being expressed as e.g. XML Schema, RelaxNG or
DTD.</p><h3>Doodle poll XML data</h3><p><a
href="/ilias/data/iliasclient1/assessment/4018/1952/solution/doodle.zip">doodle.zip</a>
offers a solution.</p><h2>Test 4</h2><p><a
href="/iliasData/goik/Xml2xml_Solutiondsadhiukfhsr65RRY_o/xml2xml_solution.zip">xml2xml_solution.zip</a>
contains an Eclipse project based reference implementation.</p><h2>Test
5</h2><p><a
href="/iliasData/goik/book2html_Solution_idzhsfc5-6FFsfK/book2Html_solution.zip">book2Html_solution.zip</a>
contains an Eclipse project based reference implementation.</p><h3>XML book
instances</h3><h2>Test 6</h2><h3>Printing element names</h3><p>The
implemented method <code>startElement</code> has got wrong signature.
According to the Java 1.7 API documentation <a
href="http://docs.oracle.com/javase/7/docs/api/org/xml/sax/helpers/DefaultHandler.html#startElement(java.lang.String,%20java.lang.String,%20java.lang.String,%20org.xml.sax.Attributes)">startElement</a>
should have <code>org.xml.sax.Attributes</code> as its last argument. But in
the given code the last argument is of type
<code>java.util.jar.Attributes</code>. Hence the handler does not redefine
the corresponding parent class method <a
href="http://docs.oracle.com/javase/7/docs/api/org/xml/sax/helpers/DefaultHandler.html#startElement(java.lang.String,%20java.lang.String,%20java.lang.String,%20org.xml.sax.Attributes)">startElement</a>
but instead adds an overloaded method. At runtime the SAX parser will call
the (dummy) method being defined in the parent class DefaultHandler thus
completely ignoring the intended implementation.</p><p>Replacing
<code>import java.util.jar.Attributes</code> by <code>import
org.xml.sax.Attributes</code> solves the problem.</p><p>An
<code>@Override</code> annotation would have flagged this apparent mistake
as a Java compile time error.</p><h3>SAX html creation (2 parts)</h3><p><a
href="/iliasData/goik/sax_hahHzh66-99DDDwsq/jidHFced74_98GFWWs/saxmemo2html_solution.zip">saxmemo2html_solution.zip</a>
contains an Eclipse project based reference implementation.</p><h2>Test
7</h2><h3>Jdom tables, 2 parts</h3><p><a
href="/iliasData/goik/jdomtable_Solution_65RRR_fkweFGjhuiz/jdomtable_solution.zip">jdomtable_solution.zip</a>
contains a Maven reference implementation.</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