1 | import org.xml.sax.HandlerBase; |
2 | import org.xml.sax.AttributeList; |
3 | public class MyHandler extends HandlerBase { |
4 | String tag = "outside"; |
5 | int indent = 0; |
6 | |
7 | public void startElement (String name, AttributeList atts) { |
8 | int i; |
9 | indent = indent + 2; |
10 | for(i = 0; i < indent; i ++) { |
11 | System.out.print(" "); |
12 | } |
13 | System.out.println("Start element: " + name); |
14 | tag = "inside"; |
15 | } |