I have also try with an empty function, but the sigsev still persist.
bool DOMPrintErrorHandler::handleError(const DOMError &domError)
{
return true;
}
It seems that it is generated before or during the function call.
I check the standard example DOMPrint and I see it uses two errorHandler.
"class DOMTreeErrorReporter : public ErrorHandler" are used while parsing a
file
XercesDOMParser *parser = new XercesDOMParser;
............
DOMTreeErrorReporter *errReporter = new DOMTreeErrorReporter();
parser->setErrorHandler(errReporter);
and
"class DOMPrintErrorHandler : public DOMErrorHandler" are used while writing
a file
DOMErrorHandler *myErrorHandler = new DOMPrintErrorHandler();
theSerializer->setErrorHandler(myErrorHandler);
mybe taht my mystake were to use the wrong error handler , I used
DOMPrintErrorHandler also for parsing a file.
BTW: there are somewhere more deeper documentation on xerces-c, the ones on
the apache site is really poor.
-----Messaggio originale-----
Da: Axel Weiß [mailto:[EMAIL PROTECTED]
Inviato: mercoledì 14 settembre 2005 18.04
A: [email protected]
Oggetto: Re: DOMPrintErrorHandler cause SIGSEGV
AESYS S.p.A. [Enzo Arlati] schrieb:
> In my application when the parser found an error and call the error
> handler a SIGSEGV occur.
> Belowe I copy the piece of code which can cause the problem.
> I'm new on using xerces-c so mybe I forget something.
> Can someone help me ?
Hi Enzo,
your code looks rather sane - the only thing I'd mention here is to check
the return value of domError.getLocation() against NULL, e.g.
> DOMLocator *pLocation = domError.getLocation();
if (pLocation != NULL){
>
> stmp = ae_util::format_string(
> "[DOMPrintErrorHandler::handleError] Location line=%d column=%d
> ooffset=%d",
> pLocation->getLineNumber(),
> pLocation->getColumnNumber(),
> pLocation->getOffset());
> MYLOG( stmp );
>
> DOMNode *pDomNode = pLocation->getErrorNode();
> XMLString::transcode(pDomNode->getNodeName(), buffer, 1023);
> XMLString::transcode(pLocation->getURI(), buffer2, 1023);
}
else{
MYLOG( "(sorry, no location object)" );
}
Does this help?
Axel
--
Humboldt-Universität zu Berlin
Institut für Informatik
Signalverarbeitung und Mustererkennung
Dipl.-Inf. Axel Weiß
Rudower Chaussee 25
12489 Berlin-Adlershof
+49-30-2093-3050
** www.freesp.de **
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]