http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1329

*** shadow/1329 Thu Apr 12 14:12:44 2001
--- shadow/1329.tmp.12527       Wed May  9 11:50:30 2001
***************
*** 4,11 ****
  |        Bug #: 1329                        Product: Xerces-C                |
  |       Status: NEW                         Version: 1.4                     |
  |   Resolution:                            Platform: PC                      |
! |     Severity: Major                    OS/Version:                         |
! |     Priority:                           Component: SAX/SAX2                |
  +----------------------------------------------------------------------------+
  |  Assigned To: [EMAIL PROTECTED]                                  |
  |  Reported By: [EMAIL PROTECTED]                                         |
--- 4,11 ----
  |        Bug #: 1329                        Product: Xerces-C                |
  |       Status: NEW                         Version: 1.4                     |
  |   Resolution:                            Platform: PC                      |
! |     Severity: Major                    OS/Version: All                     |
! |     Priority: High                      Component: SAX/SAX2                |
  +----------------------------------------------------------------------------+
  |  Assigned To: [EMAIL PROTECTED]                                  |
  |  Reported By: [EMAIL PROTECTED]                                         |
***************
*** 124,127 ****
  
  Possible solutions include try/catch blocks to SAX2XMLReader::startElement and 
  SAX2XMLReader::endElement, or simply ensuring the the fStringBuffer, fPrefixes 
! and prefixCount (any others?) are reset properly on each reuse of the parser.
--- 124,171 ----
  
  Possible solutions include try/catch blocks to SAX2XMLReader::startElement and 
  SAX2XMLReader::endElement, or simply ensuring the the fStringBuffer, fPrefixes 
! and prefixCount (any others?) are reset properly on each reuse of the parser.
! 
! ------- Additional Comments From [EMAIL PROTECTED]  2001-05-09 11:50 -------
! I think the correct resolution is to ensure that the prefix stack mechanism 
! gets reset each time the XMLReader is used. For example, add the following 
! function to SAX2XMLReaderImpl:
! 
! void SAX2XMLReaderImpl::resetPrefixStack()
! {
!     // Pop any prefix buffers left over from previous uses of this XMLReader
!     while (!prefixCounts->empty())
!     {
!         unsigned int numPrefix = prefixCounts->pop();
!         for (unsigned int i = 0; i < numPrefix; i++)
!         {
!             XMLBuffer * buf = fPrefixes->pop() ;
!             fStringBuffers.releaseBuffer(*buf) ;
!         }
!     }
! }
! 
! 
! In each override of SAX2XMLReaderImpl::parse, call the function to ensure that 
! the buffers are reset, as in:
! 
! void SAX2XMLReaderImpl::parse (const   InputSource&    source)
! {
!     // Avoid multiple entrance
!     if (fParseInProgress)
!         ThrowXML(IOException, XMLExcepts::Gen_ParseInProgress);
! 
!     try
!     {
!         resetPrefixStack();
!         fParseInProgress = true;
!         fScanner->scanDocument(source, freuseValidator);
!         fParseInProgress = false;
!     }
! 
!     catch (...)
!     {
!         fParseInProgress = false;
!         throw;
!     }
! }

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

Reply via email to