kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="utf-8"?>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 2 | <!--Arbortext, Inc., 1988-2006, v.4002-->
|
| 3 | <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
|
| 4 | "task.dtd">
|
| 5 | <?Pub Inc?>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 6 | <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>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 11 | <shortdesc>XML content assist provides a comment template, a section of predefined
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 12 | code that you can insert into a file. You may find a template useful when
|
| 13 | you have a certain piece of code you want to reuse several times, and you
|
| 14 | do not want to write it out every time.</shortdesc>
|
| 15 | <prolog><metadata>
|
kprice | 9623e9d | 2007-05-03 03:43:05 +0000 | [diff] [blame] | 16 | <keywords><indexterm>XML templates<indexterm>working with predefined code</indexterm></indexterm>
|
| 17 | </keywords>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 18 | </metadata></prolog>
|
| 19 | <taskbody>
|
| 20 | <context><p>You can use a default template as provided, customize that template,
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 21 | or create your own templates.</p><p>For example, you can work on a group of
|
| 22 | XML pages that should all contain a table with a specific appearance. Create
|
| 23 | a template that contains the tags for that table, including the appropriate
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 24 | attributes and attribute values for each tag. (You can copy and paste the
|
| 25 | tags from a structured text editor into the template's <uicontrol>Pattern</uicontrol> field.)
|
| 26 | Then select the name of the template from a content assist proposal list whenever
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 27 | you want to insert your custom table into an XML file.</p><p>To create a new
|
| 28 | XML template, complete the following steps:</p></context>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 29 | <steps>
|
| 30 | <step><cmd>Click <menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 31 | </menucascade> and select <menucascade><uicontrol>XML</uicontrol><uicontrol>XML
|
| 32 | Files</uicontrol><uicontrol>Templates</uicontrol></menucascade>.</cmd></step>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 33 | <step><cmd>Click <uicontrol>New</uicontrol> if you want to create a completely
|
| 34 | new 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
|
| 39 | list when content assist is requested. </info></step>
|
| 40 | <step><cmd>Specify the <uicontrol>Pattern</uicontrol> for your template using
|
| 41 | the appropriate tags, attributes, or attribute values to be inserted by content
|
| 42 | assist.</cmd></step>
|
| 43 | <step><cmd>If you want to insert a variable, click the <uicontrol>Insert Variable</uicontrol> button
|
| 44 | and select the variable to be inserted. </cmd><info>For example, the <b>date</b> variable
|
| 45 | indicates the current date will be inserted. </info></step>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 46 | <step><cmd>Click <uicontrol>OK</uicontrol> and then <uicontrol>Apply<?Pub Caret?></uicontrol> to
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 47 | save your changes.</cmd></step>
|
| 48 | </steps>
|
| 49 | <postreq>You can edit, remove, import, or export a template by using the same
|
| 50 | preferences page. If you have modified a default template, you can restore
|
| 51 | it to its default value. You can also restore a removed template if you have
|
| 52 | not exited from the workbench since it was removed. <p>If you have a template
|
| 53 | that you do not want to remove but you no longer want it to appear in the
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 54 | content assist list, clear its check box in the table on the Templates preferences
|
| 55 | page.</p></postreq>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 56 | </taskbody>
|
| 57 | </task>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 58 | <?Pub *0000003238?>
|