Merge Two XML Documents v2
This script example is contributed by Raffael Herrmann.
You can compare the "Merge Two XML Documents" example with this one. This example is shorter and uses expressive features of Groovy.
It is useful to have the extra data from another service in the same document and use it in a later mapping step.
For example, you might need external key-value data and map existing fields based on keys.
In this script, we create
Extension1 element to make the resulting document more clear. You can add multiple extension elements to the same document.
The alternative is to apply this mapping in the same script without adding the extension element.