From the course: XML Essential Training

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

What is a DTD?

What is a DTD? - XML Tutorial

From the course: XML Essential Training

Start my 1-month free trial

What is a DTD?

- [Instructor] There are a couple of different ways to associate sets of rules with your XML documents to help ensure their quality, and make sure that they are as error-free as possible. One of those ways is through what are called document type definitions, and that's what we're going to look at in this chapter. Document type definitions provide a way to constrain the content of XML documents so that you can specify what kinds of tags and attributes and other types of content are and are not allowed. You can specify what kind of content can appear, where it can appear, and what kinds of content tags themselves can have. DTDs can be included directly in an XML file or be declared as an external DTD and then associated with more than one XML document. DTDs are pretty simple to write, but the trade off is that they're not that powerful. There are some basic rules you can lay down, but XML schema, which we'll look at in the next chapter, is actually a lot more powerful. So why would you…

Contents