The Use Template property
The names of all templates that you create and save for the
current DataWindow object display in the Use Template drop-down
list.
The template you select from the list is used to conform the
XMLgenerated by any of the methods for saving as 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 a script. 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>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, PowerBuilder uses the
template specified in the Use Template property. If the property has
not been set, PowerBuilder 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 Use Template
property might not be the template currently displayed in the
Export/Import Template view, so you should check the value of the
Use Template property to be sure you get the results you
expect.
To save to XML using the current template
-
Right-click in the Export/Import template view and select
Save or Save As from the pop-up menu to save the current
template. -
On the Data Export page in the properties view, select the
current template from the Use Template drop-down list. -
Select File>Save Rows As, select XML from the Files of
Type drop-down list, enter a file name, and click Save.