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

  • Committer: Suren A. Chilingaryan
  • Date: 2009-09-23 17:13:04 UTC
  • Revision ID: csa@dside.dyndns.org-20090923171304-osvtr4zqb29h11kd
Intel, Tango, Phobos, and RapidXML parsers; Memory benchmark scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
 
53
53
void initXML_Validation(struct TestData *td) {
54
54
    schemaFactory = SchemaFactory::newInstance(schemaLanguage);
55
 
//    schemaFactory->setFeature(schema_full_checking_feature_id,true);
56
 
//    schemaFactory->setFeature(identity_constraint_checking_feature_id,true);
 
55
    //broken in 1.2, complains on OPC schema
 
56
    //schemaFactory->setFeature(schema_full_checking_feature_id,true);
 
57
    schemaFactory->setFeature(identity_constraint_checking_feature_id,true);
57
58
 
58
59
    schemabuf = MemoryReader::createMemoryReader(td->xsd,td->xsdlen);
59
60
    schemasrc = new StreamSource(schemabuf);
60
61
 
61
 
    // broken in 1.2
62
 
    //schema = schemaFactory->createSchema(schemasrc);
63
 
    schema = schemaFactory->createSchema(td->scfn);
 
62
    try {
 
63
        // broken in 1.2
 
64
        //schema = schemaFactory->createSchema(schemasrc);
 
65
        schema = schemaFactory->createSchema(td->scfn);
 
66
    } catch (com::intel::xml::ValidationException &e) {
 
67
        printf("Schema initialization failed: %s\n", e.getErrorMessage().c_str());
 
68
        exit(-1);
 
69
    }
 
70
 
64
71
    myvalidator = schema->createValidator();
65
72
}
66
73
 
95
102
 
96
103
void validateXML(struct TestData *td, unsigned long iter) {
97
104
    DOMSource domsource(doc);
98
 
//    myvalidator->validate(&domsource);
99
 
    myvalidator->doValidation(&domsource);
 
105
 
 
106
    try {
 
107
        myvalidator->validate(&domsource);
 
108
//      myvalidator->doValidation(&domsource);
 
109
    } catch (com::intel::xml::ValidationException &e) {
 
110
        printf("Validation failed: %s\n", e.getErrorMessage().c_str());
 
111
        exit(-1);
 
112
    }
100
113
}
101
114
 
102
115