| <?xml version="1.0" encoding="UTF-8"?> |
| <!DOCTYPE html |
| PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html> |
| <head> |
| <link rel="stylesheet" type="text/css" href="../../com.ibm.help.doc/swg_info_common.css" /> |
| <title>Working with XML templates</title> |
| <script language="JavaScript"> |
| function popup_window( url, id, width, height ) |
| { |
| popup = window.open( url, id, 'toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=no,width=' + width + ',height=' + height + ',left=,top=' ); |
| popup.focus(); |
| } |
| </script><script language="JavaScript" src="help/liveHelp.js"></script></head> |
| <body id="twmacro"><a name="twmacro"><!-- --></a> |
| |
| <h1 class="topictitle1">Working with XML templates</h1> |
| <div><p>XML content assist provides a comment template, a chunk of predefined |
| code that you can insert into a file. You can use the default template as |
| provided, customize that template, or create your own templates.</p><div class="skipspace">For example, you may work on a group of XML pages that should all |
| contain a table with a specific appearance. Create a template that contains |
| the tags for that table, including the appropriate attributes and attribute |
| values for each tag. (You can copy and paste the tags from a structured text |
| editor into the template's Pattern field.) Then select the name of the template |
| from a content assist proposal list whenever you want to insert your custom |
| table into an XML file.<p>To create a new XML template follow these steps:</p> |
| </div> |
| <ol><li class="skipspace"><span>Click <span class="menucascade"><span class="uicontrol">Window</span> > <span class="uicontrol">Preferences</span> > <span class="uicontrol">Web and XML</span> > <span class="uicontrol">XML Files</span> > <span class="uicontrol">XML |
| Templates</span></span>.</span></li> |
| <li class="skipspace"><span>Click <span class="uicontrol">New</span> if you want to create a completely |
| new template.</span></li> |
| <li class="skipspace"><span>Supply a new template name and description</span></li> |
| <li class="skipspace"><span>Specify the <span class="uicontrol">Context</span> for the template.</span> This is the content in which the template is available in the proposal |
| list when content assist is requested. </li> |
| <li class="skipspace"><span>Specify the <span class="uicontrol">Pattern</span> for your template using |
| the appropriate tags, attributes, or attribute values to be inserted by contente |
| assit.</span></li> |
| <li class="skipspace"><span>If you want to insert a variable, click the <span class="uicontrol">Variable</span> button |
| and select the variable to be inserted. </span> For example, the word_selection |
| variable indicates the word that is selected at the beginning of template |
| insertion, and the cursor variable determines where the cursor will be after |
| the template is inserted in the HTML document</li> |
| <li class="skipspace"><span>Click <span class="uicontrol">Apply</span> and then <span class="uicontrol">OK</span> to |
| save your changes.</span></li> |
| </ol> |
| <div class="skipspace">You can edit, remove, import, or export a template by using the same |
| Preferences page. If you have modified a default template, you can restore |
| it to its default value. You can also restore a removed template if you have |
| not exited from the workbench since it was removed. <p>If you have a template |
| that you do not want to remove but you no longer want the template to appear |
| in the content assist list, go to the Templates preferences page and templates |
| its check box.</p> |
| </div> |
| </div> |
| |
| <div> |
| |
| </div><p> |
| (C) Copyright IBM Corporation 2000, 2005. All Rights Reserved. |
| </p> |
| </body> |
| </html> |