If you have tried setting the Combined Node property to organize XML output when marshalling data to XML but your output file does not show the elements and attributes nested as you would like, or you want to improve performance, you can use the Combine Key, Eliminate Duplicates and Group properties to customize the Combine settings. Example
Typical cases for customizing the settings are as follows:
Performance
The element on which you have set Combine has multiple attributes and,
by default, all attributes are used to identify duplicates. In fact, you
only need to use one attribute to identify duplicates. For example, an
Orders element has OrderID, CustomerID, EmployeeID, OrderDate, RequiredDate,
ShippedDate attributes. The only attribute you need to use in comparing
order elements is the OrderID attribute. By setting the Combine Key field
to True for OrderID and False for all other attributes, you increase performance
by preventing the engine from comparing all attributes of the Order element.
Comparing Elements
using a sub-element as a key
Depending on your schema, you may have a situation where you want to
combine duplicate elements based on a common value in a sub-element or
a sub-element attribute. Using the default Combined Node setting, you
can only use the current element and all its attributes to find duplicates.
For example, where an Invoice element has an InvoiceDetails sub-element
with an InvoiceID attribute, you would need to set the key to using in
combining duplicate Invoice elements on the unique identifier for the
Invoice, InvoiceID.
You can customize Combine Duplicate settings only on elements where you have already set the Combine Duplicates property (either directly on the node or on a descendant and therefore inherited.)
Set
the Combined Node property on the node for which you want to combine
duplicate occurrences.
Typically, when the XML data in the output file is not organized as
you would like, it is because the selected element value and all its attribute
values are used to identify duplicate elements. In many cases, you need
to search for duplicates using either a subset of this data or different
data as a key in identifying duplicate elements.
Using the Combine Node Wizard, determine which elements or attributes should be used as "Combine Keys", (keys to be used in identifying duplicate elements). By default, all attributes of the combined node are checked.
For further control over the XML output, you can set Group and Eliminate Duplicates options in the Combine Node Wizard.
Save the project and
mapping file by clicking
in the main toolbar.
Try marshalling data
to XML to test your settings by clicking
in the main toolbar.
Setting
Up Nested XML Elements for Marshalling
Combining Duplicate Elements in XML Output
XML Structure Tab
Sample Marshal with Combine Project