Skip to main content Skip to complementary content

Defining the schema of your output file

About this task

Upon completion of the previous operations, the columns in the Linker Source area are automatically mapped to the corresponding ones in the Linker Target area, as indicated by blue arrow links.

File - Step 4 of 5 dialog box.
In this step, you need to define the output schema. To do so, you can perform different actions:
Action Instructions
Create a schema from scratch or edit the source schema columns to pass to the output schema In the Linker Source area, click the Schema Management button to open the schema editor.
Specify the maximum number of columns to be displayed in the schema list In the Field Limit field of the Linker Source area, specify the maximum number of columns you want to display if the number of columns of the source file exceeds the limit defined in the Talend Studio preference and any columns you want to pass to the output schema are not shown in the schema list. Then click the refresh button.
Define a loop element In the Linker Target area, right-click the element of interest and select Set As Loop Element from the contextual menu.
Information noteNote: It is a mandatory operation to define an element to run a loop on.
Define a group element In the Linker Target area, right-click the element of interest and select Set As Group Element from the contextual menu.
Information noteNote: You can set a parent element of the loop element as a group element on the condition that the parent element is not the root of the XML tree.
Create a child element for an element In the Linker Target area:
  • Right-click the element of interest and select Add Sub-element from the contextual menu, enter a name for the sub-element in the dialog box that appears, and click OK,
  • Select the element of interest, click the [+] button at the bottom, select Create as sub-element in the dialog box that appears, and click OK. Then, enter a name for the sub-element in the next dialog box and click OK.
Create an attribute for an element In the Linker Target area:
  • Right-click the element of interest and select Add Attribute from the contextual menu, enter a name for the attribute in the dialog box that appears, and click OK,
  • Select the element of interest, click the [+] button at the bottom, select Create as attribute in the dialog box that appears, and click OK. Then, enter a name for the attribute in the next dialog box and click OK.
Create a name space for an element In the Linker Target area:
  • Right-click the element of interest and select Add Name Space from the contextual menu, enter a name for the name space in the dialog box that appears, and click OK,
  • Select the element of interest, click the [+] button at the bottom, select Create as name space in the dialog box that appears, and click OK. Then, enter a name for the name space in the next dialog box and click OK.
Delete one or more elements, attributes, or name spaces In the Linker Target area:
  • Right-click the elements, attributes, or name spaces of interest and select Delete from the contextual menu
  • Select the elements, attributes, or name spaces of interest and click the x button at the bottom
  • Select the elements, attributes, or name spaces of interest and press the Delete key.
    Information noteNote: Deleting an element will also delete its children, if any.
Adjust the order of one or more elements In the Linker Target area, select the elements of interest and click the upward and downward buttons.
Set a static value for an element/attribute/name space In the Linker Target area, right-click the element/attribute/name space of interest and select Set A Fix Value from the contextual menu.
Information noteNote:
  • The value you set will replace any value retrieved for the corresponding column from the incoming data flow in your Job.
  • You can set a static value for a child element of the loop element only, on the condition that the element does not have its own children and does not have a source-target mapping on it.
Create a source-target mapping Select the column of interest in the Linker Source area, drop it onto the node of interest in the Linker Target area, and select Create as sub-element of target node, Create as attribute of target node, or Add linker to target node according to your need in the dialog box that appears, and click OK.

If you choose an option that is not permitted for the target node, you will see a warning message and your operation will fail.

Remove a source-target mapping In the Linker Target area, right-click the node of interest and select Disconnect Linker from the contextual menu.
Create an XML tree from another XML or XSD file Right-click any schema item in the Linker Target area and select Import XML Tree from the contextual menu to load another XML or XSD file. Then, you need to create source-target mappings manually and define the output schema all again.
Information noteNote:

You can select and drop several fields at a time, using the Ctrl + Shift technique to make multiple selections, therefore making mapping faster. You can also make multiple selections for right-click operations.

Procedure

  1. In the Linker Target area, right-click the element you want to run a loop on and select Set As Loop Element from the contextual menu.
    Linker Target dialog box.
  2. Define other output file properties as needed, and then click Next to view and customize the end schema.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!