DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14779>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14779 SAX parsers incorrectly filter out events from XMLDocumentHandler instances installed Summary: SAX parsers incorrectly filter out events from XMLDocumentHandler instances installed Product: Xerces-C++ Version: 2.1.0 Platform: Other OS/Version: Other Status: NEW Severity: Major Priority: Other Component: SAX/SAX2 AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] 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***** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
