What's a DTD, Anyway?

Today, you have two ways to reference XML document definitions to define the markup that such documents contain: (1) by using a Document Type Definition, or DTD, and (2) by referencing some kind of XML namespace. In the future, a third method called an XML schema, or more simply, schema, will also permit you to describe the elements, attributes, and other markup that makes up an XML document. Here, I attempt to explain why there are three possible methods for this task, discuss the pros and cons of each method, and provide pointers for more information on each topic.

To begin with, let's talk about the DTD. A DTD is an import from the world of the Standard Generalized Markup Language, or SGML. In other words, you have to know something about SGML to create a DTD that you then use to describe an XML document. Sound confusing? It can be, but DTDs currently represent the best-understood and most powerful method for defining XML document markup, contents, and structure.

My favorite DTD references include: - Charles F. Goldfarb's immortal classic: The SGML Handbook (Oxford University Press, Oxford, UK, 1991. List Price: $95.00. ISBN: 0- 19-853737-9) combines the SGML specification with cogent commentary and exegesis that includes useful coverage of DTD concepts, design techniques, syntax, and semantics.

- Eve Maler and Jean El Andaloussi wrote Developing SGML DTDs from Text to Model to Markup (Prentice Hall, Upper Saddle River, NJ, 1996. List Price: $65.00. ISBN: 0-13-309881-8). Although this book is out of stock at the publisher's, it remains the single best title on the subject I know of, despite its failure to address XML issues (of course, it predates XML, so it's not the authors' fault, by any means).

- Charlie Morris's online tutorial "How to Create a Vocabulary" (http://www.wdvl.com/Authoring/Languages/XML/Tutorials/Building_Languages/create_vocab.html)does a wonderful job of bringing the concept of DTDs home for XML developers.

Ed Tittel is a principal at LANWrights, Inc.: a wholly owned subsidiary of LeapIt.com. LANwrights offers training, writing and consulting services on Internet, networking, and Web topics, plus various IT certifications (Microsoft, Sun/Java, Prosoft/CIW).
This was first published in November 2000

Dig deeper on XML and XML schema

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close