Tuesday, September 13, 2011

BizTalk Inline XSLT Call Template and Namespaces

If you have used the Inline XSLT Call Template at all, you will notice at times that your map will validate just fine, but the output may not be exactly what you want (sometimes just an empty single node).

A little gotcha is that you need to be aware of the namespaces within your schemas, or the output of your map will be less than desirable.

Let's take a simple scenario. I'm mapping one source schema to a single destination schema.



In this example, I'm trying to iterate through a node and essentially pass the input parameter through:



Unfortunately my output looks a little small:



Interesting. Not a single error, but not what I was expecting.

The problem here is that with my XSLT code, I overlooked the namespace of my source schema. To get the proper namespace, I save the latest version of my map, validate it,



...and then take a look at the output XSL file. The location of this file is displayed in the output window.



Within the .xsl file, I will now be able to get the proper namespace of my schema,



In this case, the namespace is s0, as in s{zero}. Now I can apply this to my XSTL Call functoid.



A subtle difference, with drastic results: