An XML template has a Header section and a Detail section, separated graphically by a line across the tree view.
The items in the Header section are generated only once when the DataWindow is exported to XML, unless the DataWindow is a group DataWindow. For group DataWindow objects, you can choose to generate the contents of the header section iteratively for each group. For more information, see Generating group headers.
The Detail section contains the row data, and is generated iteratively for each row in the DataWindow object.
A line across the Export/Import Template view separates the Header section from the Detail section. The first element after this line, d_dept_list_row in the previous screenshot, is called the Detail Start element.
There can be only one Detail Start element, and it must be inside the document's root element. By default, the first child of the root element is the Detail Start element. It usually wraps a whole row, separating columns across rows. When the DataWindow is exported to XML, this element and all children and/or siblings after it are generated iteratively for each row. Any elements in the root element above the separator line are generated only once, unless the DataWindow is a group DataWindow and the Iterate Group Headers check box has been selected.
The Detail Start element can be a nested (or multiply-nested) child of an element from the Header section, permitting a nested detail. This might be useful for DataStores being packaged for submission to external processes, such as B2B, that require company and/or document information, date, or other master data preceding the detail.
Moving the separator
You can change the location of the separator line by selecting the element that you want as the Detail Start element and selecting Starts Detail from its pop-up menu. The separator line is redrawn above the new Detail Start element. When you export the data, the Detail Start element and the children and siblings after it are generated iteratively for each row.
If no Detail Start element is specified (that is, if the Starts Detail option has been deselected), the template has only a Header section. When you export the data, only one iteration of row data is generated.
The Header section can contain the items listed in the following table. Only the root element is required:
Item |
Details |
---|---|
XML declaration |
This must be the first item in the tree view if it exists. See XML declaration. |
Document type declaration |
If there is an XML declaration, the document type declaration must appear after the XML declaration and any optional processing instructions and comments, and before the root element. Otherwise, this must be the first item in the tree view. See Document type declaration. |
Comments |
See Comments. |
Processing instructions |
|
Root element (start tag) |
See Root element. |
Group header elements |
|
Child elements |
Child elements in the Header section cannot be iterative except in the case of group DataWindows. |
Detail section in root element
The root element displays in the Header section, but the entire content of the Detail section is contained in the root element.
The Detail section, which holds the row data, can contain the items listed in The following table.
Item |
Details |
---|---|
Detail Start element |
|
Child or sibling elements to the Detail Start element |
To add a sibling to the Detail Start element, add a child to its parent (the root element by default). |
Control references |
These references are in text format and can include references to column, text, computed field, and report controls. See Controls. Nested report controls can only be referenced as child elements. See Composite and nested reports. |
DataWindow expressions |
|
Literal text |
Literal text does not correspond to a control in the DataWindow object. |
Comments |
See Comments. |
Processing instructions |
|
CDATA sections |
See CDATA sections. |
Attributes |
You can assign attributes to all element types. See Attributes. |