| <?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> |
| <!-- /******************************************************************************* |
| * Copyright (c) 2000, 2005 IBM Corporation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ --> |
| <link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" /> |
| <title>Working with XML templates</title> |
| </head> |
| <body id="twmacro"><a name="twmacro"><!-- --></a> |
| |
| <h1 class="topictitle1">Working with DTD templates</h1> |
| <div><p>Templates are a chunk of predefined code that you can insert into a DTD |
| file when it is created. You may find a template useful when |
| you have a certain piece of code you want to reuse several times, and you do |
| not want to write it out every time.</p> |
| <div class="skipspace"><p>To create a new DTD template follow these steps:</p> |
| </div> |
| <ol><li class="skipspace"><span>Click <b> <span class="menucascade"><span class="uicontrol">Window</span> > <span class="uicontrol">Preferences</span> > <span class="uicontrol">Web and XML</span> > </span> |
| <span class="uicontrol">DTD</span><span class="menucascade"><span class="uicontrol"> Files</span> > </span> |
| <span class="uicontrol">DTD</span><span class="menucascade"><span class="uicontrol"> |
| Templates</span></span></b>.</span></li> |
| <li class="skipspace"><span>Click <b> <span class="uicontrol">New</span></b> if you want to create a completely |
| new template.</span></li> |
| <li class="skipspace"><span>Supply a new template <b>Name</b> and <b>Description</b>.</span></li> |
| <li class="skipspace"><span>Specify the <b> <span class="uicontrol">Context</span></b> for the template.</span> This is the context in which the template is available in the proposal |
| list when content assist is requested. </li> |
| <li class="skipspace"><span>Specify the <b> <span class="uicontrol">Pattern</span></b> for your template using |
| the appropriate tags, attributes, or attribute values to be inserted by content |
| assist.</span></li> |
| <li class="skipspace"><span>If you want to insert a variable in your <b>Pattern</b>, click the |
| <b> <span class="uicontrol">Insert Variable</span></b> button |
| and select the variable to be inserted. </span> For example, the<b> date </b>variable indicates |
| the current date will be inserted. </li> |
| <li class="skipspace"><span>Click <b> <span class="uicontrol">Apply</span></b> and then |
| <b> <span class="uicontrol">OK</span></b> 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. <p>If you have a template |
| that you do not want to remove, but you no longer want the template to appear |
| in the DTD templates list when you create a file, go to the <b>DTD Templates </b>preferences page and |
| clear |
| its check box.</p> |
| </div> |
| <div><div class="reltasks"><strong>Related tasks</strong><br> |
| <a href="tcretdtd.html">Creating a DTD file</a><br /> |
| </div> |
| </div></body> |
| </html> |