// file : examples/cxx/tree/hello/driver.cxx // author : Boris Kolpackov // copyright : not copyrighted - public domain #include // std::auto_ptr #include #include "hello.hxx" using namespace std; int main (int argc, char* argv[]) { if (argc != 2) { cerr << "usage: " << argv[0] << " hello.xml" << endl; return 1; } try { auto_ptr h (hello (argv[1])); for (hello_t::group_const_iterator i (h->group ().begin ()); i != h->group ().end (); ++i) { cout << "Id: " << i->id() << endl; for (group_t::name_const_iterator j (i->name ().begin ()); j != i->name ().end (); ++j) { cout << i->greeting () << ", " << *j << "!" << endl; } } } catch (const xml_schema::exception& e) { cerr << e << endl; return 1; } }