RE: DTD and schema - what's the difference?

Here is my understanding I hope it helps... (it may be a little too
simplistic, but it works for me)
 
An XML Schema and a DTD do mostly the same thing.
 
A DTD was the original way a SGML document was defined.  All original
versions of HTML, MathML, and even XML were defined this way.  A DTD is
basically down to the metal of the hardware so to speak.
 
With an XML Schema, what is happening is this.  Through XML (which was
originally defined through a DTD) a language of XML called an XML Schema
was created to allow for an extendable schema to define an XML document
(if you follow me).  So from the XML DTD that was created, XML was
created to allow an extendable tagset with some specific rules.  From
that extendable tagset, the XML schema came about which defines some
base types and allows for extending the types through XML naming.
 
So you could say that XML schema goes back to fix things a DTD could not
do well.  Be easily extendable and have certain base types.  However the
XML Schema is itself defined by XML (Maybe it has its own DTD, but I
have not checked) which in turn was defined by a DTD.
 
Scrambled your brains enough??? :-)
 
Richard Norma
Web/Application Developer

-----Original Message-----
From: Ron Woodall <nor@htmlcompendium.org> 
Sent: Friday, January 10, 2003 6:57 AM
To: <www-html@w3.org>
Subject: Re: DTD and schema - what's the difference?




Hi: 

         Thank you for the several who responded to my query. I'm 
addressing these comments. "through confusion comes understanding" 

>In terms of purpose, none: either can be used for exactly the same job,
to 
>define the structure of an XML document. 
> 
>Otherwise, lots. In particular, XML Schemas are themselves written in
XML, 
>with all that implies. 

         What then is the function of an XML DTD as compared to an XML 
Schema as compared to an SGML DTD or are they synonymous? As near as I
can 
figure XML DTDs and SGML DTDs function as "page interpreters" whereas
the 
XML Schema deals with XML "structure?" 


and ... 

>Whereas XML DTDs are *part* of XML.  I believe the main difference is 
>that XML reduced the expressive power of SGML DTDs and XML schemas adds

>back a lot of that power but in different directions (e.g providing 
>data type information).  However, the only way to properly answer the 
>question is for the questioner to go and read the source documents. 

         I've spent the last month and a half reading the documents and 
still can't seem to cobble together an answer. Is there a specific
document 
that will provide me with a comparison? 

         Thanks for the help. 

         Ron Woodall 

_______________________________________ 
Ron Woodall 
nor@htmlcompendium.org 

The Compendium of HTML Elements 
"your essential web publishing resource" 

_ available at/disponible à: 
HYPERLINK "http://au.htmlcompendium.org/index.htm"
\nhttp://au.htmlcompendium.org/index.htm (Australia) 
HYPERLINK "http://www.htmlcompendium.org/index.htm"
\nhttp://www.htmlcompendium.org/index.htm (Europe and North America) 



--- 
Incoming mail is certified Virus Free. 
Checked by AVG anti-virus system ( HYPERLINK "http://www.grisoft.com"
\nhttp://www.grisoft.com). 
Version: 6.0.434 / Virus Database: 243 - Release Date: 12/25/2002 
  


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.434 / Virus Database: 243 - Release Date: 12/25/2002
 

**************************************************************************************************
The contents of this email and any attachments are confidential.
It is intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or  the 
sender immediately and do not disclose the contents to any one or make copies.

**************************************************************************************************

Received on Friday, 10 January 2003 12:20:58 UTC