|
Home > Archive > BizTalk Server General > December 2004 > Nested Loops
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Bob Corcoran 2004-12-02, 5:48 pm |
| Has anyone had experience configuring a nested loop with the available
functoids? If I were to write out the XSLT by hand, it would look something
like this:
<xsl:for-each select="Organization/Subscriber">
<LastName><xsl:value-of select="Person/LastName"/></LastName>
<xsl:for-each select="Dependent">
<LastName>
<xsl:value-of select="Person/LastName"/>
</LastName>
</xsl:for-each>
</xsl:for-each>
for each subscriber there will be possibly many dependents, and each should
map to its own flat file record. So if I have 2 subscribers each with 2
dependents, I would end up with six flat file records.
One of the sticking points is trying to map two outputs into the same flat
file schema input, i.e. mapping the LastName fields from Subscriber and
Dependent into the LastName field in the flat file schema.
This is an interesting mapper implementation that might only be solvable
with a custom functoid.
--
Bob Corcoran
| |
| Bob Corcoran 2004-12-02, 5:48 pm |
| I managed to solve this problem by using two scripting functoids, using XSLT
call templates in both. I wrote the outer loop in the first scripting
functiod, and called the named template in the second scripting functoid to
process the inner loop. There are no input connections to either functoid.
There is an output connection from the first functoid to the root node of the
flat file schema.
This means that I had to write the XSLT by hand, but the big win for me is
the ability to correctly transform the input to the output flat file schema
(within the attendant time constaints).
"Bob Corcoran" wrote:
> Has anyone had experience configuring a nested loop with the available
> functoids? If I were to write out the XSLT by hand, it would look something
> like this:
>
> <xsl:for-each select="Organization/Subscriber">
> <LastName><xsl:value-of select="Person/LastName"/></LastName>
> <xsl:for-each select="Dependent">
> <LastName>
> <xsl:value-of select="Person/LastName"/>
> </LastName>
> </xsl:for-each>
> </xsl:for-each>
>
> for each subscriber there will be possibly many dependents, and each should
> map to its own flat file record. So if I have 2 subscribers each with 2
> dependents, I would end up with six flat file records.
>
> One of the sticking points is trying to map two outputs into the same flat
> file schema input, i.e. mapping the LastName fields from Subscriber and
> Dependent into the LastName field in the flat file schema.
>
> This is an interesting mapper implementation that might only be solvable
> with a custom functoid.
>
> --
> Bob Corcoran
|
|
|
|
|