Hello,
Going through the doc i noticed that EndElement
requires the implementation of a handlerbase.
However when I use a handlerbase in my code in got an
error while using SAX2XMLREADER. It complains that
setContentHandler requires a contenthandler. However
my XMLhandler is a HandlerBase.
If I use DefaultHandler instead of HandleBase in Xml.h
it works but then the endElement method is not
available. Can anybody help??
Error at execution:
[EMAIL PROTECTED]:XmlXercesFactory>make
g++ Xml.cpp -c -o Xml.o
g++ SaxParser.cpp -c -o SaxParser.o
SaxParser.cpp: In member function `virtual void
SaxParser::ParseFile(char*)':
SaxParser.cpp:58: error: no matching function for call
to `
xercesc_2_4::SAX2XMLReader::setContentHandler(Xml*)'
/usr/local/include/xercesc/sax2/SAX2XMLReader.hpp:304:
error: candidates are:
virtual void
xercesc_2_4::SAX2XMLReader::setContentHandler(xercesc_2_4::ContentHandler*)
make: *** [SaxParser.o] Error 1
>
#FILES#
#Xml.h
class xml : public HandlerBase {
public:
Xml()
virtual ~Xml()
###Here all the handler methods
}
#
in SaxParser.cpp
void SaxParser::ParseFile(char *xmlFile)
{
std::cout <<"Trying to parse "<< xmlFile << "..."
<< std::endl;
Xml handler;
c_parser->setErrorHandler(&handler);
c_parser->setContentHandler(&handler);
try {
c_parser->parse(xmlFile);
}
catch (XMLException &e){
std::cout << "Error parsing file "<<
Error(e.getMessage()) << std::endl;
exit (-1);
}
....
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
Cr�ez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
Dialoguez en direct avec vos amis gr�ce � Yahoo! Messenger !T�l�chargez Yahoo!
Messenger sur http://fr.messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]