blob: 14aaf36374ad1b441db6776d640b20250ac840a7 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<!-- /*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/ -->
<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" />
<title>Creating a new document type definition (DTD)</title>
</head>
<body id="tcretdtd"><a name="tcretdtd"><!-- --></a>
<h1 class="topictitle1">Creating DTDs</h1>
<div><p>A document type definition (DTD) contains a set of rules that can
be used to validate an XML file. After you have created a DTD, you can edit
it manually, adding declarations that define elements, attributes, entities, and notations,
and how they can be used for any XML files that reference the DTD file.</p><div class="skipspace"><p></p>
<p>The following instructions were written for the Resource perspective, but
they will also work in many other perspectives.</p>
<p>Follow
these steps to create a new DTD:</p>
</div>
<ol><li class="skipspace"><span>If necessary, create a project to contain the DTD.</span></li>
<li class="skipspace"><span>In the workbench, select <b><span class="menucascade"><span class="uicontrol">File</span> &gt; <span class="uicontrol">New</span> &gt; <span class="uicontrol">Other</span> &gt; <span class="uicontrol">XML</span> &gt; <span class="uicontrol"> DTD File</b></span></span> and click <b><span class="uicontrol">Next</span></b>. </span>
<li class="skipspace"><span>Select the project or folder that will contain the DTD.</span></li>
<li class="skipspace"><span>In the <b> <span class="uicontrol">File name</span></b> field, type the name of
the DTD, for example <kbd class="userinput">MyDTD.dtd</kbd>.</span> The
name of your DTD file must end with the extension <kbd class="userinput">.dtd.</kbd></li>
<li class="skipspace">Click <b>Next</b>. </li>
<li class="skipspace">You can use a DTD template as the basis for your new
DTD file. To do so, click the <b>Use DTD Template </b>check box, and select
the template you want to use.</li>
<li class="skipspace"><span>Click <span class="uicontrol"><b>Finish</b></span>.</span></li>
</ol>
<div class="skipspace"><p>The DTD appears in the Navigator view and automatically
opens in the DTD editor. In the DTD editor, you can manually add elements, attributes,
notations, entities, and comments to the DTD. If you close the file, and want
to later re-open it in the DTD editor, double-click it in the
Navigator view.</p>
</div>
</div>
<div>
<p>
<b class="parentlink">Parent topic:</b> <a href="../topics/cworkdtds.html" title="Working with DTDs">Working with DTDs</a><br />
</p>
</div>
<div><p><b class="relconceptshd">Related concepts</b><br />
<a href="../topics/cdtdover.html" title="A document type definition (DTD) provides you with the means to validate XML files against a set of rules. When you create a DTD file, you can specify rules that control the structure of any XML files that reference the DTD file.">Document type definitions (DTDs) - overview</a></p>
<p><strong>Related tasks</strong><br>
<a href="tdtemplt.html">Working with DTD templates</a><br>
<br />
</p>
</div>
</body>
</html>