Re: format date

Stephane Bortzmeyer <[email protected]>
Newsgroups gmane.text.xml.french.tech
Message-ID <[email protected]>
On Wed, May 03, 2006 at 10:13:38PM +0200,
 IGP04Bozghiba Imed <[email protected]> wrote 
 a message of 97 lines which said:

> Alors j'ai pensé de créer une fonction pour transformer les date en
> format américain mais ça ne marche pas.

En XSLT 1.0 portable, je ne crois pas qu'il existe une solution
simple. La plus standard est d'utiliser EXSLT (http://exslt.org/), un
ensemble d'extensions mises en oeuvre dans de nombreux processeurs
XSLT.

J'utilise date:format-date pour formater mes dates. EXSLT en fournit
une implémentation en XSLT, pour les processeurs qui ne la gèrent pas
nativement. Cela me permet d'écrire des choses comme :

<xsl:template name="print-date">
   <xsl:param name="date"/>
   <xsl:call-template name="date:format-date">
     <xsl:with-param name="date-time" select="$date" />
     <xsl:with-param name="pattern" select="'dd MMMM yyyy'" />
   </xsl:call-template>
</xsl:template>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.