Download this file

SaxHandler.java    44 lines (34 with data), 1.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package net.timbusproject.iermtoowl.utils;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
/**
* Created by miguel on 24-06-2014.
*/
public class SaxHandler extends DefaultHandler {
@Override
public void startDocument() throws SAXException {
System.out.println("start document : ");
}
@Override
public void endDocument() throws SAXException {
System.out.println("end document : ");
}
@Override
public void startElement(String uri, String localName,
String qName, Attributes attributes)
throws SAXException {
System.out.println("start element : " + qName);
}
@Override
public void endElement(String uri, String localName, String qName)
throws SAXException {
System.out.println("end element : " + qName);
}
@Override
public void characters(char ch[], int start, int length)
throws SAXException {
System.out.println("start characters : " +
new String(ch, start, length));
}
}