GNOME Bugzilla – Bug 301712
SaxParserCallback::characters() calls wrong callback
Last modified: 2005-04-24 15:06:15 UTC
Distribution/Version: Gentoo Base System version 1.6.11 $ tar xvzpf libxml++-2.10.0.tar.gz $ cd libxml++2.10.0 $ ./configure $ make CXXFLAGS='-ggdb3' $ cd examples/sax_parser $ ./example | grep on_characters (returns 1) $ gdb .libs/example GNU gdb 6.3 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1". (gdb) b MySaxParser::on_characters Breakpoint 1 at 0x804a251: file myparser.cc, line 64. (gdb) r Starting program: /home/ka0ttic/code/libxml++-2.10.0/examples/sax_parser/.libs/example [Thread debugging using libthread_db enabled] [New Thread -1213028160 (LWP 18634)] <snip output> Program exited normally. -- Looking at libxml++/parsers/saxparser.cc shows that SaxParserCallback::characters() calls SaxParser::on_cdata_block() rather than SaxParser::on_characters(). Once replaced, the example displays the text as expected.
Created attachment 45587 [details] [review] fix_on_chars.diff
Committed to HEAD. Thanks. Please remember to create a cvs patch, and patch the ChangeLog, in future.