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 . InCopy reviews the XML in your InCopy document and makes sure it conforms to the associated DTD.

After going through the validation process, a small pane called the Suggestions pane opens in the lower portion of the Structure pane, revealing the results of the validation (Figure 7.15). If your XML follows the rules of the DTD, validation will give you a clean bill of health and read "No known errors."

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


If there are errors, InCopy lists them (up to 250 of them) and describes, as best it can, what each error is while offering a suggestion for how to fix it. Using the suggestions provided, either click on the suggested fix (our personal favorite solution) or head to the Structure pane and edit the structure and tags directly. Once you believe you've fixed everything, it's a good idea to validate your XML again.

Tip

You do have the option of validating only part of your InCopy document. Select an element in the Structure pane and in the flyout menu choose Validate from Selected Element. This saves you time if you are only concerned about the validation of a particular section.





The AdobeR InCopyR CS2 Book
The Adobe InCopy CS2 Book
ISBN: 0321337050
EAN: 2147483647
Year: 2006
Pages: 122

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net