Here’s a cool mapping tip I found on working in BizTalk Mapping.
In the above figure above the value mapped to the target element will be “CustomerName”.
The values that can be set are:
1. Copy text value – which is the default that copies the content of the element
2. Copy name – copies the name of the source node instead of its value
3. Copy text and subcontent value – concatenates the value of all child nodes
Now you might be wondering what is this 3rd value (Copy text and subcontent value) that can be set…
This is used if you want to concatenate all the child element values of the source node into a single element in the target as shown below.
Input Message
FirstName_0
LastName_0
Street_0
City_0
FirstName_1
LastName_1
Street_1
City_1
Output Message
FirstName_0LastName_0Street_0City_0
FirstName_1LastName_1Street_1City_1
Now here is another interesting mapping
The mapping above transforms the elements in the source schema into a key-value pair as shown below.
Each element node from the source schema links to the two elements in the target schema, one link copies the node name and the other copies the node value.
Input Message
FirstName_0
LastName_0
Street_0
City_0
Output Message
FirstName
FirstName_0
LastName
LastName_0
Street
Street_0
City
City_0
While mapping an element from the source schema to the target schema, it is possible to copy either the value contained within the element or the element name itself.
You achieve this by setting the Source Links property of the link connecting the elements as shown below.
In the above figure above the value mapped to the target element will be “CustomerName”.
The values that can be set are:
1. Copy text value – which is the default that copies the content of the element
2. Copy name – copies the name of the source node instead of its value
3. Copy text and subcontent value – concatenates the value of all child nodes
Now you might be wondering what is this 3rd value (Copy text and subcontent value) that can be set…
This is used if you want to concatenate all the child element values of the source node into a single element in the target as shown below.
Here is an example:
Input Message
Output Message
FirstName_0LastName_0Street_0City_0
FirstName_1LastName_1Street_1City_1
Now here is another interesting mapping
The mapping above transforms the elements in the source schema into a key-value pair as shown below.
Each element node from the source schema links to the two elements in the target schema, one link copies the node name and the other copies the node value.
Input Message
Output Message