The Use Template property

The names of all templates that you create and save for the current DataWindow object display in the ExportXMLUseTemplate drop-down list.

The template you select from the list is used to conform the XML to the specifications defined in the named template. Selecting a template from the list box sets the DataWindow object’s Export.XML.UseTemplate property. You can also modify the value of the UseTemplate property dynamically in code. For example, an XML publishing engine would change templates dynamically to create different presentations of the same data.

When you open a DataWindow, the Export/Import Template view displays the template specified in the DataWindow’s Use Template property. (If the view is not visible in the current layout, select View>DataWindow Painter Layout>Export/Import Template>XML from the menu bar.) If the property has not been set, the first saved template displays or, if there are no saved templates, the default structured template displays as a basis for editing.

Template used when saving

When the DataWindow is saved as XML, DataWindow Designer uses the template specified in the UseTemplate property. If the property has not been set, DataWindow Designer uses the default template.

When you are working on a template, you might want to see the result of your changes. The template specified in the UseTemplate property might not be the template currently displayed in the Export/Import Template view, so you should check the value of the UseTemplate property to be sure you get the results you expect.

StepsTo save to XML using the current template:

  1. Right-click in the Export/Import template view and select Save or Save As from the pop-up menu to save the current template.

  2. In the Data Export category in the properties window, select the current template from the ExportXMLUseTemplate drop-down list.

  3. Select File>Save Rows As, select XML from the Files of Type drop-down list, enter a file name, and click Save.