// Copyright (c) 2005 Carl Barron. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include "xml_g.hpp" #include #include namespace std { std::ostream & operator << (std::ostream &os,std::pair const &p) { return os << p.first << '=' << p.second; } std::ostream & operator << (std::ostream &os,const tag &t) { return os << t.id; } } int main() { const char *test = // " test 1 " // " test 3 " // "" // "" "xxxyyyzzz" ; std::list tags; xml_g g(tags); if(SP::parse(test,g,SP::comment_p("<---","--->")).full) { std::for_each(tags.begin(),tags.end(),walk_data()); } else { std::cout << "parse failed\n"; } }