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

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)
mailing list sebastian
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

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.