Basic HTML version of Foils prepared August 1 99

Foil 33 Browsing Document with SAX Parser

From Advanced XML and its applications CPS714 Computational Science Information Track -- July 7 99. by Lukasz Beca


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 }

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Aug 1 1999