How to regroup the XML Data
The XLS template supports the XSL 2.0 for-each-group standard that allows you to regroup XML data into hierarchies that are not present in the original data. With this feature, your template does not have to follow the hierarchy of the source XML file. You are therefore no longer limited by the structure of your data source.Regrouping Syntax
To regroup the data, use the following syntax:
For example, to regroup the G_FULL_NAME listing by YEAR_OF_BIRTH, enter the following in your template:
The elements that were at the same hierarchy level as YEAR_OF_BIRTH are now children of YEAR_OF_BIRTH. You can then refer to the elements of the group to display the values desired.
To establish nested groupings within the already defined group, use the following syntax:
For example, after declaring the G_FULL_NAME grouping by YEAR_OF_BIRTH, you can then further group by EMPLOYEE_NUMBER within YEAR_OF_BIRTH as follows:
At runtime, XML Publisher will loop through the occurrences of the new groupings, displaying the fields that you defined in your template.Regrouping by an Expression
Regrouping by an expression allows you to apply a function or command to a data element, and then group the data by the returned result.
To use this feature, state the expression within the regrouping syntax as follows:
This example is displayed in the figure below (download the example
op Tuesday 05 May 2009 - 13:34:12