"Juergen Hermann" <[EMAIL PROTECTED]> writes:
> On 02 Sep 2001 07:58:57 -0600, Jason E. Stewart wrote:
>
> >Is this one error for the non-validating, and one for the validating
> >parser?
>
> Yes.
It might be useful to label them so we know which failed. In some
cases it's obvious and you have it labeled, others you don't.
> >Also, how are you instructing the parser to be
> >validating/non-validating? You need to use the setValidationScheme()
> >method and the Val_Always or Val_Never enums, or it won't work
> >properly. When I tried Val_Auto, I got lots of errors.
>
> Since I use SAX2, I use the standard SAX2 validation feature, and did
> set the Apache "dynamic" feature to true.
Ah, I see, I had not yet tested SAX2.
So is your code doing the equivalent of:
if (valScheme == SAX2XMLReader::Val_Auto)
{
parser->setFeature("http://xml.org/sax/features/validation", true);
parser->setFeature("http://apache.org/xml/features/validation/dynamic", true);
}
if (valScheme == SAX2XMLReader::Val_Never)
{
parser->setFeature("http://xml.org/sax/features/validation", false);
}
if (valScheme == SAX2XMLReader::Val_Always)
{
parser->setFeature("http://xml.org/sax/features/validation", true);
parser->setFeature("http://apache.org/xml/features/validation/dynamic", false);
}
Which means setting dynamic to 'true'. I would set it to 'false'. When
I set validation explicitly, I get the results I expected.
jas.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]