Is there a way to set value template in BizTalk schema/mapping?

128 views Asked by At

I have the following problem. In BizTalk mapper I'm converting BizTalk core (XML) into flat file. One of fields in this flat file must contain 13 chars in special format - if incoming value is less than 13 chars I should add leading 9 and appropriate number of 0 (for example if I have incoming value XXXX, I should map 900000000XXXX). But if incoming value contains 13 chars I should map it as is.

For now I see the only way how to do this - to use Script functoid, to use C#, take length of incoming value and using Switch operator to append string with appropriate leading chars.

This solution looks working but quite clumsy. Does anyone know if there's more smart way to do it? Maybe somehow it may be solved with template in outgoing file schema which used in map? Or maybe somehow it can be done in XSLT map (I understand that when I switch from btm to xslt I can use When operator in xslt but it's the same as to use Switch in C# and also looks clumsy)?

I'll appreciate any advice. Thank you.

0

There are 0 answers