Defining the output mode - 6.3

Talend Open Studio for ESB User Guide

EnrichVersion
6.3
EnrichProdName
Talend Open Studio for ESB
task
Design and Development
EnrichPlatform
Talend Studio

To define the output mode of the document-type data, you are defining whether to put all of the XML elements into one single XML flow and when empty element exist, whether to output them. By doing this, you do not change the structure of the XML tree you have created.

How to output elements into one document

Unless you are using the aggregate element which always classifies the output elements and splits an output XML flow, you are able to determine whether an XML flow is output as one single flow or as separate flows, using the All in one feature in the tXMLMap editor.

To do this, on the output side of the Map editor, proceed as follows:

  1. Click the pincer icon to open the map setting panel. The following figure presents an example.

  2. Click the All in one field and from the drop-down list, select true or false to decide whether the output XML flow should be one single flow.

    • If you select true, the XML data is output all in one single flow. In this example, the single flow reads as follows:

      The structure of this flow reads:

    • If you select false, the XML data is output in separate flows, each loop being one flow, neither grouped nor aggregated. In this example, these flows read as follows:

      Each flow contains one complete XML structure. To take the first flow as example, its structure reads:

Note

The All in one feature is disabled if you are using the aggregate element. For further information about the aggregate element, see How to aggregate the output data

How to manage empty element in Map editor

It may be necessary to create and output empty elements during the process of transforming data into XML flow, such as, when tXMLMap works along with tWriteXMLField that creates empty elements or when there is no input column associated with certain XML node in the output XML data flow.

By contrast, in some scenarios, you do not need to output the empty element while you have to keep them in the output XML tree for some reasons.

tXMLMap allows you to set the boolean for the creation of empty element. To do this, on the output side of the Map editor, perform the following operations:

  1. Click the pincer icon to open the map setting panel.

  2. In the panel, click the Create empty element field and from the drop-down list, select true or false to decide whether to output the empty element.

    • If you select true, the empty element is created in the output XML flow and output, for example, <customer><LabelState/></customer>.

    • If you select false, the empty element is not output.

How to define the sequence of multiple input loops

If a loop element, or the flat data flow, receives mappings from more than one loop element of the input flow, you need to define the sequence of the input loops. The first loop element of this sequence will be the primary loop, so the transformation process related to this sequence will first loop over this element such that the data outputted will be sorted with regard to its element values.

For example, in this figure, the types element is the primary loop and the outputted data will be sorted by the values of this element.

In this case in which one output loop element receives several input loop elements, a [...] button appears next to this receiving loop element or for the flat data, appears on the head of the table representing the flat data flow. To define the loop sequence, do the following:

  1. Click this [...] button to open the sequence arrangement window as presented by the figure used earlier in this section.

  2. Use the up or down flash button to arrange this sequence.