You can edit DTD files in both the Outline view and the Source view. Modifying the content of a DTD determines what can be used in any XML file that is associated with it.
You can edit DTDs in the following ways:
Editing in the Outline view
The Outline view will show you all the items in your DTD as you add them. In this view, you can both create and delete DTD nodes.
The following instructions were written for the Resource perspective, but they will also work in many other perspectives. To edit a DTD in the Outline view, follow these steps:
The DTD editor has a built-in mechanism to handle referential integrity issues. When you delete or edit certain components, clean up will automatically occur. Refer to the related reference section for more information.
Editing in the Source view
You can edit the source code for your DTD in the Source view manually.
The following instructions were written for the Resource perspective, but they will also work in many other perspectives. To edit a DTD in the Source view, follow these steps:
Sorting nodes in the Outline view
By default, DTD nodes appear in the Outline view in the order you added them to the DTD.
If
you want to sort the DTD nodes alphabetically, click the Sort
items alphabetically button .
You
can also group the DTD nodes into logical groups - notations, entities, elements,
and other. Click the Group items logically button to sort the DTD nodes into logical
groups.
The following links contain information on how you can edit DTD files:
Creating elements
You can use element declarations in DTDs to define the elements that may occur in an XML document. Element declarations can specify that an element can contain other elements, that it can contain anything at all, or that it must be empty.Creating entities
An entity is a shortcut used to represent complex strings or symbols that would otherwise be impossible, difficult or repetitive to include by hand.Creating notations
Notations are means of associating a binary description with an entity or attribute. The most common uses of notations are to include familiar types of binary references, such as GIFs and JPGs, in an XML file.Creating a comment
Comments can be used to provide information about a document, such as the author's name, or the date it was last modified. Comments are visible to anyone reading the DTD, but are ignored by the XML parser.Deleting elements, attributes, entities, notations, and comments
If you have created elements, attributes, entities, notations, and comments you no longer need, you can delete any of them.
Related concepts
DTD editor
Document type definitions (DTDs) - overview
Related tasks
Creating DTDs
Importing DTDs
Related reference
Referential integrity in the DTD editor
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.