blob: 47a267ac8bb7249cf6a506b34947cc9cccf7b4d7 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--Arbortext, Inc., 1988-2006, v.4002-->
<task id="twmacro" xml:lang="en-us">
<title>Working with DTD templates</title>
<searchtitle>Working with DTD templates</searchtitle>
<shortdesc>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.</shortdesc>
<keywords><indexterm>DTDs<indexterm>creating templates</indexterm></indexterm>
<context><p>To create a new DTD template, complete the following steps:</p></context>
<step><cmd>Click <menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>
<uicontrol>Web and XML</uicontrol><uicontrol>DTD Files</uicontrol><uicontrol>Templates</uicontrol>
<step><cmd>Click <uicontrol>New</uicontrol> in the templates prefereces.</cmd>
<step><cmd>Supply a new template <uicontrol>Name</uicontrol> and <uicontrol>Description</uicontrol>.</cmd>
<step><cmd>Specify the <uicontrol>Context</uicontrol> for the template.</cmd>
<info>This is the context in which the template is available in the proposal
list when content assist is requested. </info></step>
<step><cmd>Specify the <uicontrol>Pattern</uicontrol> for your template using
the appropriate tags, attributes, or attribute values to be inserted by content
<step importance="optional"><cmd>To insert a variable, click the <uicontrol>Insert
Variable</uicontrol> button and select a variable. </cmd><info>For example,
the <uicontrol>date</uicontrol> variable indicates the current date will be
inserted. </info></step>
<step><cmd>Click <uicontrol>Apply</uicontrol> and then <uicontrol>OK</uicontrol> to
save your changes.</cmd></step>
<postreq>You can edit, remove, import, or export a template by using the same
preferences page. <p>If you have a template that you do not want to remove,
but you no longer want the template to appear in the DTD templates list when
you create a file, clear its checkbox in the templates table.</p></postreq>