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

variables numbers and apply templates

Subject: variables numbers and apply templates
From: Gerrit Kuilder <gkuilder@xxxxxxxxxxxx>
Date: Wed, 24 Oct 2001 19:10:50 +0200
numbers templates
Hi All,

this has kept me busy for an hour or two, have found a solution but I would like to find out what I ran into.

I wrote a recursive template which I pass as a parameter,  a number

<xsl:template match="sect1|sect2|sect3|sect4|sect5" mode="createtoc">
  <xsl:param name = "TocLevel" />
  <xsl:variable name="CurrLevel">toclevel<xsl:value-of select="$TocLevel></xsl:variable>
  <xsl:variable name="NextElement" select="concat('sect',$TocLevel+1)"/>
 <xsl:element name="{$CurrLevel}">
<xsl:if test="$NextElement">
<xsl:apply-templates select="*[name()=$NextElement]" mode="createtoc">
        <xsl:with-param name = "TocLevel"  select="$TocLevel+1"/>
    </xsl:apply-templates>
  </xsl:if>
  </xsl:element>

Two things I cant'do
a) <xsl:if test="count($NextElement)>0">
b) <xsl:apply-templates select="$NextElement" mode="createtoc">

I have no idea why I get errors when I try the above
if $NextElement would have been only characters :'secttwo' I would have no problem doing the above.

if I declare the varaible as   <xsl:variable name="NextElement" select="sect2"/> it is ok too
I could read out the values with value-of select='$NextElement'

I played around with both versions of declaring the variable  to no avail.

Wondering minds need to know....

Regards

Gerrit


 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.