4
import javax.xml.parsers.DocumentBuilderFactory;
5
import javax.xml.parsers.DocumentBuilder;
7
import org.w3c.dom.Document;
9
public class intel_dom2 extends bench {
11
DocumentBuilder parser;
12
DocumentBuilderFactory factory;
14
public void InitXML() {
15
factory = DocumentBuilderFactory.newInstance();
16
factory.setNamespaceAware(true);
17
factory.setValidating(false);
19
if (System.getenv("memory_bench")!=null) {
20
factory.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", true);
22
factory.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", false);
24
} catch (Throwable err) {
25
// ignoring missing option
29
parser = factory.newDocumentBuilder();
31
catch (Throwable err) {
32
err.printStackTrace ();
36
public void ParseXML(FileInputStream is, int iters, int iter) {
38
Document doc = parser.parse(is);
42
System.out.println(e.toString());
46
static public void main(String argv[]) throws IOException {
47
bench mybench = new intel_dom2();