Subject: Re: Why Doesn't IE5 use the DTD to Validate?
From: James Clark <jjc@xxxxxxxxxx>
Date: Fri, 02 Apr 1999 08:20:42 +0700
|
Chris Lilley wrote:
> Heh. What you are saying is, have some sort of switch in the document
> which says whether the document is asserted to be valid or whether it is
> just well formed?
>
> But that of course already exists, and people can choose to make just
> well-formed documents if they want.
What switch is that?
This document
<doc>foo</doc>
is well-formed but not valid. This document also is well-formed but not
valid:
<!DOCTYPE doc [
<!ATTLIST doc a CDATA "default">
]>
<doc>foo</doc>
Neither contains an assertion that is valid. Systems that assume that a
document is meant to be valid merely because it contains a DOCTYPE
declaration are broken; there's nothing in the XML spec that licenses
such an assumption.
> > The inclusion of a DTD could be interpreted as switch indicating to
> > the interpreter that structural integrity check has to be done on the
> > document.
>
> Not "could be"; *is&*. That is the intent of the XML 1.0 spec.
That's news to me.
> That is
> what a validating parser does when encountering a document with a
> doctype declaration and an internal subset with anything other than just
> entity declarations.
So what is this switch? The DOCTYPE declaration? The DOCTYPE
declaration unless it's just an internal subset containing entity
declarations? What if I have default attributes declared as well? What
if I have so many entities that I use an external subset instead? Where
does the XML spec mention such a switch?
I know Microsoft-bashing is good, clean fun, but actually they've done
the right thing here.
James
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|