3.1 Creating a New Document

Select File>New... or File>New Document... to create a new xml document.

Figure 3.1.1 File>New Document

To create a new document from the toolbar select the New icon in the Toolbar and select Document in the Select New window choice list. Click on the OK button.

Figure 3.1.2 Select New Window

A Catalogs window is opened. The Catalogs window has tabs for different DTD/XML Schema categories.

Figure 3.1.3 Catalogs Window

Select a DTD/Schema type tab to create a new document. For example, select J2EE 1.4 to create a J2EE xml document. Select a type of xml document from the Select an entry box, EJB 2.1 for example, and click on the OK button.

Figure 3.1.4 Select Entry Box in Catalogs Window

A window with title as the selected xml document type is opened. For example if J2EE 1.4>Ejb 2.1 is selected, a window with title Ejb 2.1 is opened. The General tab is selected by default. Specify document name in the Name field, the document directory in the Directory field and the document description in the Description field. Click the Next button.

Figure 3.1.5 Document Window with General Frame

The Spec tab is selected. For a standalone application select the Standalone checkbox. Specify the path for the schema corresponding to the xml document in the Schema Path or URI field. Specify the path for the DTD corresponding to the xml document in the DTD Path or URI field. Specify the DTD Public Id in the DTD PUBLIC ID field. Specify the XML document root element in the Root Element field. The Spec fields values are specified by the XML Editor when the corresponding values are specified in catalogs.xml. Click on the Next button.

Figure 3.1.6 Spec Frame in Document Window

Select the file extension type in the File Extension choice list. The file extension is .xml for an XML document, .xslt for an Xslt document, .xsd for a W3C Schema document and .tld for a J2EE custom tag library descriptor type of document.

Figure 3.1.7 File Extension Choice List

Select the document encoding from the Encoding choice list. Click the Next button.

Figure 3.1.8 Encoding Choice List

The Target Namespace tab gets selected. If applicable, specify the target namespace prefix in the Target NameSpace Prefix field and specify the target namespace uri in the Target Namespace URI field. You must specify both a prefix and a URI, if applicable, or leave both fields blank. If the Use Target Namespace from Schema checkbox is selected, the target namespace specified in the XML Schema for the XML document is used. Click the Finish button.

Figure 3.1.9 Target Namespace Frame in Document Window

An XML document of the selected configuration gets created. The new xml document gets added to the project panel.

Figure 3.1.10 Xml Document

In XMLEspresso 6.0 a DTD document may be added. Select the DTD tab in the Catalogs. Select XML document type declaration entry and click on OK.

Figure 3.1.11 Selecting a DTD Document

Specify document name and click on OK.

Figure 3.1.12 Specifying DTD Document

A DTD document gets added to the project.

Figure 3.1.13 New DTD Document

To add ELEMENT, ATTLIST and ENTITY constructs to the DTD document, select Ctrl+Space in the DTD document. A list of DTD constructs gets displayed.

Figure 3.1.14 Adding DTD Constructs

For example, add an ELEMENT.

Figure 3.1.15 Adding an ELEMENT.

The DTD Editor provides code assist. Select Ctrl+Space in the ELEMENT to add element name and sub-elements.

Figure 3.1.16 Adding ELEMENT Name

The Error Log displays the errors in the DTD document.

Figure 3.1.17 Constructing a DTD Document