BizTalk: mapping with Xslt

Posted by Leonid Ganeline on Geeks with Blogs See other posts from Geeks with Blogs or by Leonid Ganeline
Published on Thu, 14 Jun 2012 21:55:49 GMT Indexed on 2012/06/15 15:17 UTC
Read the original article Hit count: 466

Filed under:

BizTalk Map Editor (Mapper) is a good editor, especially in the last 2010 version of the BizTalk. But still sometimes it cannot do the tasks easily. It is time for the Xslt code, It is time to remember that the maps are executed by the Xslt engine. 

Right-click the Mapper Grid (a field between the source and target schemas) and choose Properties /Custom XSLT Path.  Input here a name of the file with Xslt code. Only this code will be executed, forget the picture in the Mapper, all those links and functoids. 

Let’s see the real-life example.

There are two source Addresses. One is on the top level and the second is inside the Member_Address record with MaxOccurs=* .

The target address is placed inside the Locator record with MaxOccurs=*.

Map.Pict

The requirement is to map all source address to the one target address structure.

The source Xml document looks like:

Source.Xml

The result Xml should be like this:

Output.Xml

Try to do this mapping with the Mapper and you will spent good amount of time and the result map would be tricky.

If we use the Xslt code, the mapping will be simple and unambiguous, like this:

Xslt

Simple, elegant.

© Geeks with Blogs or respective owner