Re: Number of node in list from stylesheet

Subject: Re: Number of node in list from stylesheet
From: Sebastian Rahtz <sebastian.rahtz@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 23 May 2000 12:41:47 +0100 (BST)
Jeni Tennison writes:
 > number, so January = 01, May = 05 and so on.  So I defined the months in
 > order within the stylesheet itself:
 > 
 > <foo:months>
 >   <foo:month name="January" abbr="Jan" />
 >   <foo:month name="February" abbr="Feb" />

wouldn't it be easier to just say

<foo:month name="February" abbr="Feb" number="02"/>

and have done with it?
 >   <xsl:variable name="monthNumber">
 >     <xsl:for-each select="document('')//foo:month[@name = $monthName]">
 >       <xsl:value-of select="format-number(position(), '00')" />
 >     </xsl:for-each>
 >   </xsl:variable>
 > 
 > always sets $monthNumber = 1.

naturally. you select a single node, so it is always #1 in resulting
list

Sebastian


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


Current Thread