blob: 333a75447e814d677b1125b00ca2274b1a701d8d [file] [log] [blame]
kprice9c922d82006-08-30 22:07:19 +00001<?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">
2<html lang="en-us" xml:lang="en-us">
lmandel27ad0132005-12-07 07:16:48 +00003<head>
kprice9c922d82006-08-30 22:07:19 +00004<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
5<meta name="copyright" content="Copyright (c) 2000, 2006 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" />
6<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
7<meta content="public" name="security" />
8<meta content="index,follow" name="Robots" />
9<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
10<meta content="task" name="DC.Type" />
11<meta name="DC.Title" content="Working with DTD templates" />
12<meta name="abstract" content="Templates are a chunk of predefined code that you can insert into a DTD file when it is created. You may find a template useful when you have a certain piece of code you want to reuse several times, and you do not want to write it out every time." />
13<meta name="description" content="Templates are a chunk of predefined code that you can insert into a DTD file when it is created. You may find a template useful when you have a certain piece of code you want to reuse several times, and you do not want to write it out every time." />
14<meta content="DTD templates, creating, templates, DTDs" name="DC.subject" />
15<meta content="DTD templates, creating, templates, DTDs" name="keywords" />
16<meta scheme="URI" name="DC.Relation" content="../topics/tcretdtd.html" />
17<meta content="XHTML" name="DC.Format" />
18<meta content="twmacro" name="DC.Identifier" />
19<meta content="en-us" name="DC.Language" />
20<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
21<title>Working with DTD templates</title>
lmandel27ad0132005-12-07 07:16:48 +000022</head>
23<body id="twmacro"><a name="twmacro"><!-- --></a>
24
kprice9c922d82006-08-30 22:07:19 +000025
lmandel27ad0132005-12-07 07:16:48 +000026<h1 class="topictitle1">Working with DTD templates</h1>
kprice9c922d82006-08-30 22:07:19 +000027
28
29
30
31<div><p>Templates are a chunk of predefined code that you can insert into
32a DTD file when it is created. You may find a template useful when you have
33a certain piece of code you want to reuse several times, and you do not want
34to write it out every time.</p>
35
36<div class="section"><p>To create a new DTD template follow these steps:</p>
lmandel27ad0132005-12-07 07:16:48 +000037</div>
kprice9c922d82006-08-30 22:07:19 +000038
39<ol>
40<li class="stepexpand"><span>Click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span>
41 &gt; <span class="uicontrol">Web and XML</span> &gt; <span class="uicontrol">DTD Files</span> &gt; <span class="uicontrol">DTD
42Templates</span></span>.</span></li>
43
44<li class="stepexpand"><span>Click <span class="uicontrol">New</span> if you want to create a completely
lmandel27ad0132005-12-07 07:16:48 +000045new template.</span></li>
kprice9c922d82006-08-30 22:07:19 +000046
47<li class="stepexpand"><span>Supply a new template <span class="uicontrol">Name</span> and <span class="uicontrol">Description</span>.</span>
48</li>
49
50<li class="stepexpand"><span>Specify the <span class="uicontrol">Context</span> for the template.</span>
51 This is the context in which the template is available in the proposal
lmandel27ad0132005-12-07 07:16:48 +000052list when content assist is requested. </li>
kprice9c922d82006-08-30 22:07:19 +000053
54<li class="stepexpand"><span>Specify the <span class="uicontrol">Pattern</span> for your template using
lmandel27ad0132005-12-07 07:16:48 +000055the appropriate tags, attributes, or attribute values to be inserted by content
56assist.</span></li>
kprice9c922d82006-08-30 22:07:19 +000057
58<li class="stepexpand"><span>If you want to insert a variable, click the <span class="uicontrol">Insert Variable</span> button
59and select the variable to be inserted. </span> For example, the <strong>date</strong> variable
60indicates the current date will be inserted. </li>
61
62<li class="stepexpand"><span>Click <span class="uicontrol">Apply</span> and then <span class="uicontrol">OK</span> to
lmandel27ad0132005-12-07 07:16:48 +000063save your changes.</span></li>
kprice9c922d82006-08-30 22:07:19 +000064
lmandel27ad0132005-12-07 07:16:48 +000065</ol>
kprice9c922d82006-08-30 22:07:19 +000066
67<div class="section">You can edit, remove, import, or export a template by using the same
68preferences page. <p>If you have a template that you do not want to remove,
69but you no longer want the template to appear in the DTD templates list when
70you create a file, go to the<strong> DTD Templates</strong> preferences page and clear
lmandel27ad0132005-12-07 07:16:48 +000071its check box.</p>
72</div>
kprice9c922d82006-08-30 22:07:19 +000073
lmandel27ad0132005-12-07 07:16:48 +000074</div>
kprice9c922d82006-08-30 22:07:19 +000075
76<div>
77<div class="familylinks">
78<div class="parentlink"><strong>Parent topic:</strong> <a href="../topics/tcretdtd.html" title="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.">Creating DTDs</a></div>
79</div>
80</div>
81
82</body>
lmandel27ad0132005-12-07 07:16:48 +000083</html>