Hi, I just added my comments to the JIRA. I found the problem. I was doing a delete of the char* returned by XMLString::transcode(toTranscode). Once I removed the delete it works OK. I wonder why XERCES did not throw up any error / exception when I did that. I had to do the delete in my previous version where I used the DOMString.
Thanks for your help. Cheers, Raj. -----Original Message----- From: Alberto Massari (JIRA) [mailto:[EMAIL PROTECTED] Sent: Monday, March 28, 2005 5:20 PM To: Devanesan, Raj Subject: [jira] Commented: (XERCESC-1387) Unable to parse XML files using SAX2 is not recursive [ http://issues.apache.org/jira/browse/XERCESC-1387?page=comments#action_6 1618 ] Alberto Massari commented on XERCESC-1387: ------------------------------------------ I don't think it's a problem caused by Initialize/Terminate; if he is starting a new parsing while the main one is still running, there should be no risk that Terminate does anything bad. The thing I notice is that you say the hang occurs in the line MsgXmlReader* xmlReader = new MsgXmlReader(); We don't have the code for that constructor, but the fact that the code interacting with Xerces is only inside the process() method make me think that the error is in your code. Please post the code for that constructor and let us know if we should close the bug. Alberto > Unable to parse XML files using SAX2 is not recursive > ----------------------------------------------------- > > Key: XERCESC-1387 > URL: http://issues.apache.org/jira/browse/XERCESC-1387 > Project: Xerces-C++ > Type: Bug > Components: SAX/SAX2 > Versions: 2.6.0 > Environment: LINUX > Reporter: Raj Devanesan > > Hi, > I have upgraded my application to use xerces 2_6_0 from 2_2. My > application recursively evaluates XML files. Following is the code extract > Get() > { > MsgXmlReader* xmlReader = new MsgXmlReader(); > MsgConfigProcessorSimple processorSimple( config ); > processorSimple.init( file, path ); > xmlReader->addProcessor( &processorSimple ); > xmlReader->process( file ); > delete xmlReader; > } > The process method of XML Reader > //====================================================================== ======= > // process > //====================================================================== ======= > void MsgXmlReader::process( string file ) throw (MsgException) > { > SAX2XMLReader* parser = NULL; > try > { > XMLPlatformUtils::Initialize(); > parser = XMLReaderFactory::createXMLReader(); > parser->setContentHandler( this ); > parser->setErrorHandler( this ); > > parser->parse( file.c_str() ); > delete parser; > parser = NULL; > > XMLPlatformUtils::Terminate(); > } > catch( const XMLException& ex ) > { > if( parser ) > { > delete parser; > } > THROW( "Failed to parse " << file << ": " << StrX(ex.getMessage()) ); > } > catch( const SAXException& ex ) > { > if( parser ) > { > delete parser; > } > THROW( "Failed to parse " << file << ": " << StrX(ex.getMessage()) ); > } > } > I have added a feture to parse any files include by using a include > tag <include file="xyz.xml/> When I try to parse the included file > the application hangs. > MsgXmlReader* xmlReader = new MsgXmlReader(); > The above line could not create a new MsgXmlReader. > Do you know the reason. I tried the samples to do recursive evaluation and it works. If you have seen such problem please let me know -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]