[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Number of node in list from stylesheet
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|