/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 validate/mono-dom.cs

  • Committer: Suren A. Chilingaryan
  • Date: 2009-09-28 23:02:52 UTC
  • Revision ID: csa@dside.dyndns.org-20090928230252-d05nbdkg6q4zvu8i
Mono validation and transformation benchmarks

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
using System.IO;
 
3
using System.Xml;
 
4
using System.Xml.Schema;
 
5
 
 
6
using XMLBench;
 
7
 
 
8
namespace XMLBench {
 
9
 public class MonoBench : XMLBench {
 
10
    public XmlSchemaCollection xsc;
 
11
    override public void InitXML_Validation(string schema_file, string schema_location) {
 
12
        xsc = new XmlSchemaCollection();
 
13
        xsc.Add(schema_location, schema_file);
 
14
    }
 
15
    override public void ParseXML(Stream xml, int iters, int iter) {
 
16
        XmlTextReader reader = new XmlTextReader(xml);
 
17
        XmlDocument doc = new XmlDocument();
 
18
        doc.Load(reader);
 
19
    }
 
20
    override public void ValidateXML(Stream xml, int iters, int iter) {
 
21
        XmlValidatingReader reader = new XmlValidatingReader(new XmlTextReader(xml));
 
22
        reader.Schemas.Add(xsc);
 
23
        XmlDocument doc = new XmlDocument();
 
24
        doc.Load(reader);
 
25
    }
 
26
 }
 
27
 
 
28
 public class Mono {
 
29
    public static void Main(string[] args) {
 
30
        XMLBench bench = new MonoBench();
 
31
        bench.Bench(args);
 
32
    }
 
33
 }
 
34
}