[ http://nagoya.apache.org/jira/browse/XERCESC-729?page=history ] Alberto Massari resolved XERCESC-729: -------------------------------------
Assign To: (was: Xerces-C Developers Mailing List) Resolution: Fixed Fix is in CVS. Please verify. Alberto > SAX parsers incorrectly filter out events from XMLDocumentHandler instances > installed > ------------------------------------------------------------------------------------- > > Key: XERCESC-729 > URL: http://nagoya.apache.org/jira/browse/XERCESC-729 > Project: Xerces-C++ > Type: Bug > Components: SAX/SAX2 > Versions: 2.1.0 > Environment: Operating System: Other > Platform: Other > Reporter: David Bertoni > > Both SAXParser and SAX2ReaderImpl filter out whitespace before the document > element for reporting SAX events. > However, they also filter out this whitespace for any XMLDocumentHandler > instances installed as "advanced document handlers." I think this is a bug, > since users may well be interested in such events, even though they aren't > really part of the document content. This also makes things consistent with > the way the underlying XMLScanner reports the events. > I've attached proposed patches. > cvs -z9 diff SAX2XMLReaderImpl.cpp (in directory V:\xml- > xerces\c\src\xercesc\parsers\) > Index: SAX2XMLReaderImpl.cpp > =================================================================== > RCS file: /home/cvspublic/xml- > xerces/c/src/xercesc/parsers/SAX2XMLReaderImpl.cpp,v > retrieving revision 1.12 > diff -r1.12 SAX2XMLReaderImpl.cpp > 621,622c621,625 > < if (!fElemDepth) > < return; > --- > > if (fElemDepth) > > { > > // Call the installed LexicalHandler. > > if (cdataSection && fLexicalHandler) > > fLexicalHandler->startCDATA(); > 624,626c627,629 > < // Call the installed LexicalHandler. > < if (cdataSection && fLexicalHandler) > < fLexicalHandler->startCDATA(); > --- > > // Just map to the SAX document handler > > if (fDocHandler) > > fDocHandler->characters(chars, length); > 628,634c631,634 > < // Just map to the SAX document handler > < if (fDocHandler) > < fDocHandler->characters(chars, length); > < > < // Call the installed LexicalHandler. > < if (cdataSection && fLexicalHandler) > < fLexicalHandler->endCDATA(); > --- > > // Call the installed LexicalHandler. > > if (cdataSection && fLexicalHandler) > > fLexicalHandler->endCDATA(); > > } > *****CVS exited normally with code 1***** > cvs -z9 diff SAXParser.cpp (in directory V:\xml-xerces\c\src\xercesc\parsers\) > Index: SAXParser.cpp > =================================================================== > RCS file: /home/cvspublic/xml-xerces/c/src/xercesc/parsers/SAXParser.cpp,v > retrieving revision 1.9 > diff -r1.9 SAXParser.cpp > 683,688c683,688 > < if (!fElemDepth) > < return; > < > < // Just map to the SAX document handler > < if (fDocHandler) > < fDocHandler->characters(chars, length); > --- > > if (fElemDepth) > > { > > // Just map to the SAX document handler > > if (fDocHandler) > > fDocHandler->characters(chars, length); > > } > *****CVS exited normally with code 1***** -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://nagoya.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]