Tuesday, August 10, 2010

BizTalk Error "...is an invalid XPath expression..." when using Table Looping functoid

I was building a BizTalk map today that uses a Table Looping functoid. It's been a while since I have used that functoid, and I thought I had everything setup fairly well. I went to test the map, and here's an error that I saw. The names have been changed to protect the innocent:
C:\dev\Acme Development\BizTalk\Code\Acme.Customer\Acme.Customer.Maps\TestCases_FF_to_TestCase.btm: 
error btm1050: XSL transform error: Unable to write output instance to the following
. XSLT compile error at (55,45). See InnerException for details.
'userCSharp:ConvertToXsDateTime(string($var:))' is an invalid XPath expression.
userCSharp:ConvertToXsDateTime(string($var:))' has an invalid qualified name.

ConvertToXsDateTime() is a function that I put inside of a scripting functoid, and one of the Table Extractor functoids feeds into it.

The issue was that I forgot to drag the output of the Table Looping functoid directly to the node I want to repeat. The output of the Table Looping functoid tells the map how many of the destination node it should produce.

I figured this out by changing the output of the Table Extractor functoids to feed directly into the destination field (instead of into my Scripting functoid), and observing that running the test didn't produce any useful output.

I want to record this here in my blog, since I've seen this error before, and I likely will again.


Todd Hensley said...

This is still driving me crazy. When I map directly from the table extractor to the destination field I get output. Stick a functoid (like uppercase) between the extractor and the destination field and it has "an invalid qualified name".

Steve Harclerode said...

Hmmm, sorry to hear that you're having trouble with this one. My current job doesn't give me easy access to a BizTalk server, so I'm afraid I won't be able to help at the moment. Googling the error shows me that others have encountered the same issue, although I didn't see the answer (I'm assuming that you've already mapped the output of the table looping functoid [not the extractor] directly to the repeating node).

vaibhav vaibhav said...

Thank you , you saved my day