Re: Why Doesn't IE5 use the DTD to Validate?

Subject: Re: Why Doesn't IE5 use the DTD to Validate?
From: Chris Lilley <chris@xxxxxx>
Date: Thu, 01 Apr 1999 13:35:52 +0200

Jonathan Marsh wrote:
> 
> This is as designed, not a bug.

Well, IE5b2 did not have that dresign (or did not display that bug). I
was very pleased to see that IE5b2 did the right thing here.

> The IE5 XML parser is a validating parser, with two properties set through
> DOM extensions to control DTD handling:
>  - validateOnParse determines whether validation errors are presented to the
> user.

So, it always validates, but the flag controls whether error messages
are shown? That sounds fine, until you realise that if a validating
parser founfd an error then not only do you have error messages, you
also have no parse tree. So, what gets displayed? Presumably, some
fixed-up, error-corrected tree. I expect that the error-correction is
not documented. So, back to the mess that HTML is in - no-one jknows
what the parse tree is. I fail to see how you can call this a feature.

>  - resolveExternals determines whether the DTD or XML Schema is loaded and
> datatypes, default values, etc. are honored.
> 
> The values of these properties when browsing directly to XML documents is
> validateOnParse=false and resolveExternals=true.


> 
> When browsing XML documents on the Web, surfacing validation errors is of
> little apparent value.  

Quite the contrary. I agree that the way in which error messages is
presented can be configurable. But if there are validation errors, ther
eis nothing to display.

> I would not expect publishers to author both a DTD
> or XML Schema and documents that don't conform to that DTD/Schema.  So the
> vast majority will not generate validation errors. 

Um. 

a) if the vast majority will be valid, whats the harm in validating them 

b) Experience shows that many people ("publishers " is a narrow term,
the Web has opened up publishing to anyone) check their pages by trying
them out in a browser. IE5b2 was very helpful there - if the page
displayed, it was valid.

c) If people want validation, they will make valid documents. If they
don't, they will make well formed documents.

>  For those that declare a
> DTD and are invalid, is it no better to give the user a validation error
> instead of displaying the document, in fact the validation error could
> prevent the user from viewing an otherwise perfectly good document. 

Its not "perfectly good". Its broken. What, infact, do you display? The
part of the document up to the error? Or do you "fix-up" the rest and
carry on?

> Also
> the performance penalty for validation is significant and should not be
> imposed on end-users without good reason.

Could you provide some figures to justify this claim?

Also you contradict it - you say that the default is to parse but not to
display error messages. So you get exactly the same performance penalty,
if it is significant, which I have nit seen any evidence for.

> The only scenario we could come up with where validation is useful when
> browsing XML documents is when the browser is used as a development tool,
> allowing easy checking of well-formedness and validation for a document in
> progress.  This scenario can be accomplished by a number of alternative
> mechanisms without impacting the browsing experience - a simple tool that
> validates an XML document could be written 

"Could be written" means "will not happen for most users". If its not
there, out of the box, most folk will miss it. Even hiding it in a
preferences dialog with the default set to "off" will mean that a good
proportion of authors won't know to switch it on. Having to write some
code immediately restricts the number of people who will do this.

> in a few lines of JavaScript, see
> http://msdn.microsoft.com/downloads/samples/internet/xml/xml_validator/defau
> lt.asp for an example.
> 
> We considered several mechanisms for allowing developers to "turn on"
> validation errors but did not find a clean solution that could be
> implemented in time for the IE5 release.

Oh, come on. A button on the toolbar. An option in the preferences. This
isn't rocket science. And, this was a feature that was *already
implemented* in IE5b2 and which was explicitly *removed*, which took
time.

So, the upshot of this is that people will believe their documents to be
valid when they are, in fact, not.

How about implementing an "authoring checker" switch, providing some
basic UI for it and then folding that into the 5.01 dot release? Soon?
Before too many people notice? That could offset some of the damage.


--
Chris


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread