Re: Is ist always possible to define a DTD for Well Formed XML Docume nts?

On Tue, 20 May 1997 15:08:54 -0400 (EDT) Bernhard Weichel said:

>In Barcelona I raised the question if it is always possible to define a
>DTD for Well Formed XML Documents to Tim Bray. We couldn't find a
>quick answer, so Tim asked me toI raise the question here again.
>
>The problem seems to me, that WF Documents can have an unlimited
>variety of tree structure. The application must be able to handle this.
>
>The question is in other words: Is it always possible to "upgrade" a WF
>document to a valid document.  Yes, it is always possible to define a
>DTD using the contentspec 'ANY'.  But this gives no validity information
>at all.

You started by asking the question "is there always a DTD?"  The answer
is yes, as you've just demonstrated.  And by the only definition of
validity that I know, it *does* produce validity information.  The
document matches the DTD; the document is valid.  Q.E.D.

Now you seem to be wanting to restrict the question to 'good' or
'real' DTDs.  I know that Tim leans that way, too.  You're chasing
a chimera.

There are at least two implementations of grammar generators which
will produce something resembling a DTD from an arbitrary well-formed
document:  the well-known Fred, at OCLC, and a program in Lisp
written for a thesis in Oslo (? or was it Bergen?) by S. Solstrand
a few years back.  Her work deserves to be better known, but that
would probably require an English translation.

Whether these programs produce 'real', or 'good' DTDs in the sense that
I believe you are subliminally using these terms, I cannot tell you,
since I doubt seriously that a meaningful definition can be given that
allows 'real' DTDs to be distinguished reliably (formally, mechanically)
from DTDs in which every element has a content model of ANY.

-C. M. Sperberg-McQueen

Received on Thursday, 22 May 1997 20:02:23 UTC