Re: [xsl] date formatting function

Subject: Re: [xsl] date formatting function
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Sat, 25 Sep 2004 18:43:49 -0400
On Sep 25, 2004, at 5:30 PM, Michael Kay wrote:

Your code only seems to be handling English.

Right, but that will change.


Obviously if you write your own formatting you can make it more flexible but it's more code to write and test.

It sounds like you're saying that I need to write it anyway if I want to support anything other than English and German?


If that's the case, it seems like perhaps the substring approach might be better for this context (where my dates aren't always of YYYY-MM-Dd form)?

A minor observation, you could write this much more consisely and
efficiently as

<xsl:variable name="month-part"
              select="('January', 'February', 'March', ...)
                            [xs:int(substring(current(),6,2)]"/>

Thanks.


Bruce

Current Thread