You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2004/01/06 20:16:33 UTC
DO NOT REPLY [Bug 25930] New: -
Problems with SAXParser and getErrorCount
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=25930>.
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=25930
Problems with SAXParser and getErrorCount
Summary: Problems with SAXParser and getErrorCount
Product: Xerces-C++
Version: 2.4.0
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: Normal
Priority: Other
Component: Validating Parser (DTD)
AssignedTo: xerces-c-dev@xml.apache.org
ReportedBy: rjackson@ata-sd.com
Given the following code, I create a SAXParser and call the methods as shown.
DTDValidator *validator = new DTDValidator();
SAXParser saxParser(validator);
saxParser.setValidationScheme(SAXParser::Val_Always);
saxParser.setErrorHandler(&handler);
saxParser.setDTDHandler(&dtdHandler);
saxParser.setDocumentHandler(saxReader);
saxParser.parse(fileName);
if (saxParser.getErrorCount() != 0)
ThrowException("Invalid format or corrupted file.");
The XML file I am reading in has an embedded DTD within it using the !DOCTYPE
tag. When I set breakpoints in my custom DTDHandler as well as my custom
ErrorHandler, the only methods that get called are the standard Reset ones. I
can purposely make the file invalid by removing tags and no error calls are
ever made to the ErrorHandler. getErrorCount never returns zero, even for a
correct file. Is the SAXParser ignoring an embedded DTD or something? I've had
this problem in both 2.4.0 and 1.6.0. Please advise. Thank you.
Ryan Jackson
Software Engineer
Applied Technologies Associates
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org