Contents: Planning, installing, and configuring Mashup Center : Mashup Center 2.0
Mashup Center 2.0 includes changes in the Group operator's grouping keys.
Changes for grouping keys for version 2.0 include the following:
- The grouping key for an element node is no longer affected by the element's attribute nodes.
- The grouping key for an element node is no longer affected by the names or the attributes of the element's descendant nodes.
If you have a data mashup where the Group operator has one or more grouping expressions that return an element node, the grouping keys might change after you upgrade to Mashup Center 2.0.
You can obtain the pre-upgrade grouping key behavior by modifying the data mashup in one of the following ways:
Element attribute nodes
If you want specific attributes on the target element to affect the grouping key, then you can create additional grouping expressions to select those specific attributes.
For example, assume that you have input entries such as the following that include the attribute id="n"
In Mashup Center 1.x, if you have a data mashup with the grouping expression ./myele
, then the Group operator produced two distinct output groups.
In version 2.0, however, the attribute nodes are ignored. The Group operator produces a single group. If you want the pre-upgrade behavior, add a second grouping expression to select the attribute: ./myele/@id
. The Group operator will return two distinct groups.
Names or attributes of descendant nodes
If you want the grouping key to be affected by the names of the target element's descendant nodes, change the expression so that instead of returning the element node, the expression invokes the ToString function (new to version 2.0) and passes the target element as an argument to that function. The ToString function creates a serialized XML string that includes all attribute names and values, all descendant node names, and all text node values. The string is then used to calculate the grouping keys for the operator. Thus the grouping keys will be affected by attributes and by descendant node names.
For example, assume that you have the following two input entries that have descendant elements:
In version 1.x., the grouping expression ./myele
produces two distinct output groups based on the descendant elements.
In version 2.0, however, the names of the descendant nodes, <childA>
, are ignored. The Group operator produces a single distinct group based only on the text nodes that are descendants to the <myele>
If you want the pre-upgrade behavior, change the grouping expression so that instead of selecting the <myele>
element, you specify the ToString function and pass ./myele
as an argument. The resultant strings for the two entries will include the names of the descendant nodes and will produce different grouping keys. The Group operator will return two distinct groups.
Note that the grouping expression from the ToString function returns a string instead of a node. If you want to use myele
as a node
in subsequent operators, you must also include ./myele
as a second grouping expression or as an associated data expression, so that it is included in the group output and can be referenced by other operators.
Parent topic: Changes in the Group operator's grouping keys and output : Mashup Center 2.0