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

Subject: Re: Why Doesn't IE5 use the DTD to Validate?
From: Paul Prescod <paul@xxxxxxxxxxx>
Date: Thu, 01 Apr 1999 08:45:10 -0600
Chris Lilley wrote:
> 
> 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'm not sure what you mean here. Consider:

<!ELEMENT FOO (BAR, BAZ)>

...

<FOO><BAZ/><BAR/></FOO>

The tree does not conform to the DTD but it is not ambiguous. In the face
of errors IE5 should give you exactly the same parse tree that a
well-formed only parser gives you.

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

I would usually agree with you but in this case there is a bug in the XML
spec. that causes a problem. If you have a DTD only in order to specify a
single defauled attribute or entity then that document becomes well-formed
by *not valid*. There is no concept of "has a DTD but is not meant to be
valid" or "conforms to the declarations that are available but the
declaration are not complete."

If you look at the "Element Valid" validity constraint you will see that
an element is only valid if its element type is declared and all of its
child elements are also of types that have been declared.

I propose a processing instruction that says that a document has a DTD but
is not meant to be valid.

<?xml:not-valid?>

Then validating applications would treat it as if it were just
well-formed.

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for only himself
 http://itrc.uwaterloo.ca/~papresco

"Other Operating Environments Will Have Trouble Keeping up with Linux's
Growth"
 - http://www.idc.com/Data/Software/content/SW033199PR.htm
   International Data Corporation bulletin


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


Current Thread