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


import org.xml.sax.HandlerBase;
import org.xml.sax.AttributeList;
public class MyHandler extends HandlerBase {
String tag = "outside";
int indent = 0;
public void startElement (String name, AttributeList atts) {
int i;
indent = indent + 2;
for(i = 0; i < indent; i ++) {
System.out.print(" ");
}
System.out.println("Start element: " + name);
tag = "inside";
}



© 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