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

Using a parameter in a select within a recursive templ

Subject: Using a parameter in a select within a recursive template
From: Sean & Helen <scarlson65@xxxxxxx>
Date: Sat, 18 Sep 2004 23:29:38 -0600
select recursive
Hi everyone,
I am attempting to use a parameter within a recursive template to select a
different node whenever the template loops.

My datafile looks something like this:

<FIELD_1>
<FIELD_2>
<FIELD_3>
<FIELD_4>
<FIELD_5>
...
<FIELD_142>

I would like to loop through and use the incremented parameter to select the
contents of the node. So far I have been trying to use this template:

<xsl:template name="adddata">
     <xsl:param name="number" select="141" />
     <xsl:param name="cols" select="19" />

     <xsl:choose>
     <xsl:when test="$number &lt;= $cols">
        <xsl:value-of select="cols"/>
     </xsl:when>
     <xsl:otherwise>
        <xsl:call-template name="adddata">
         <xsl:with-param name="number" select="$number - 1"/>
         <xsl:with-param name="cols" select="$cols" />
        </xsl:call-template>
           <fo:table-cell >
               <fo:block><xsl:value-of select="concat('FIELD_',$number)"
/></fo:block>
          </fo:table-cell>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

However, the output gives me:
FIELD_1 FIELD_2 FIELD_3 etc....
rather than the data contained within these nodes. Can someone shed some
light for me?

TIA,
Helen.

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.