User Guide > Using Transformations > Creating an XML, XSLT, or Streaming Transformation > Mapping Source Data to Target Output Columns (XSLT or Streaming)
 
Mapping Source Data to Target Output Columns (XSLT or Streaming)
The Data Map panel (see Data Map Panel) is available for XSLT transformations and streaming transformations. This panel lets you create and modify target output columns, map elements from the source XML document to the targets.
The following guidelines apply when using the Data Map panel:
When you map source elements to target output columns in the Data Map panel, the XSLT is automatically generated in the XSLT panel.
If you edit the text in the XSLT panel, the Data Map panel is permanently disabled. In this situation, design the outputs in the Outputs panel.
You can map a source to more than one target, but you cannot map a single target to more than one source.
The data types of the source and the target should match. Even if the data types do not match exactly, the link is valid if one data type is castable to the other.
The target name is displayed as a column name in the output when the transformation is executed.
When a link is selected, it is displayed as a thick line.
On the Data Map panel, you can:
Manually create target columns and map them to source XML data.
Automatically create target columns and map them to source XML data.
Rename a target column and change its data type.
Unlink or move targets.
To manually create target columns and map them to source XML data
1. If necessary, open the transformation.
The transformation editor displays the Data Map panel.
2. If necessary, expand the nodes in the Source column to display all XML source definitions.
3. In the Target column, select the outputs node or an existing column, click Add ( ) in the toolbar, and select the data type for the output column from the drop-down list.
An output column with a default name is created. You can create as many target columns as you need.
4. Connect a source and a target by selecting them individually and clicking the Create Link button.
5. Save your edits.
To automatically create target columns and map them to source XML data
1. If necessary, open the transformation.
The transformation editor displays the Data Map panel.
2. If necessary, expand the nodes in the Source column to display all XML source definitions.
3. Select the source in the Source column.
4. Click the Create Link And Target button.
A target with the same name and data type of the source is created in the Target column, and a link is also created between the source and the target.
Selecting multiple sources and clicking Create Link And Target creates a separate target and link for each source. Selecting a source and clicking Create Link And Target several times creates that many targets and links pointing to the same source.
5. Save your edits.
To rename a target column and change its data type
1. If you want to rename a target, right-click the column name, select Rename, and supply a new name.
2. If you want to change the target’s data type:
a. Right-click the target name and select Change Type from the menu
Or
Select the target and click the Change Type toolbar button.
b. In the Choose Data Type window, click the data type name and select a data type from the drop-down list.
c. Optionally, specify the length or the number of digits for certain data types.
d. Click OK.
To unlink or move targets
1. To unlink a target and a source, grab and drag the link away from the target or source, and release the mouse button.
You can also select the link and click the Delete button to unlink a target and a source.
2. To align a target with its source, highlight the target and move it up or down using the up or down button.
3. Save your edits.