Re: [xsl] Outer Loop and Inner Loop

Subject: Re: [xsl] Outer Loop and Inner Loop
From: david_n_bertoni@xxxxxxxxxx
Date: Thu, 1 May 2003 11:43:27 -0700

> Q> I have a matched template node, within this template I loop through an
> entirely different document source (if you've been following along,
> be familiar with xmTmplt).  For each node in $xmTmplt/FLD I need to look
> an attribute in the original template match.  This is where I get lost,
> because I'm not sure of my current context, so not sure how to get values
> from the "original" context.  Here is what I've got:
> <xsl:template match="rs:data/z:row">
>     <tr>
>     <xsl:for-each select="$xmTmplt/FLD">
>          <td>
>          <xsl:value-of select="@name
>          </td>
>     </xsl:for-each>
>     </tr>
> </xsl:template>

I believe I already answered this in my previous post.  Assuming the z:row
element has an attribute called name with the value you want to match:

<xsl:template match="rs:data/z:row">
  <xsl:variable name="outerCurrent" select="current()" />
    <xsl:for-each select="$xmTmplt/FLD">
         <xsl:value-of select="@name[. = $outerCurrent/@name]"/>


 XSL-List info and archive:

Current Thread