Re: XML Schema -> DTD?

Michael Hübner writes:

>> Wasn't it a design goal to allow
>> all XML Schema definitions to be
>> translated to (less restrictive) DTD definitions?

The simple answer is no:  it is a goal of schemas to provide significantly
greater richness than DTDs (see the schema workgroup requirements
document[1]).  Unless I'm missing something, it so happens that the
particular schema you give does correspond to a simple DTD, except that
DTD's cannot capture the naming of what we call complex types as distinct
from what XML 1.0 calls element types (which correspond to "element
declarations" in schemas).

On the other hand, and consistent with our requirements, schemas can
express many important constructions, such as direct validation of
namespace qualified content, certain kinds of inheritance relationships,
etc., which can be modeled weakly if at all in a DTD.  When using such
features, it is in general impossible to write a DTD that accepts exactly
the same documents, or that captures the same structural relationships
among the declarations (e.g. substitutability of types.)  Of course, there
are also cases in which you can write a "loose" DTD, which accepts the same
documents as a schema, but fails to reject some that should be rejected.
In other words, it supports partial validation.

Your confusion may arise from the fact that we have intended to meet the
inverse requirement, I.e. that every DTD be translateable into a
corresponding schema.  For the most part we have done so, but due to
limitations in the flexibility of XML 1.0 itself, it has proven impossible
to reimplement certain aspects of entities --- essentially, XML 1.0 defines
them as DTD mechanisms, and relates them very closely to the notion of well
formedness.  Schemas do model most uses of parameter entities.  I hope this
is helpful.

[1] http://www.w3.org/TR/1999/NOTE-xml-schema-req-19990215

------------------------------------------------------------------------
Noah Mendelsohn                                    Voice: 1-617-693-4036
Lotus Development Corp.                            Fax: 1-617-693-8676
One Rogers Street
Cambridge, MA 02142
------------------------------------------------------------------------

Received on Wednesday, 20 September 2000 09:36:09 UTC