Re: Why DOCTYPE Declarations for XHTML?

On Tue, 18 Jan 2000, Murray Altheim wrote:
> "W. Eliot Kimber" wrote:
> > Murray Altheim wrote:

> > I'm not objecting to enabling validation. I'm only objecting to the
> > requirement that conforming XHTML documents must use a particular form
> > of DOCTYPE declaration (or even have a doctype declaration at all).
> 
> If we eliminate the requirement on DTD validation, we not only allow
> for other types of validation, we loosen the conformance requirements 
> to the point where it becomes *less* possible to ascertain that a
> given instance is XHTML, not more. 

But you don't have to, or need to, eliminate validation with respect to a
specific DTD!  Part of the point here is that the requirement exists in
normative prose only, until a standardized mechanism (such as AFDR, or a
PI, or - &deity; forbid - some namespace kludgery) is mandated, because in
any event, the doctype declaration is simply not the way even to *express*
this.  The XML 1.0 spec (Section 2.8) says:

   "An XML document is _valid_ if it has an associated document type
    declaration and if the document complies with the constraints
    expressed in it."

It does not say that the constraints expressed in the doctype declaration
must describe the entire document - i.e. that a doctype declaration if
present must contain a "full DTD"!  For instance, the XML spec does not
require, unlike ISO8879 (Clause 11.1), that the root element have an
element declaration in the effective declaration subset.  This is an issue
for validating processors only, for which the various validity checks come
unbundled.  Non-validating processors are still required to grok internal
subsets anyway.

This is actually very sensible, given that a declaration subset can serve
purposes other than just validation: e.g., it supplies default values and
type information for attributes, FPIs for notations, and the biggie - the
expansions for entity references.  So, there are reasons to have a doctype
declaration - because that's how one gets a declaration subset *at all* -
without an implication that the mere presence of the doctype declaration
necessarily expresses an explicit intent of validation or validity (and
isn't all this also the basic point of the 'standalone' parameter?)

Beyond that, the single biggest benefit of the well-formedness concept is
that it allows a clean separation of parsing and validation: validation
now is a strictly "value-added" activity that need not assume or require a
parse.  But a doctype declaration can still be needed, for all the other
reasons mentioned.  

> If we relax the requirement for DTD validation, then *anything* goes,
> and an unbounded definition is no definition at all, not in this
> environment. We have a very limited set of tools available to us.

But you don't have to.  You can say something to the effect that attaching
a specific doctype declaration to the "resolved" standalone form of the
instance markup must comprise a valid document.

> > > > Just because XML provides the optional feature of DOCTYPE declarations
> > > > doesn't mean that XHTML is obligated to require their use or impart any
> > > > special meaning to their use when there are other was to get what you
> > > > want which are reliable.
> > >
> > > Such as? Supported by what tools? Something that given a cold day in
> > > hell would be accepted by the W3C? If we don't use validation via DTD
> > > we have no acceptable means to establish a document type at all.
> > 
> > That's my point: *you have no means* provided by XML 1.0.
> 
> No, we *do* have DTDs. That's why we're using them. They don't provide
> the type validation you're talking about, but they do guarantee that
> the markup in the document conforms to the DTD. 

Only if internal subsets are prohibited, bu that's throwing the baby out
with the bathwater.


Arjun

Received on Tuesday, 18 January 2000 20:39:17 UTC