W3C home > Mailing lists > Public > www-html@w3.org > January 2003

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

From: Nick Boalch <nick@fof.durge.org>
Date: Fri, 10 Jan 2003 20:01:50 +0000
Message-ID: <3E1F26AE.7060303@fof.durge.org>
To: Ron Woodall <nor@htmlcompendium.org>
CC: www-html@w3.org

Ron Woodall wrote:

> How am I doing so far? 

Right. The way it works is this:

In the beginning there was the word, and the way the word got put in 
documents was defined by SGML, in ISO 8879:1986. SGML is a language used 
for defining markup languages (called 'applications').

Each application has an SGML Declaration, a document that specifies the 
characters that will appear in it, and a DTD, a document that defines 
the syntax of the markup elements.

HTML is an application of SGML: the declaration for HTML 4.01 is at 
<URL:http://www.w3.org/TR/html401/sgml/sgmldecl.html> the Strict DTD is 
at <URL:http://www.w3.org/TR/html401/sgml/dtd.html>.

XML is an SGML application profile, it's not an SGML application. It's a 
way of using SGML without some of its features. This means that SGML is 
more flexible, but XML is (a lot) simpler to work with.

In XML, you can use a DTD /or/ a Schema to define the structure and 
elements of your document. Both do exactly the same job, but Schemas do 
it better for several reasons, especially that they are themselves 
written in XML (so you can use all of your fun XML tools on them and 
that they're extensible just as XML is) and they support data types 
(making it simpler to do various jobs).

Hopefully that helps.

Cheers,

N.

-- 
Nick Boalch                          <URL:http://users.durge.org/~nick/>
Received on Friday, 10 January 2003 15:01:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:54 GMT