bzr branch
http://darksoft.org/webbzr/xmlbench/trunk
4
by Suren A. Chilingaryan
Mono validation and transformation benchmarks |
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) { |
|
8
by Suren A. Chilingaryan
QT pull parser and fixes |
21 |
/*
|
22 |
Not available yet
|
|
23 |
XmlReaderSettings settings = new XmlReaderSettings();
|
|
24 |
*/
|
|
4
by Suren A. Chilingaryan
Mono validation and transformation benchmarks |
25 |
XmlValidatingReader reader = new XmlValidatingReader(new XmlTextReader(xml)); |
26 |
reader.Schemas.Add(xsc); |
|
27 |
XmlDocument doc = new XmlDocument(); |
|
28 |
doc.Load(reader); |
|
29 |
}
|
|
30 |
}
|
|
31 |
||
32 |
public class Mono { |
|
33 |
public static void Main(string[] args) { |
|
34 |
XMLBench bench = new MonoBench(); |
|
35 |
bench.Bench(args); |
|
36 |
}
|
|
37 |
}
|
|
38 |
}
|