// file : examples/cxx/tree/library/driver.cxx // author : Boris Kolpackov // copyright : not copyrighted - public domain #include // std::auto_ptr #include #include #include "library.hxx" #include using std::cerr; using std::endl; #define NB_ITER 1000 int main (int argc, char* argv[]) { if (argc != 2) { cerr << "usage: " << argv[0] << " library.xml" << endl; return 1; } try { using namespace library; std::cout << "Essai avec <" << NB_ITER << "> iterations" << endl; time_t time1=time(NULL); for (int i=0; i l (catalog (argv[1])); // Prepare namespace mapping and schema location information. // xml_schema::namespace_infomap map; map["lib"].name = "http://www.codesynthesis.com/library"; map["lib"].schema = "library.xsd"; // Write it out. // std::ofstream outfile("library2.xml", std::ofstream::out); catalog(outfile, *l, map); outfile.close(); } time_t time2=time(NULL); std::cout << (time2-time1) << " secondes" << endl; } catch (xml_schema::exception const& e) { cerr << e << endl; return 1; } }