<!DOCTYPE R> is a doctype decl, yet the DocTypeHandler doesn't get called
(although the parser did parse it). I am writing an application which
attempts to preserve most of the sturcture of the original XML file, so in
response to the event I would simply note that there is a doctype decl with
R for the root and no system or public id.
You must have a DOCTYPE decl to have an internal/external subset but you
don't need an internal/external subset to have a DOCTYPE decl. Having a
DOCTYPE decl and having subsets are two different things.
If there is no internal or external subset, why should the auto mode
attempt to validate the document? It must fail because there is no
declaration for the root element. If the current behavior is the correct
behavior, at least the documentation should change. The documented
behavior makes more sense to me.
BTW I get different errors when parsing "<!DOCTYPE R><R/>" with Val_Always
vs Val_Auto.
In answer to your question about why would you have a doctype decl without
subsets, I don't know why you would do that. I was just arguing that the
doctype handler should be called because it is legal XML syntax.
Chris
At 04:32 PM 3/29/2001, you wrote:
>I'm not sure I agree with that. The parser calls event callbacks based on
>things it parsed. If it never parsed a DOCTYPE decl, then why would it call
>anything on the doc type handler? And given that you must have a DOCTYPE
>decl in order to have either type of subset, validing if a DOCTYPE decl is
>present makes a lot of sense. If you didn't need any subsets, why did you
>have a DOCTYPE decl?
>
>--------------
>Dean Roddey
>Software Geek Extraordinaire
>Portal, Inc
>[EMAIL PROTECTED]
>
>
>
>-----Original Message-----
>From: Chris Hill [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, March 29, 2001 12:59 PM
>To: [EMAIL PROTECTED]
>Subject: DOCTYPE without subsets
>
>
>SAXParser::setValidationScheme takes Val_Auto as an option.
>
>Val_Auto is documented as "turn on validation if any internal/external DTD
>subset have been seen"
>
>The actual meaning appears to be turn on validation if a doctype
>declaration has been seen.
>
>I also noticed that my DocTypeHandler does not get called if there are no
>subsets which seems wrong. A doctype without an internal or external
>subset is legal (although not particularly useful) and should be passed on
>to the doctypeDecl function.
>
>Chris
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]