[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: "Juergen Hermann" <jhe@xxxxxxxxxxx>
Date: Tue, 23 May 2000 14:29:31 +0100
number of node in bst
On Tue, 23 May 2000 12:24:41 +0100, Jeni Tennison wrote:

>Within the stylesheet, I needed to convert a month's name into a month
>number, so January = 01, May = 05 and so on.  So I defined the months in
>order within the stylesheet itself:

Here's a working solution, define this within <xsl:stylesheet> (i.e. on the
top level):

  <xsl:variable name="months">
    <month name="January">01</month>
    <month name="February">02</month>
    <month name="March">03</month>
    <month name="April">04</month>
    <month name="May">05</month>
    <month name="June">06</month>
    <month name="July">07</month>
    <month name="August">08</month>
    <month name="September">09</month>
    <month name="October">10</month>
    <month name="November">11</month>
    <month name="December">12</month>
  </xsl:variable>

Later, in a template (assuming the month name is in $month):

  <xsl:value-of select="$months[@name=$month]"/>


Ciao, Jürgen

--
Jürgen Hermann (jhe@xxxxxxxxxxx)
WEB.DE AG, Amalienbadstr.41, D-76227 Karlsruhe
Tel.: 0721/94329-0, Fax: 0721/94329-22



 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.