1 // vim: set expandtab tabstop=4 shiftwidth=4:
6 using std::stringstream;
15 void Parser::on_start_document(void) {
17 cerr << "In Parser::on_start_document();" << endl;
21 void Parser::on_end_document(void) {
23 cerr << "In Parser::on_end_document();" << endl;
27 void Parser::on_start_element(const string& name, const AttributeMap& attrs) {
29 cerr << "In Parser::on_start_element(name = '" << name << "', attrs = [";
31 Hash::const_iterator last = attrs.end();
33 for (Hash::const_iterator i = attrs.begin(); i != last; i++) { //last; i++) {
34 cerr << i->first << ": '" << i->second << "', ";
36 cerr << last->first << ": '" << last->second << "'";
38 cerr << "]);" << endl;
42 out << "widget = attributes: [";
44 Hash::const_iterator last = attrs.end();
46 for (Hash::const_iterator i = attrs.begin(); i != last; i++) { //last; i++) {
47 out << i->first << ": '" << i->second << "', ";
49 out << last->first << ": '" << last->second << "'";
56 void Parser::on_end_element(const string& name) {
58 cerr << "In Parser::on_end_element('" << name << "');" << endl;
62 void Parser::on_characters(const string& chars) {
64 cerr << "In Parser::on_characters('" << chars << "');" << endl;
68 void Parser::on_comment(const string& text) {
70 cerr << "In Parser::on_comment('" << text << "');" << endl;
74 void Parser::on_warning(const string& warn) {
76 cerr << "In Parser::on_warning('" << warn << "');" << endl;
80 void Parser::on_error(const string& error) {
82 cerr << "In Parser::on_error('" << error << "');" << endl;
86 void Parser::on_fatal_error(const string& error) {
88 cerr << "In Parser::on_fatal_error('" << error << "');" << endl;
92 void Parser::on_validity_error(const string& error) {
94 cerr << "In Parser::on_validity_error('" << error << "');" << endl;
98 void Parser::on_validity_warning(const string& warn) {
100 cerr << "In Parser::on_validity_warning('" << warn << "');" << endl;
104 Parser::Parser(void): root(NULL) {
106 cerr << "In Parser::Parser();" << endl;
110 //Parser::Parser(const Hash& attrs): attrs(attrs) {
112 // cerr << "In Parser::Parser(attrs = {" /* TODO << attrs */ << "});" << endl;
116 Parser::~Parser(void) {
118 cerr << "In Parser destructor." << endl;
122 Parser::operator string(void) const {