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

Referencing nodes from an out-of-scope xsl:for-each lo

Subject: Referencing nodes from an out-of-scope xsl:for-each loop
From: "Joel P Thornton" <joelt@xxxxxxxxxxxxx>
Date: Thu, 17 May 2001 13:59:18 -0700
xsl for each scope
I have this xml:

--
<sql-recordset>
  <row title="Sunshine Home" location="Seattle WA"/>
  <row title="Value Village" location="Seattle WA"/>
  <row title="Salvation Army" location="Tacoma WA"/>

  <display-columns>
    <column label="Name"><B><sql-field name="title"/></B></column>
    <column label="Location"><sql-field name="location"/></column>
  </display-columns>
</sql-recordset>
--

And I want to write an XSL which will transform this into:


--
<table>
  <th>Name</th>
  <th>Location</th>

  <tr>
    <td><b>Sunshine Home</b></td><td>Seattle WA</td>
  </tr>

  <tr>
    <td><b>Value Village</b></td><td>Seattle WA</td>
  </tr>

  <tr>
    <td><b>Salvation Army</b></td><td>Tacoma WA</td>
  </tr>
</table>
--


Currently, I <xsl:for-each> through the collection of <row> nodes, and then
<xsl:for-each> through each of the <column>s for each row.  The problem is,
I have a <xsl:template match="sql-field"> template which matches the
<sql-field> tags within the <column> tags.  But I don't know how to get that
template to "know" which row it is currently on.  I tried using
<xsl:variable> but I'm being told that, within the sql-field template, the
variable is out of scope.

Ideas?

joel


 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.