/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/expat-cslxml-dom.cpp

  • 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
#include <stdio.h>
 
2
#include <sys/time.h>
 
3
#include <sstream>
 
4
 
 
5
#include <DOMBuilder.h>
 
6
#include <DOM/Document.h>
 
7
#include <SAX/InputSource.h>
 
8
 
 
9
#include "tools.h"
 
10
 
 
11
using namespace CSL::XML;
 
12
 
 
13
DOMBuilder *parser;
 
14
 
 
15
void initXML(struct TestData *td) {
 
16
    parser = new DOMBuilder;
 
17
//      parser->setFeature("namespaces", false);                    // turn off namespace support
 
18
//      parser->setFeature("white-space-in-element-content", true); // do not remove ignorable whitespace
 
19
}
 
20
 
 
21
void releaseXML(struct TestData *td) {
 
22
    delete parser;
 
23
}
 
24
 
 
25
 
 
26
void parseXML(struct TestData *td, unsigned long iter) {
 
27
    Document *doc;
 
28
    
 
29
    istringstream strm(td->xml);
 
30
    CInputSource is(&strm);
 
31
    doc=parser->parseDOMInputSource(&is);    
 
32
    doc->release();
 
33
}
 
34
 
 
35
 
 
36
int main(int argc, char *argv[]) {
 
37
    return Test(argc,argv);
 
38
}