Use a Denormalizer component to generate a single XML string from an input XML file.
integer n = 0; string value = ""; function integer append() { value = value + $0.xmlString + "\n"; n++; return n; } // This function is called once after the // append() function was called for all records // of a group of input records defined by the key. // It creates a single output record for the whole group. function integer transform() { $0.xmlString = value; value = ""; return OK; }
This code defines an integer variable for a counter, and sets the initial value to zero. It also defines an empty string variable (string value = "").
The append function cycles through the input XML and builds a single XML string by concatenating the input XML node with the current value of the string variable.
When all nodes have been concatenated to the string variable, the value of the variable is output to the $0 port of the component.