BizTalk: Dynamically create schema nodes using XSLT

First let us discussed about the problem:I have a source schema which is in the following format:Now I want my destination schema in the following format:Note: Check I want the Ord1 and OrdName1 in OrderInfo as well as Ord2 and OrdName2 in OrderInfo too. So I need the value of above in one record (node) of Destination schema. So for to do the above functionality I have used the BizTalk map. What I have done is I have created a BizTalk map and assign Source.xsd in SourceSchema and Destination.xsd in Destination schema of this map.You can see the snap of my Mapping as follows:Here you can find that I have added just one script Functoids in the mapping of source and destination schema. I have written the following code (XSLT Code) to map both schemas.

==========================================================================

<xsl:for-each select="//Order">
<xsl:element name="OrderInfo">
<xsl:element name="OrderID"><xsl:value-of select="Ord1" /></xsl:element>
<xsl:element name="OrderName"><xsl:value-of select="OrdName1" /></xsl:element>
</xsl:element>
</xsl:for-each>
<xsl:for-each select="//Order">
<xsl:element name="OrderInfo">
<xsl:element name="OrderID"><xsl:value-of select="Ord2" /></xsl:element>
<xsl:element name="OrderName"><xsl:value-of select="OrdName2" /></xsl:element>
</xsl:element>
</xsl:for-each>


==========================================================================

So Test the map and check the generated destination file.Enjoy BizTalking:)

Advertisements

About Vijay Modi

Having 12+ years of experience in web application development. Expertise in various domains like E-Commerce, E-Learning, Insurance. I have expertise in web application development, window application development, Performance improvement, bug fixing etc. I have worked on various Microsoft technologies including ASP.Net, MVC, WebApi, WCF, Entity Framework, WPF, Window Application Development, AWS, Azure, AngularJS 2.0 / 1.5.2, .NetCore framework, jQuery. I am believing in quality work and achieving deadlines. Also like to work on new technologies and quick learner.
This entry was posted in BizTalk Server and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s