[ 
http://issues.apache.org/jira/browse/XERCESC-1387?page=comments#action_61618 ]
     
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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to