Using the Transformation Rule Builder, you can create maps in which the values of the elements or attributes in the target schema are conditionally based on elements or attributes in the source schema. To create a map with conditions, use the Choose function.
To map with conditions using the Transformation Rule Builder:
Open the map activity icon in your project.
Expand the schema icons in your map and align and size your schemas into a workable order. Guidelines
To map a connection,
drag the source element you want to map and drop it on the target element.
If the connection is valid, a map link graphically connects the two.
In the Map Editor,
click on the map link to which you want to use add the Choose function.
The Transformation Rule Builder opens displaying the relative path
to the closest mapped ancestor. If no mapped ancestor is available, the
full path displays.
Build the transformation rule. Use the same syntax as in the following example:
choose(when(TotalValue>='10000','High'),when(TotalValue>='5000','Medium'),
otherwise('Low'))
To save your rule,
select File>Save All from the menu bar.
The save completes if the rule uses proper syntax.
To return to the Map Editor, minimize the Transformation Rule Builder.
In the Properties View, select one of the following Mapping Modes from the drop-down list:
To save your changes,
select File>Save mapName.map from the menu bar.
When you save your map, the XSLT required to transform the source to
target document is automatically generated.
View
the Generated XSLT.
Choose expressions appear in the .xsl file as <xsl:choose>.