/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/oracle-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 <oraxml.hpp>
 
4
 
 
5
#define DTD_VALIDATION_SUPPORTED
 
6
#include "tools.h"
 
7
 
 
8
XMLParser *parser;
 
9
 
 
10
void initXML(struct TestData *td) {
 
11
    unsigned int ecode;
 
12
    parser=new XMLParser;
 
13
    ecode=parser->xmlinit();
 
14
    if (ecode)
 
15
    {
 
16
        fprintf(stderr,"Failed to initialze XML parser, error %u\n", (unsigned) ecode);
 
17
        exit(1);
 
18
    }
 
19
}
 
20
 
 
21
void releaseXML(struct TestData *td) {
 
22
    parser->xmlterm();
 
23
    delete parser;
 
24
}
 
25
 
 
26
void parseXML(struct TestData *td, unsigned long iter) {
 
27
    unsigned int ecode;
 
28
    
 
29
#ifdef DTD_VALIDATION
 
30
    ecode=parser->xmlparseBuffer((oratext*)td->xml,td->xmllen,0,XML_FLAG_DISCARD_WHITESPACE|XML_FLAG_VALIDATE);
 
31
#else
 
32
    ecode=parser->xmlparseBuffer((oratext*)td->xml,td->xmllen,0,XML_FLAG_DISCARD_WHITESPACE);
 
33
#endif
 
34
    if (ecode) {
 
35
        fprintf(stderr,"Failed to parse XML file, error %u\n", (unsigned) ecode);
 
36
    }   
 
37
//    parser->xmlclean();
 
38
    parser->xmlterm();
 
39
    parser->xmlinit();
 
40
}
 
41
 
 
42
 
 
43
int main(int argc, char *argv[]) {
 
44
    return Test(argc,argv);
 
45
}