Biztalk 2010: mapping an xsd with a lot of elements with the same name

FWIW we generally wind up using XSLT for any non-trivial maps anyway.

And BizTalk creates the XSLT for you anyway 🙂

So would recommend:

  • Do as best as you can with the BizTalk mapper (it seems REQUEST, PROGRAM, INPUT and INSTRUCT are mappable)
  • Compile your project
  • Click on your .btm file in the Solution Explorer in Visual Studio, and then select “Show all Files” at the top.
    You should now see a hidden file SameFileName.btm.cs. In this file is the XSLT that BizTalk generates. Copy this XSLT, and paste it into a new file – save this as .xslt. You’ll need to replace the double quotes with single quotes.
  • Open the original .btm (map) again. Click on the map grey area between the schemas (Grid Properties). In the ‘Custom XSLT Path’ Property, select your newly created .XSLT file.

BizTalk’s mapper has given you a headstart on your XSLT, and you should be able to pick up basic XSLT pretty easily. One gotcha – make sure that you remember the namespace alias prefix (usually s1)

Edit : Note that the above is for BizTalk 2009

Edit

As a sanity precaution, in the visual map of the btm, I suggest that you manually delete all the mapping lines and functoids from the grey mapping area, in case you forget that you are now using custom xslt. If you test a map with custom xslt, the mapper does issue a reminder that the xslt file is used and the visual map is ignored.

Leave a Comment