You can create an XML file from a DTD file. You can then further customize that file in the XML editor. Generating an XML file from a DTD can be useful if you want to quickly create an XML file that is based on your DTD file.
The following instructions were written for the Resource perspective, but they will also work in many other perspectives.
To create an XML file from a DTD file follow these steps:
If you do not select any of these options, then only the minimum amount of content required for the XML file will be created.
The XML file appears in the Navigator view and, by default, automatically opens in the XML source page editor. The XML source page editor offers limited functionality compared to the XML editor, so before editing the file, you should close it, then right-click the file in the Navigator view and click Open With > XML Editor to open the file in the XML editor.
To make the XML editor the default editor for XML files, select Window > Preferences > Workbench > File Associations, then select *.xml and XML Editor from the Associated Editors list. Click OK.
The XML file will only contain the selected root element and any elements or attributes contained in the root element. You can now add elements, attributes, entities, and notations to the XML file, however, they must follow the rules established in the DTD that you used to create the XML file.
Related concepts
XML editor
Related tasks
Creating an XML file from scratch
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.