Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::string file = "my.xml";
- try
- {
- myns::root_paggr root_p;
- xml_schema::document_pimpl doc_p (root_p.root_parser (), root_p.root_name(), true);
- root_p.pre();
- doc_p.parse(file);
- std::auto_ptr<myns::root> root (root_p.post());
- myns::root::type_sequence& ts = root->type();
- for (myns::root::type_iterator i = ts.begin(); i != ts.end(); ++i)
- {
- myns::type& t = *i;
- std::cout << t.id() << std::endl;
- }
- }
- catch (const xml_schema::parser_exception& e)
- {
- std::cerr << file << ":" << e.line() << ":" << e.column() << ":" << e.text() << std::endl;
- }
- catch(const xml_schema::serializer_exception& e)
- {
- std::cerr << "error: " << e.text() << std::endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement