You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by BARUCH Deborah FTRD/DMR/LON <de...@rd.francetelecom.com> on 2002/10/16 17:35:09 UTC
parsing successively two documents does not work
Hi,
I am trying to parse two documents, one after the other, using a SAXParser. I first add a problem because I was calling XMLPlatformUtils::Initialize each time I was parsing. I have corrected this so now it is only called once in my process. My problem is now that I've got a Segmentation fault on the line SAXParser * parser = new SAXParser; when parsing for a second time. That does not happen the first time I parse. Any ideas ?
here is my code calling the parser:
SAXParser* parser = new SAXParser;
parser->setValidationScheme(valScheme);
parser->setDoNamespaces(doNamespaces);
parser->setDoSchema(doSchema);
parser->setValidationSchemaFullChecking(schemaFullChecking);
try
{
SAXIPMMHandlers handler(encodingName, unRepFlags);
parser->setDocumentHandler(&handler);
parser->setErrorHandler(&handler);
pMemBufIS = transformInputXml(xmldoc);
parser->parse(*pMemBufIS);
errorCount = parser->getErrorCount();
info = handler.getInformation();
handler.~SAXIPMMHandlers();
}
catch (const XMLException& toCatch)
{
cout << "catching error\n";
cerr << "\nAn error occurred\n Error: "
<< toCatch.getMessage()
<< "\n" << endl;
return NULL;
}
delete parser;
delete pMemBufIS;
Thanks
Deborah
"This e-mail, and any files transmitted with it, is intended only for the use of the person/s or entity to whom it is addressed. If you are not the intended recipient (or authorised to receive information for the intended recipient) you must not use, disclose, copy, print or rely on this e-mail. If an addressing or transmission error has misdirected this e-mail, please notify the author by replying to this e-mail and delete all copies of this e-mail. Thank you."