The Export/Import Template view for XML

You define and edit templates for export and import in the Export/Import Template view for XML in the DataWindow painter. The view uses a tree view to represent the template.

When you create a new DataWindow object, PowerBuilder displays a default template in the Export/Import Template view. You can edit only one template at a time in the view, but you can create multiple templates and save them with the DataWindow object. Each template is uniquely associated with the DataWindow object open in the painter.

The default template has one element for each column in the DataWindow object.

The sample shows a default template for a Data Window in the Export slash Import Template view. The template is represented as a tree. At the top level is the Data Window object d _ sales _ rep _ customer _ orders, shown with the tag icon that identifies a root or child element. Indented under this is d _ sales _ rep _ customer _ orders _ row shown also with the tag icon. Indented under this, and shown with tag icons, are id, order _ date, fin _ code _ id, and region. Under each of them, with the icon for a Data Window column reference, are id, order _ date, fin _ code _id, and region.

Creating, opening, and saving templates

From the pop-up menu for the Export/Import Template view (with nothing selected), you can create new templates with or without default contents, open an existing template, save the current template, or delete the current template. You can only open and edit templates that are associated with the current DataWindow object.

The example shows the pop up menu for the Export slash  Import Template view with the menu items New, New Default, Open, Save, Save As dot dot dot, and Delete.

Representing tree view items

Each item in the template displays as a single tree view item with an image and font color that denotes its type. The end tags of elements and the markup delimiters used in an XML document do not display.

Table 29-1 shows the icons used in the Export/Import Template view.

Table 29-1: Icons used in the Export/Import Template view

Icon

Description

the icon displays the letters X M L

XML declaration or document type declaration

the icon displays a tag labeled tag with a lightly shaded background

Root or child element

the icon displays a tag labeled tag with a darkly shaded background

Group header element

the icon displays dashes in a pattern of three columns and six rows

DataWindow column reference

the icon displays a capital letter A

Static text control reference

the icon displays a plus sign and an equals sign with a forward slash between them

Computed field or DataWindow expression reference

the icon displays a capital A and a lowercase a in italics

Literal text

the icon displays a cartoon style text bubble

Comment

the icon displays the letter pi

Processing instruction

the icon displays an italic capital A enclosed in square brackets

CDATA section

the icon displays a larg rectangle with a smaller rectangle superimposed on it that points to it with an arrow

Nested report