[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Outer Loop and Inner Loop

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



> Q> I have a matched template node, within this template I loop through an
> entirely different document source (if you've been following along,
you'll
> be familiar with xmTmplt).  For each node in $xmTmplt/FLD I need to look
up
> 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
> {{AND_MATCH_TO_OUTER_TEMPLATE_CONTEXT}}"/>
>          </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()" />
    <tr>
    <xsl:for-each select="$xmTmplt/FLD">
         <td>
         <xsl:value-of select="@name[. = $outerCurrent/@name]"/>
         </td>
    </xsl:for-each>
    </tr>
</xsl:template>

Dave


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.