XML Schema and XML DTDs
Date: Thu, 29 Jun 2000 21:08:39 +0800 From: Rick JELLIFFE <email@example.com> To: XML-DEV@xml.org Subject: Re: XML Schema?
> Request for clarification,
> I would like to build on this question: are they (schemas) a replacement
> for DTD's? Or are they validated using a DTD? - What is the future of DTDs
> - with respect to XML.
For back-end data interchange, especially from a DBMS, you can expect XML Schemas to replace DTDs. They provide better datatyping and they are designed to fit in conveniently with RDBMS and OO languages such as Java.
For data that is closer to human users or file-systems, XML Schemas cannot entirely replace DTDs yet:
there is no way to define entities, in particular entities for special characters or entities to allow a document to be split into several shared pieces;
type is directly keyed from the element name (or an xsi:type attribute), which does not allow the user-friendly markup idiom of where the element name gives the basic type of the element and an attribute declares the subtype; instead, if one wants subtyping, one has to make an explicit new element named for that -- one must have <textInput> rather than <input type="text">...
there may be some uses of parameter entities which do not have explicit equivalents in XML schemas: in particular, INCLUDE marked sections (i.e. schemas paramterized by a header in the document);
if the constraints in your document are not regular and not keys, or if you have a lot of type selection based on the occurrence of values in attributes or from external vocabularies, then perhaps XML Schema will offer little in advance of DTDs for validation.
if you have a severe sensitivity to data size, DTDs may be preferred as a distribution schema. For XML Schemas which do not make use of the tag/type distinction (i.e. for schemas where an element name always selects the same content model), then XML Schemas can be transformed (e.g. by XSLT) into DTDs for distribution, but at the cost of losing the ability to validate datatyping.
XML Schemas is namespace based, so if you do not use namespaces you cannot use XML Schemas (last time I checked...hmmm don't quote me, I have to check the status quo and my shocking memory confuses me easily)
So the big question is whether XML Schemas provides enough extra bangs per buck from its data orientation to overcome the deficiencies listed above, where it does not replace DTD functionality.
And, of course, there are some kinds of data for which neither XML Schemas nor DTDs seem useful: XSL-FO has a lot of complex inheritable declarations (if X has an attribute Y, the children of X can also have Y attributes).
I am sure the XML Schema WG at W3C will be very interested in finding out how well it fits user's requirements; I hope people will take a good hard look at the upcoming CR draft. I think readers of this list will know, from the carefully prepared 210+ long issues list so dillegently prepared by Michael Sperberg-McQueen, that the XML Schema WG is trying very hard to have public review systematically addressed, since this is such an important issue.
(not writing on behalf of XML Schema WG)
This is xml-dev, the mailing list for XML developers. List archives are available at http://xml.org/archives/xml-dev/
Prepared by Robin Cover for The XML Cover Pages archive.