/xmlbench/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/xmlbench/trunk

« back to all changes in this revision

Viewing changes to parse/sun_dom2.java

  • Committer: Suren A. Chilingaryan
  • Date: 2009-02-16 09:27:17 UTC
  • Revision ID: csa@dside.dyndns.org-20090216092717-wipyvaaw2srxhgns
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import java.io.*;
 
2
import java.util.*;
 
3
import java.text.*;
 
4
import javax.xml.parsers.DocumentBuilderFactory; 
 
5
import javax.xml.parsers.DocumentBuilder; 
 
6
 
 
7
public class sun_dom2 extends bench {
 
8
 
 
9
    DocumentBuilder parser;
 
10
    DocumentBuilderFactory factory;
 
11
    
 
12
    public void InitXML() {
 
13
        factory = DocumentBuilderFactory.newInstance();
 
14
        try {
 
15
            parser = factory.newDocumentBuilder();
 
16
        }
 
17
        catch (Throwable err) {
 
18
            err.printStackTrace ();
 
19
        }
 
20
    }
 
21
 
 
22
    public void ParseXML(FileInputStream is, int iters, int iter) {
 
23
        try {
 
24
            parser.parse(is);           
 
25
        }
 
26
        catch (Exception e)
 
27
        {
 
28
            System.out.println(e.toString());
 
29
        }
 
30
    }
 
31
  
 
32
    static public void main(String argv[]) throws IOException {
 
33
        bench mybench = new sun_dom2();
 
34
        mybench.Bench(argv);
 
35
    }
 
36
}