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

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 UTC