O'Reilly logo

XML: Visual QuickStart Guide, Second Edition by Kevin Howard Goldberg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Validation and Using DTDs

In the previous two chapters, you learned how to create DTDs. In this chapter, you’ll learn how to use them.

Specifically, a DTD defines rules for every element and attribute that can appear in an XML document. However, you must declare the DTD in your XML document in order to use it. Once this declaration is made, you can use various tools to validate the XML document against the DTD. This is the reason for creating a DTD in the first place, to insure that a given XML document is constructed in a specific way as defined by the DTD.

DTDs can be written and saved as separate files, or they can be written entirely inside an XML document. A benefit of writing internal DTDs is that there is only one file to manage ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required