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

Cosmetics

parent 0502c758
No related branches found
No related tags found
No related merge requests found
......@@ -6,23 +6,22 @@ import org.xml.sax.helpers.DefaultHandler;
public class HtmlCreateHandler extends DefaultHandler {
String lastElement;
String lastElement;// Save name of last visited element
@Override
public void startDocument() throws SAXException {
@Override public void startDocument() throws SAXException {
print("<html xmlns='http://www.w3.org/1999/xhtml'>\n"
+ " <head><title>A Memo</title></head>\n"
+ " <body>\n"
+ " <dl>\n"
+ " <dt>Sender:</dt>"); // <from> content follows ...
}
@Override
public void startElement(String uri, String localName, String qName,
Attributes attributes) throws SAXException {
lastElement = qName;
}
@Override
public void characters(char[] ch, int start, int length) throws SAXException {
final String content = new String(ch, start, length).trim();
......@@ -46,15 +45,12 @@ public class HtmlCreateHandler extends DefaultHandler {
}
}
}
@Override
public void endDocument() throws SAXException {
@Override public void endDocument() throws SAXException {
print(" </body>\n"
+"</html>\n");
}
// Shortcut System.out.println
private void print(final String s) {
System.out.println(s);
}
private void print(final String s) { System.out.println(s);}
}
\ 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