blob: dd1cebc7fafd2dd46f9ce27096983d258140ac2d [file] [log] [blame]
kpriceef160682006-08-29 18:08:31 +00001<?xml version="1.0" encoding="utf-8"?>
kpriceb59c9f62008-04-02 21:24:37 +00002<!--Arbortext, Inc., 1988-2006, v.4002-->
3<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
4 "task.dtd">
5<?Pub Inc?>
kpriceef160682006-08-29 18:08:31 +00006<task id="twmacro" xml:lang="en-us">
7<title>Working with XML templates</title>
8<titlealts>
9<searchtitle>Working with XML templates</searchtitle>
10</titlealts>
kpriceb59c9f62008-04-02 21:24:37 +000011<shortdesc>XML content assist provides a comment template, a section of predefined
kpriceef160682006-08-29 18:08:31 +000012code that you can insert into a file. You may find a template useful when
13you have a certain piece of code you want to reuse several times, and you
14do not want to write it out every time.</shortdesc>
15<prolog><metadata>
kprice9623e9d2007-05-03 03:43:05 +000016<keywords><indexterm>XML templates<indexterm>working with predefined code</indexterm></indexterm>
17</keywords>
kpriceef160682006-08-29 18:08:31 +000018</metadata></prolog>
19<taskbody>
20<context><p>You can use a default template as provided, customize that template,
kpriceb59c9f62008-04-02 21:24:37 +000021or create your own templates.</p><p>For example, you can work on a group of
22XML pages that should all contain a table with a specific appearance. Create
23a template that contains the tags for that table, including the appropriate
kpriceef160682006-08-29 18:08:31 +000024attributes and attribute values for each tag. (You can copy and paste the
25tags from a structured text editor into the template's <uicontrol>Pattern</uicontrol> field.)
26Then select the name of the template from a content assist proposal list whenever
kpriceb59c9f62008-04-02 21:24:37 +000027you want to insert your custom table into an XML file.</p><p>To create a new
28XML template, complete the following steps:</p></context>
kpriceef160682006-08-29 18:08:31 +000029<steps>
30<step><cmd>Click <menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>
kpriceb59c9f62008-04-02 21:24:37 +000031</menucascade> and select <menucascade><uicontrol>XML</uicontrol><uicontrol>XML
32Files</uicontrol><uicontrol>Templates</uicontrol></menucascade>.</cmd></step>
kpriceef160682006-08-29 18:08:31 +000033<step><cmd>Click <uicontrol>New</uicontrol> if you want to create a completely
34new template.</cmd></step>
35<step><cmd>Supply a new template <uicontrol>Name</uicontrol> and <uicontrol>Description</uicontrol>.</cmd>
36</step>
37<step><cmd>Specify the <uicontrol>Context</uicontrol> for the template.</cmd>
38<info>This is the context in which the template is available in the proposal
39list when content assist is requested. </info></step>
40<step><cmd>Specify the <uicontrol>Pattern</uicontrol> for your template using
41the appropriate tags, attributes, or attribute values to be inserted by content
42assist.</cmd></step>
43<step><cmd>If you want to insert a variable, click the <uicontrol>Insert Variable</uicontrol> button
44and select the variable to be inserted. </cmd><info>For example, the <b>date</b> variable
45indicates the current date will be inserted. </info></step>
kpriceb59c9f62008-04-02 21:24:37 +000046<step><cmd>Click <uicontrol>OK</uicontrol> and then <uicontrol>Apply<?Pub Caret?></uicontrol> to
kpriceef160682006-08-29 18:08:31 +000047save your changes.</cmd></step>
48</steps>
49<postreq>You can edit, remove, import, or export a template by using the same
50preferences page. If you have modified a default template, you can restore
51it to its default value. You can also restore a removed template if you have
52not exited from the workbench since it was removed. <p>If you have a template
53that you do not want to remove but you no longer want it to appear in the
kpriceb59c9f62008-04-02 21:24:37 +000054content assist list, clear its check box in the table on the Templates preferences
55page.</p></postreq>
kpriceef160682006-08-29 18:08:31 +000056</taskbody>
57</task>
kpriceb59c9f62008-04-02 21:24:37 +000058<?Pub *0000003238?>