blob: da51749ade8af7187da1d5eaad071297f360a07a [file] [log] [blame]
kprice159fa582006-05-08 21:30:45 +00001<?xml version="1.0" encoding="utf-8"?>
2<!--Arbortext, Inc., 1988-2006, v.4002-->
3<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
4 "..\dtd\task.dtd">
5<!-- $Id: tsrcedt029.dita,v 1.4 2006/04/13 20:37:13 bkorn Exp $ -->
6<task id="tsrcedt027" xml:lang="en-us">
7<title>Adding and removing XML templates</title>
8<shortdesc>XML content assist provides a comment template, a chunk of predefined
9code that you can insert into a file. You can use the default template as
10provided, customize that template, or create your own templates.</shortdesc>
11<prolog><metadata>
12<keywords><indexterm>xml templates<indexterm>adding</indexterm><indexterm>removing</indexterm></indexterm><indexterm>templates<indexterm>XML</indexterm></indexterm>
13
14
15</keywords>
16</metadata></prolog>
17<taskbody>
18<context> <p>For example, you may work on a group of XML pages that should
19all contain a table with a specific appearance. Create a template that contains
20the tags for that table, including the appropriate attributes and attribute
21values for each tag. (You can copy and paste the tags from a structured text
22editor into the template's <uicontrol>Pattern</uicontrol> field.) Then select
23the name of the template from a content assist proposal list whenever you
24want to insert your custom table into an XML file.</p><p>To add a new XML
25template, complete the following steps: </p> </context>
26<steps>
27<step><cmd>From the <uicontrol>Window</uicontrol> menu, select <uicontrol>Preferences</uicontrol>.</cmd>
28</step>
29<step><cmd>In the Preferences page, select <menucascade><uicontrol>Web and
30XML</uicontrol><uicontrol>XML Files</uicontrol><uicontrol>XML Templates</uicontrol>
31</menucascade>.</cmd></step>
32<step><cmd>Click <uicontrol>New</uicontrol>. </cmd></step>
33<step><cmd>Enter the new template name (a text string) and a brief description
34of the template.</cmd></step>
35<step><cmd>Using the <uicontrol>Context</uicontrol> drop-down list, specify
36the context in which the template is available in the proposal list when content
37assist is requested.</cmd></step>
38<step><cmd>In the <uicontrol>Pattern</uicontrol> field, enter the appropriate
39tags, attributes, or attribute values (the content of the template) to be
40inserted by content assist.</cmd></step>
41<step><cmd>If you want to insert a variable, click the <uicontrol>Variable</uicontrol> button
42and select the variable to be inserted.</cmd><stepxmp>For example, the <varname>word_selection</varname> variable
43indicates the word that is selected at the beginning of template insertion,
44and the <varname>cursor</varname> variable determines where the cursor will
45be after the template is inserted in the XML document.</stepxmp></step>
46<step><cmd>Click <uicontrol>OK</uicontrol> to save the new template.</cmd>
47</step>
48</steps>
49<postreq><p>You can edit, remove, import, or export a template by using the
50same Preferences 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><p>If you have a template
53that you do not want to remove but you no longer want the template to appear
54in the content assist list, go to the Templates preferences page and uncheck
55its check box.</p></postreq>
56</taskbody>
57<related-links>
58<linkpool type="concept">
59<link href="csrcedt004.dita"><linktext>Structured text editors for markup
60languages</linktext></link>
61</linkpool>
62<linkpool type="task">
63<link href="tsrcedt027.dita"><linktext>Adding and removing markup language
64templates - overview</linktext></link>
65<link href="tsrcedt024.dita"><linktext>Adding and removing HTML templates</linktext>
66</link>
67<link href="tsrcedt028.dita"><linktext>Adding and removing JSP templates</linktext>
68</link>
69<link href="tsrcedt000.dita"><linktext>Editing text coded in markup languages
70- overview</linktext></link>
71</linkpool>
72</related-links>
73</task>