XML Structure Tab: Optimized Combine Column

Explanation | Example

Applies to: Marshalling data to XML only

Available: For mapped nodes only when the option Optimize Combine Using ORDER BY has been selected from the XML Structure tab toolbar. When you have placed a checkmark in the "Combined Node" column for an element, for that element only, and there is at least one Combine Key set for the element. There should be no sibling nodes that already have this property set. There should be no ancestor nodes that have the Group option set.

Possible values:

Not currently set. You may check this node to combine nodes in the XML output file using an optimized combine algorithm.

This node will be used with the optimized combine algorithm to combine nodes in the XML output file. The results will be sorted in ascending order.

This node will be used with the optimized combine algorithm to combine nodes in the XML output file. The results will be sorted in descending order.

 Explanation

Summary | Examples

While this option is targeted to those applications that require optimization, it also offers a sort capability because the optimization is obtained by automatically generating a specific ORDER BY clause to use in marshalling.  Allora offers three options for sorting XML output nodes:

Choose which option using the Select Sort/ORDER BY Method icon in the XML Structure toolbar.

When you use this option, children of the node where the option is set are sorted in memory before a DOM tree is built for the XML output structure. Nodes are compared using database datatype (e.g. an integer type would use a number compare). Compare examines the node tag first, then the node value and then the attributes for the node. Results are ordered by tag unlike when using ORDER BY Node where results are ordered by vale. See also ORDER BY Node as an alternative.

While the standard combine algorithm uses a DOM (Document Object Model) tree to identify elements to combine, the optimized combine aIgorithm uses an ORDER BY in the SELECT statement sent to the database during marshalling to increase performance in generating the combined XML output. Each node that is set as a Combine Key is added to the ORDER BY statement. This is useful for potentially large XML output documents where the standard combine algorithm can lead to memory overflow problems. The same data will be returned in both algorithms but the order may be different. The Optimized Combine approach also allows you to set ascending or descending order for the fields used in the ORDER BY clause.

This option automatically propagates to ancestor nodes.

Examples

Summary | Explanation

Review these topics to see how the XML output changes depending on settings in the XML Structure tab:

 

 

Marshal with Combine Project

Overview of the project used in examples below.

1.

Marshal Without Combine

No settings have been made in the XML Structure tab

2.

Marshal with Combine

XML output combines all PurchaseOrder nodes that have a matching value for the OrderID node.

3.

Marshal with Combine and Group

 XML output groups  all matching elements (LineItem) together

4.

 

Marshal with Combine and Order By

XML output contains records retrieved from the database using an ORDER BY clause

5.

Marshal with Optimized Combine

XML output generated using the Optimized Combine feature in the XML Structure tab.

See Also

XML Structure Tab
Introduction to Combining Nodes in XML Output When Marshalling

Combining Duplicate Elements in XML Output

Customizing Combine Settings for XML Output