Working with and Validating DTDs from InDesign
As we mentioned, a DTD, or Document Type Definition, is the file that defines the rules for a particular XML file. Just as we have certain agreed-upon rules for interacting with one another in society (don't lie, don't kill, don't spy on people, don't chew with your mouth open), you probably have agreed-upon rules for organizing your InCopy file and the rest of your publishing workflow. You already know some of the rules for the structure of your document; the DTD simply puts this in writing. For instance, you know that a headline is followed by the sub-head, which is followed, in turn, by the body. Conversely, you'd never start with the body, followed by the sub-head, followed by the headline. And, much the same as in society, if you're working by yourself, you can follow your own rules, but if you're publishing with others, a DTD requires that everyone follow the same set of consistent rules for organizing your documents. DTDs can be referenced from outside your XML file (external) or can be inside your XML file (internal). If you will be applying the same structure to multiple XML files, an external DTD makes more sense because changing the one external file updates all the XML files referencing it. To learn more about DTDs check out Real World XML by Steve Holzner, published by Peachpit Press.
Importing a DTD via InDesign
Where do DTDs come from? Although you can't import a DTD directly into InCopy, you can do so in InDesign. If you then edit a story from InDesign in InCopy, the DTD from InDesign is made available to you in InCopy. To view the DTD, choose View DTD from the Structure pane flyout menu. If you know how to read a DTD, this can be a useful lesson in your document's XML rules.
Validating against a DTD
The primary point of using a DTD is to make certain that your document is following its rules. The way to do this in InCopy is to validate the XML in your document against the DTD provided by InDesign when the story was exported. From the Structure pane in InCopy, click the Validate button

Figure 7.15. Validate your stories to verify adherence to your publication's content structuring standards.
