kprice | 159fa58 | 2006-05-08 21:30:45 +0000 | [diff] [blame] | 1 | <?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
|
| 9 | code that you can insert into a file. You can use the default template as
|
| 10 | provided, 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
|
| 19 | all contain a table with a specific appearance. Create a template that contains
|
| 20 | the tags for that table, including the appropriate attributes and attribute
|
| 21 | values for each tag. (You can copy and paste the tags from a structured text
|
| 22 | editor into the template's <uicontrol>Pattern</uicontrol> field.) Then select
|
| 23 | the name of the template from a content assist proposal list whenever you
|
| 24 | want to insert your custom table into an XML file.</p><p>To add a new XML
|
| 25 | template, 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
|
| 30 | XML</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
|
| 34 | of the template.</cmd></step>
|
| 35 | <step><cmd>Using the <uicontrol>Context</uicontrol> drop-down list, specify
|
| 36 | the context in which the template is available in the proposal list when content
|
| 37 | assist is requested.</cmd></step>
|
| 38 | <step><cmd>In the <uicontrol>Pattern</uicontrol> field, enter the appropriate
|
| 39 | tags, attributes, or attribute values (the content of the template) to be
|
| 40 | inserted by content assist.</cmd></step>
|
| 41 | <step><cmd>If you want to insert a variable, click the <uicontrol>Variable</uicontrol> button
|
| 42 | and select the variable to be inserted.</cmd><stepxmp>For example, the <varname>word_selection</varname> variable
|
| 43 | indicates the word that is selected at the beginning of template insertion,
|
| 44 | and the <varname>cursor</varname> variable determines where the cursor will
|
| 45 | be 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
|
| 50 | same 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><p>If you have a template
|
| 53 | that you do not want to remove but you no longer want the template to appear
|
| 54 | in the content assist list, go to the Templates preferences page and uncheck
|
| 55 | its check box.</p></postreq>
|
| 56 | </taskbody>
|
| 57 | <related-links>
|
| 58 | <linkpool type="concept">
|
| 59 | <link href="csrcedt004.dita"><linktext>Structured text editors for markup
|
| 60 | languages</linktext></link>
|
| 61 | </linkpool>
|
| 62 | <linkpool type="task">
|
| 63 | <link href="tsrcedt027.dita"><linktext>Adding and removing markup language
|
| 64 | templates - 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>
|