/xmlbench/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/xmlbench/trunk
2 by Suren A. Chilingaryan
Intel, Tango, Phobos, and RapidXML parsers; Memory benchmark scripts
1
import java.io.*;
2
import java.util.*;
3
import java.text.*;
4
5
import org.xml.sax.*;
6
import org.xml.sax.helpers.*;
7
import javax.xml.parsers.SAXParserFactory; 
8
import javax.xml.parsers.SAXParser;
9
10
public class intel_sax2 extends bench {
11
    SaxHandlers handler;
12
    XMLReader parser;
13
    SAXParserFactory factory;
14
    
15
    public void InitXML() {
16
	factory = SAXParserFactory.newInstance();
17
	factory.setNamespaceAware(true);
18
	factory.setValidating(false);
19
20
	handler = new SaxHandlers();
21
	try {
22
	    parser=factory.newSAXParser().getXMLReader();
23
	}
24
	catch (Throwable err) {
25
    	    System.err.println(err.getMessage());
26
	}
27
	parser.setContentHandler(handler);
28
    }
29
30
    public void ParseXML(FileInputStream is, int iters, int iter) {
31
	try {
32
	    parser.parse(new InputSource(is));		
33
	}
34
	catch (Exception e)
35
        {
36
    	    System.out.println(e.toString());
37
        }
38
    }
39
  
40
    static public void main(String argv[]) throws IOException {
41
	bench mybench = new intel_sax2();
42
	mybench.Bench(argv);
43
    }
44
}