1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.exorcist.core;
17
18 import org.apache.xerces.util.XMLChar;
19 import org.xml.sax.Attributes;
20 import org.xml.sax.ContentHandler;
21 import org.xml.sax.SAXException;
22 import org.xml.sax.helpers.AttributesImpl;
23
24 /***
25 * TODO
26 */
27 public class TableWriter {
28
29 private static final String PREFIX = "table";
30
31 private static final String NSURI = "http://exorcist.sf.net/ns/2005/table";
32
33 private XmlWriter writer;
34
35 public void setContentHandler(ContentHandler handler) {
36 writer = new XmlWriter();
37 writer.setNamespace(NSURI);
38 writer.setPrefix(PREFIX);
39 writer.setContentHandler(handler);
40 }
41
42 public void startDocument() throws SAXException {
43 writer.startDocument();
44 }
45
46 public void endDocument() throws SAXException {
47 writer.endDocument();
48 }
49
50 public void startTable(String name) throws SAXException {
51 writer.startElement("table", writer.makeAttribute("name", name));
52 }
53
54 public void endTable() throws SAXException {
55 writer.endElement("table");
56 }
57
58 public void startRow() throws SAXException {
59 writer.startElement("row", null);
60 }
61
62 public void endRow() throws SAXException {
63 writer.endElement("row");
64 }
65
66 }