cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT for-each within another for-each

Former Member
0 Kudos

Hi All,

My XSLT mapping needs to pick a field(BOL) from the Header and the using that, search the Items node for the matching BOL and generate the output accordingly.

My current XSLT is as follows(not the entire program, just the snippet)

<xsl:for-each select="ns0:Messages/ns0:Message1/ns1:MT_Header/Header">

<xsl:param name="search"><xsl:value-of select="bol"/></xsl:param>

<xsl:for-each select="ns0:Messages/ns0:Message2/ns1:MT_Items/Item[BOL=$search]">

<Output>

<BOL_ITEM><xsl:value-of select="BOL_ITEM"/></BOL_ITEM>

</Output>

</xsl:for-each>

</xsl:for-each>

The following code works correctly(without the outer for-each and with hardcoding)

<xsl:param name="search">100</xsl:param>

<xsl:for-each select="ns0:Messages/ns0:Message2/ns1:MT_Items/Item[BOL=$search]">

<Output>

<BOL_ITEM><xsl:value-of select="BOL_ITEM"/></BOL_ITEM>

</Output>

</xsl:for-each>

So its the for-each within another for-each that does not work . Is there some syntax problem ? Or another way to achieve this in XSLT?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Closing this thread