Oracle XML Publisher Template Builder - Insert Field Dialog


Insert Field Dialog

This dialog allows you to select data elements defined in the data source (that is, the XML file) and insert them into the template. From the Insert menu select Field… to open the insert element dialog.


The dialog shows the structure of the data source in a tree view. Select a field that represents a single data field (a leaf node of the tree) and click the Insert button. A text form field with hidden XML Publisher commands (in the help text of the form field) is inserted at the cursor position in the template. You may either select and insert an additional data field or close the dialog by clicking the Close button.

Example

When you select a field name in the tree view, an example value for this field is shown below the tree view behind Example.

Find

For an XML document with a large and complicated structure, use the find functionality to find a specific field. Enter a partial string of the field name you are searching into the Find field and click the Find Next button. The next occurrence of a data element that includes your search expression will be selected. Click the Find Next button again to see the next occurrence.

Calculation

You can provide a function to aggregate the data for multiple occurrences of the same field.
Select the data field in the tree view and the select one of the  aggregation functions in the Calculation box:

·         Average
·         Count
·         Minimum
·         Maximum
·         Sum

For example, if you select sum for a data field, the field will show the sum of all occurring values for this data field. The value must be a valid XSL number for the accumulation functions to work. Formatted numbers cannot be processed by XML Publisher (for example a number using a thousand separator: 10,000,000.00).

It is important to understand the context (marked by F and E processing instruction form fields) to know exactly which fields are accumulated. If you insert a data field with an accumulation function into a repeating section (marked by F and E processing instruction form fields) you need to be aware of the grouping functionality. If you used grouping (for example in the Insert Table/Form) you will need to check On Grouping for the grouping to work correctly.

Please consult the Oracle XML Publisher User’s Guide for additional information on <?for-each?> loops.