Tip

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

    Requires Free Membership to View

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.