BizTalk Server 2010 Mapping Challenge
Many to One Looping
Imagine that you have a scenario where in the source schema you have a structure with three records with the same elements, however the first record is unbounded while the sencond and the third one as only one occurance. Now you need to map this three records into one single record in the destination schema.
Example:
Source Schema Records:
- Vendor (Unbounded)
- Client (Occurs once)
- Owner (Occurs once)
Destination Schema:
- Participants (unbounded)
Check out my two solutions for this challenge bellow.
Here is the XSLT Code:
03 | < xsl:value-of select = "//Personal/ID" /> |
06 | < xsl:for-each select = "Personal" > |
08 | < xsl:for-each select = "Vendor" > |
09 | < xsl:variable name = "fname" select = "FName" /> |
10 | < xsl:variable name = "lname" select = "LName" /> |
11 | < xsl:variable name = "addre" select = "Address" /> |
12 | < xsl:variable name = "city" select = "City" /> |
16 | < xsl:value-of select = "$fname" /> |
19 | < xsl:value-of select = "$lname" /> |
22 | < xsl:value-of select = "$addre" /> |
25 | < xsl:value-of select = "$city" /> |
32 | < xsl:value-of select = "Customer/FName" /> |
35 | < xsl:value-of select = "Customer/LName" /> |
38 | < xsl:value-of select = "Customer/Address" /> |
41 | < xsl:value-of select = "Customer/City" /> |
47 | < xsl:value-of select = "Owner/FName" /> |
50 | < xsl:value-of select = "Owner/LName" /> |
53 | < xsl:value-of select = "Owner/Address" /> |
56 | < xsl:value-of select = "Owner/City" /> |