XML trade off 1 - DTD vs XML Schema

Rick Jelliffe ricko at allette.com.au
Tue Aug 3 22:37:28 BST 1999


 From: Mark Birbeck <Mark.Birbeck at iedigital.net>

>I think much of what you say is true, but I remain a bigger fan of XML
>schemas than you obviously are!

Well, I have publically said that it was not worthwhile for DTD syntax
to be extended to allow schemas about two years ago: I don't think I
need to
prove or detail my pro-instance syntax credentials! What I am against
are
the claims that instance syntax is always better than DTD syntax, or
that
mere syntactical sugar represents a real advance in modeling. I know
people
like to get a buzz going, and it is good to be excited about one's job,
but I
don't think many of the claims being made are as clear-cut as they
sound.

>... My argument is based on a recognition that
>what elements of a schema I need depends on what is the purpose of the
>XML document to which the schema refers. For example, if I have two
>servers that sit all night passing data to each other, the purpose of
>the schema is simply to validate the integrity of the data passed.

Now you are changing the goalposts! Verbosity is a disproportion of the
schema w.r.t. the data or its use; if you are passing the same kind of
data between servers all night, the verbosity question does not arise.

> If one server sends:
>
><statusReport>
>  <time>1201</time>
>  <station>123</station>
>  <status>56</status>
></statusReport>
>
>why bother sending more schema info than the name of the root document
>and the two children that it has?

But so could a DTD. I could have
<!DOCTYPE statusReport SYSTEM

http://www.ricko.com.zx/dtd/statusreport?gi=statusReport+time+station+st
atus ">
and have the DTD generated at the server. The DTD could be generated
from data marked up in instance syntax, for ease of implementation, if
you like! The server that generates the data can also generate the
correct URI.

>For this same reason, I
>must say I am surprised that fans of XML can be looking to use non-XML
>syntaxes to define any type of data, unless totally
>unavoidable/impractical.

DTDs are XML syntax.

In any case, I think that there is good evidence from programming
languages that
humans like a change in syntax when there is a change in the nature of
the data,
and that highly cohesive fields that act together as a name should be
kept together:
hence  JavaScript is not XML syntax and URIs are not instance syntax.
Furthermore,
I think the notion that "terseness is of minimal importance" will be
more applicable
to some syntaxes within a document than others.

> The solution used in IE5 - where
> the namespace definition can be used to point to a schema for that
node
> - allows documents to effectively contain other documents.
...
>People kept thinking that there needed
>to be a document at the end of a namespace URI, and that it would be
>used to validate. Even though they were wrong, they thought that
because
>it has a nice intuitive feel to it.

First you praise IE5 for doing it, then you say it is wrong. I am
missing something.

>Finally, no-one has come back on my point from previous emails, that if
>you want to be able to index and manipulate the massive amount of XML
>data that will exist in coming years, often using non-standard schemas,
>you will need to be able to manipulate the meta-meta-data. And what
>better tool to use to define this than good old XML?

The best way to future-proof schemas is to represent them in an ISO
standard
language, certainly not in a language developed by a vendor's
consortium.
So DTDs more certain: in fact, their unique syntax prevents mutations.
There is no need to say "DTDs or Schemas"--DTDs *and* Schemas can
coexist.

Rick Jelliffe


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)





More information about the Xml-dev mailing list