Hi all,
I have an XML document that purposefully contains an identity
constraint, and I was quite surprised when the parser didn't report the
error.
Looking into it, I tracked the problem down to the value of the
"fDoReportError" data member in class ValueStore. The constructor looks
like this:
ValueStore::ValueStore(IdentityConstraint* const ic,
XMLScanner* const scanner,
MemoryManager* const manager)
: fDoReportError(false)
, fValuesCount(0)
, fIdentityConstraint(ic)
, fValues(manager)
, fValueTuples(0)
, fScanner(scanner)
, fMemoryManager(manager)
{
fDoReportError = (scanner && (scanner->getValidationScheme() ==
XMLScanner::Val_Always));
}
which means errors will only reported if the validation scheme is set to
"always." In fact, it looks like the scanner code doesn't bother with
tracking identity constraints unless it's already validating. I think
that makes the fDoReportError flag superfluous, although I wouldn't
swear to it.
Do people agree that not reporting identity constraint violations when
validation is set to "auto" is a bug? If so, I would like to change the
code to set this data member to true if validation is either "always" or
"auto." If there is concern that this would lead to problems, I could
figure out a way for ValueStore to determine the value of this flag
based on the XMLScanner's actual validation mode.
Thanks!
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org