Creating a DTD File

A Document Type Definition (DTD) describes the grammar that can be used in an XML file and indicates the valid arrangement of the file's tags. It can exist as a prologue to an XML file (internal DTD), or as a separate file that the XML file references (external DTD).

You can create a new DTD file from scratch, or you can automatically generate a DTD file from an existing XML document.

To generate a DTD file from an existing XML file:

  1. In the Explorer, right-click an XML file's node and choose Generate DTD. Make sure that you have previously checked the XML file to ensure that it is well-formed.
  2. Type a name for the new DTD file, and click OK.

    The new DTD node appears in the Explorer and is opened as a text file in the Source Editor.

To create an empty DTD file:

  1. Choose File and choose New in the main window.
  2. Expand the XML & DTD node and select DTD Entity. Click Next to proceed.
  3. Enter a name and package for the DTD file.
  4. Click Finish to create the new file.

    In the Explorer, the DTD file's node appears under the package you chose. The DTD file also opens in the Source Editor.

See also
The XML Module
Creating an XML Document
Editing an XML Document
Text Editor
Tree Editor

Legal Notices