Hi Henry,
first of all, thanks for the time you spent trying my test. Your answer pushed
me to face the problem again from another standpoint.
Validation seems to be working know, even with real and more complex files.
Frankly I cannot say I have really understood where the trouble was, but I
believe it was tied to the way I retrieve the reference DTD in my program. In
fact I keep it stored in the application JAR file and I pass it to the parser
through the EntityResolver interface. Probably something was (silently) going
wrong here.
Anyway, to justify myself, I retried once again to parse my little test (that
SAXCount correctly refuses) with XML Viewer 1.2 and it reads it without a
problem. So, since I was using that software to verify my own, this has lead me
out of my way.
Thanks again to all!
Amedeo
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 04, 2001 9:30 PM
Subject: Re: DTD validation
> Hi Amedeo,
>
> I tried your test.xml and test.dtd using the sax.SAXCount sample
> using both Xerces-J 1.4.2 and 1.4.3, and both detected the error, so I'm
> not sure why you don't see an error reported.
>
> $ java sax.SAXCount -v test.xml
> [Error] test.xml:9:14: The content of element type "container" must match
> "(content)".
> test.xml: 1793 ms (4 elems, 0 attrs, 25 spaces, 6 chars)
>
>
> I assume that you've enabled the validation feature, because you
> indicated in your first note on this thread that you were getting
> callbacks for other validation errors. Is that correct?
>
> ((XMLReader)parser).setFeature("http://xml.org/sax/features/validation",
> true);
>
>
> Thanks,
>
> Henry
> ------------------------------------------------------------------------
> Henry Zongaro XML Parsers development
> IBM SWS Toronto Lab Tie Line 778-6044; Phone (416) 448-6044
> mailto:[EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]