Skip to Content
avatar image
Former Member

XSLT for-each within another for-each

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 17, 2010 at 06:46 AM

    Closing this thread

    Add comment
    10|10000 characters needed characters exceeded