SAX parsers report ignorable whitespace by calling ignorableWhitespace(). There's no need for a flag as in the DOM model, because your ignorableWhitespace() implementation chooses what, if anything, to do with such content. (The HandlerBase implementation does nothing with it.) In any case, having looked at the schema specification, I don't think there's any way the offending documents can be considered schema-valid. If the element were allowed to have content, it would be a different story.
I don't have experience validating with SAX; the SAX2Count sample might give you some ideas as to how to report schema validation errors. If you need further assistance, more specific information might help. How does the parser "die silently" - does the process terminate, or does the parse call return, perhaps with an error code? What's the message printed on stderr? -----Original Message----- From: Michel Courtine (JIRA) [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 06, 2006 10:41 AM To: [email protected] Subject: [jira] Commented: (XERCESC-1601) SAX2 Parser throws an uncaught xercesc_2_7::XMLValid::Codes exception when setValidationConstraintFatal is on with enclosing xml tags Michel Courtine commented on XERCESC-1601: ------------------------------------------ Thanks Jesse, This is actually what I thought initially but couldnt find the "ignoreWhiteSpaces" feature in the xerces SAX2Parser, only in the DOM model. Is this a missing features or is it part of the SAX definition to be sensitive to whiteSpaces ? Second, why would the parser die silently and print a message on stderr in such a case. I was expecting it to throw an exception so that I can report a nice validation error message back. This is the reason why I turned setValidationConstraintFatal to true. Is there a better way for me to detect and report invalid files at "parse time" ? Best regards. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
