Friday, September 14, 2007

Custom XSLT in Biztalk Maps

Recently someone asked if you can use custom XSLT in Biztalk Maps . The answer is of course yes as the map you built .btm gets translated to an xslt anyway if yo look at the code that gets spewed out .
In any case to do that create the map and select source and destination . Click on the map and go to properties. There you will see a property custom XSLT . You can select your custom XSLT here . This feature was there since 2004 but I am not sure if it widely used though , on the flip side using custom xslt you kind of lose the graphical view on the map on what is being done , which many BI analysts like (the visual part of the transformation ) . but sometimes custom XSLT's could be the way to go .



5 comments:

Mark Brimble said...

For an interesting example using custom XSLT to call a .Net assembly see http://www.topxml.com/BizTalk/rn-233138_Pre-Processing-on-Send-Port.aspx or http://www.biztalkgurus.com/forums/AddPost.aspx?PostID=2234&Quote=True. I have recently had the job of reconstructing some assemblies that contain maps using this. It took me awhile to work out what was going on until clicked that the map is taking the each name -value pair, matching on the name value , decoding the value field and then finally copying the decoded value. This is an interesting way of decoding and encoding in a map rather than a pipeline.

Suda said...

Hi Abhilash,



I have a map which is using table looping functoid.



my source schema looks like as below:



Root

child1FirstName

child1LastName

child1MiddleName

child1Contact

child1phone1

child1phone2

child2FirstName

child2LastName

child2MiddleName

child2phone1

child2phone2

child2Contact

Root



my target schema looks like as below:



Root

Start-Childs(Unbounded)

Name

FirstName
LastName
MiddleName

:

:

Name

Contacts

:

:

Contacts
Phone(Unbounded)
:
:
:
Phone

End-Childs

Start-Childs

:

:

:

Phone(Unbounded)
:
:
:
Phone

End Childs

End Root



The thing is I am able to generate the target schema for all except for the two phones. I am getting only one phone in target schema. I could not make loop on phone element in target schema.I could make loop on Childs element in target.

Can anyone throw idea on how to do this.

I want to make loop on phone element as each child has two phone elements.



please help;

Thanks In advance.

Suda said...

I have a map which is using table looping functoid.



my source schema looks like as below:



Root

child1FirstName

child1LastName

child1MiddleName

child1Contact

child1phone1

child1phone2

child2FirstName

child2LastName

child2MiddleName

child2phone1

child2phone2

child2Contact

Root



my target schema looks like as below:



Root

Start-Childs(Unbounded)

Name

FirstName
LastName
MiddleName

:

:

Name

Contacts

:

:

Contacts
Phone(Unbounded)
:
:
:
Phone

End-Childs

Start-Childs

:

:

:

Phone(Unbounded)
:
:
:
Phone

End Childs

End Root



The thing is I am able to generate the target schema for all except for the two phones. I am getting only one phone in target schema. I could not make loop on phone element in target schema.I could make loop on Childs element in target.

Can anyone throw idea on how to do this.

I want to make loop on phone element as each child has two phone elements.



please help;

Thanks In advance.

Anonymous said...

Hi Abhilash,


This article is really good..it has really good info...there are so many people (Naveen Karamchetti) who claim they are experts in Biztalk but does not seem to be...keep going

Custom Paper Writing said...

Many institutions limit access to their online information. Making this information available will be an asset to all.