the tree nodes give alternatives that are valid for that location. The right column is also used to display content model information associated with elements.

The Outline view provides an overview of the XML document that can be useful when navigating large documents. And finally the Task view displays error messages that may be associated with the XML document.

Note the editor's page tabs at the bottom of the top right pane. These tabs are used to switch between the Design view and the Source view of the XML Editor. The views are synchronized so that a change made in one view will be automatically reflected in the other view.

Validating the XML file

Another useful feature of the XML editor is the incremental validation feature. At any point during your development of an XML document, you can invoke the validate process to validate the file. Just right-click on the file name in the Navigator view, and select Validate XML File option. In addition to the manual invocation of the validation process, the validation is also automatically run when you save the document, or when you finish typing in the Source view (as indicated by switching focus to a different view). Any validation errors will be reported in the Task view with a little red marker for the corresponding line in the Source view and the corresponding object in the Outline view.

5.2.2 DTD editor

This is a tool for creating and viewing DTDs. You can use it to edit the contents of new DTD files, either created from scratch or from existing XML Schemas. You can also use it to edit existing DTD files, and validate them.

Creating a DTD from scratch

In this section, we show how to create a new DTD file. To create a new DTD from scratch, use the New DTD wizard as follows:

￿Select File—>New—>Project—>Simple —>Project to bring up the New Project wizard to create a simple project.

￿Select File—>New—>DTDto launch the New DTD wizard.

￿In the File name field, type your DTD file name.

￿Click Finish. The DTD file is created and the DTD editor is automatically opened for you, as shown in Figure 5-3 on page 84.

Chapter 5. Application Developer XML Tools 83

Page 99
Image 99
IBM Version 5 manual DTD editor, Validating the XML file, Creating a DTD from scratch