Link to home
Start Free TrialLog in
Avatar of mmahon512
mmahon512

asked on

Xsl Nested Loop

I am trying to display a subset of data that matches based on the ExchangeWantedId.  How do I set this up?  Here is what I have thus far:

Here is the XML

<xs:element name="ExchangeWantedItemsMeToodUsers">
<xs:complexType>
- <xs:sequence>
  <xs:element name="ExchangeWantedId" type="xs:int" minOccurs="0" />
  <xs:element name="ExchangeWantedName" type="xs:string" minOccurs="0" />
  <xs:element name="MeTooer" type="xs:string" minOccurs="0" />
  <xs:element name="MeTooerBankName" type="xs:string" minOccurs="0" />
  <xs:element name="DateFulfilled" type="xs:string" minOccurs="0" />
  <xs:element name="DateFulfilledUnformated" type="xs:dateTime" minOccurs="0" />
  <xs:element name="UserID" type="xs:int" minOccurs="0" />
  <xs:element name="FullName" type="xs:string" minOccurs="0" />
  <xs:element name="PostedBankName" type="xs:string" minOccurs="0" />
  </xs:sequence>
  </xs:complexType>
  </xs:element>
- <xs:element name="ExchangeWantedItemsMeToodUsers1">
- <xs:complexType>
- <xs:sequence>
  <xs:element name="ExchangeWantedID" type="xs:int" minOccurs="0" />
  <xs:element name="DisplayName" type="xs:string" minOccurs="0" />
  <xs:element name="FullName" type="xs:string" minOccurs="0" />
  </xs:sequence>
  </xs:complexType>
  </xs:element>
Here is the xsl

<xsl:for-each select="/root/ExchangeWantedItemsMeToodUsers">                
    <tr>
        <xsl:call-template name="AlternateRowColor" />
        <td><xsl:value-of select="ExchangeWantedName" /></td>
        <td>
            <xsl:for-each select="/root/ExchangeWantedItemsMeToodUsers">
                <xsl:value-of select="MeTooer" /> - <xsl:value-of
                                                    select="MeTooerBankName" />
            </xsl:for-each>
        </td>
        <td><xsl:value-of select="FullName" /> - <xsl:value-of
                                                select="PostedBankName" /></td>
        <td><xsl:value-of select="DateFulfilled" /></td>
    </tr>
</xsl:for-each>
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of EE_AutoDeleter
EE_AutoDeleter

I've requested that this question be deleted for the following reason:

                           
No comment has been added to this question in more than 21 days, so it is now classified as abandoned and is now flagged for deletion.


If there is a valid solution, please OBJECT and indicate the comments that are, or would otherwise lead to, a solution.


Use the specific format https:#axxxxxxxx for comment ID(s).


Also, please don't object simply because the author did not respond to your comment. While we understand this is frustrating, unfortunately we cannot force the author to return to the question. Unless you feel you have presented a valid, verifiable solution we'll simply delete the question.


Experts-Exchange Auto Deleter
https:#a34931805 contains an general good advice above selectivity in apply templates / for-each AND it contains an important suggestion about inner context of a for-each loop, something a lot of XSLT beginners struggle with

Please accept that comment as an answer