Component family |
File/Output |
|
Function |
tFileOutputMSXML writes multiple |
|
Purpose |
tFileOutputMSXML creates a |
|
Basic settings |
File Name |
Name and path to the file to be created and or the variable to be For further information about how to define and use a variable in |
|
Configure XML tree |
Opens the dedicated interface to help you set the XML mapping. For |
Advanced settings |
Create directory only if not exists |
This check box is selected by default. It creates the directory |
|
Advanced separator (for numbers) |
Select this check box to modify the separators used for
Thousands separator: define
Decimal separator: define |
|
Encoding |
Select the encoding from the list or select Custom and define it manually. This field is |
|
Don’t generate empty file |
Select this check box if you do not want to generate empty files. |
|
Trim the whitespace characters |
Select this check box to remove leading and trailing whitespace |
|
Escape text |
Select this check box to escape special characters. |
|
tStatCatcher Statistics |
Select this check box to gather the Job processing metadata at a |
Global Variables |
NB_LINE: the number of rows read by an input component or ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see Talend Studio |
|
Log4j |
The activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html. |
|
Limitation |
n/a |
Double-click on the tFileOutputMSXML component to
open the dedicated interface or click on the three-dot button on the Basic settings vertical tab of the Component tab.
To the left of the mapping interface, under Linker
source, the drop-down list includes all the input schemas that should
be added to the multi-schema output XML file (on the condition that more than one
input flow is connected to the tFileOutputMSXML
component).
And under Schema List, are listed all columns
retrieved from the input data flow in selection.
To the right of the interface, are expected all XML structures you want to create
in the output XML file.
You can create manually or easily import the XML structures. Then map the input
schema columns onto each element of the XML tree, respectively for each of the input
schemas in selection under Linker source.
The easiest and most common way to fill out the XML tree panel, is to import a
well-formed XML file.
-
Rename the root tag that displays by
default on the XML tree panel, by
clicking on it once. -
Right-click on the root tag to display the contextual menu.
-
On the menu, select Import XML
tree. -
Browse to the file to import and click OK.
The XML Tree column is hence
automatically filled out with the correct elements. You can remove and
insert elements or sub-elements from and to the tree: -
Select the relevant element of the tree.
-
Right-click to display the contextual menu
-
Select Delete to remove the selection from the tree or select the
relevant option among: Add sub-element,
Add attribute, Add namespace to enrich the tree.
If you don’t have any XML structure already defined, you can manually create
it.
-
Rename the root tag that displays by
default on the XML tree panel, by
clicking on it once. -
Right-click on the root tag to display the contextual menu.
-
On the menu, select Add sub-element
to create the first element of the structure.You can also add an attribute or a child element to any element of the
tree or remove any element from the tree. -
Select the relevant element on the tree you just created.
-
Right-click to the left of the element name to display the contextual
menu. -
On the menu, select the relevant option among: Add sub-element, Add
attribute, Add namespace
or Delete.
Once your XML tree is ready, select the first input schema that you want to map.
You can map each input column with the relevant XML tree element or sub-element to
fill out the Related Column:
-
Click on one of the Schema column
name. -
Drag it onto the relevant sub-element to the right.
-
Release the mouse button to implement the actual mapping.
A light blue link displays that illustrates this mapping. If available,
use the Auto-Map button, located to the
bottom left of the interface, to carry out this operation automatically.You can disconnect any mapping on any element of the XML tree:
-
Select the element of the XML tree, that should be disconnected from its
respective schema column. -
Right-click to the left of the element name to display the contextual
menu. -
Select Disconnect link.
The light blue link disappears.
Defining the XML tree and mapping the data is not sufficient. You also need to
define the loop elements for each of the source in
selection and if required the group element.
The loop element allows you to define the iterating object. Generally the Loop
element is also the row generator.
To define an element as loop element:
-
Select the relevant element on the XML tree.
-
Right-click to the left of the element name to display the contextual
menu. -
Select Set as Loop Element.
The Node Status column shows the
newly added status.Note
There can only be one loop element at a time.
The group element is optional, it represents a constant element where the
Groupby operation can be performed. A group element can be defined on the
condition that a loop element was defined before.
When using a group element, the rows should be sorted, in order to be able to
group by the selected node.
To define an element as group element:
-
Select the relevant element on the XML tree.
-
Right-click to the left of the element name to display the contextual
menu. -
Select Set as Group Element.
The Node Status column shows the newly added
status and any group status required are automatically defined, if
needed.
Click OK once the mapping is complete to
validate the definition for this source and perform the same operation for the
other input flow sources.