🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.text.xml
Article #8251

Re: Manipulation de chaines de caract�res

#8251
From: Pierre-Charles David
Date: Fri, 30 Nov 2001 08:52
25 lines
2052 bytes
>>>>> "Sandrine" == Sandrine  <sandrine.pilon@mcc-soft.com> writes:

    Sandrine> Bonjour, Comment faire pour manipuler la chaine de car.
    Sandrine> suivante en XSLT : Il s'agit d'une date format
    Sandrine> anglophone : YYYY/MM/DD que je dois transformer en
    Sandrine> DD/MM/YYYY.

Premi�re solution, "� la main": Utilises les fonctions
substring(chaine, indice_debut, taille) et concat(chaine1, chaine2...)
pour extraire les sous-cha�nes qui t'int�ressent, puis reconstruire la
cha�ne finale. Je n'ai pas test�, mais en supposant que le noeud
courant (.) soit la cha�ne � convertir, �a doit ressembler � �a:

<xsl:value-of select="concat(substring(., 9, 2), '/',
                             substring(., 6, 2), '/',
                             substring(., 1, 4))" />

Sinon, EXSLT (www.exslt.org) inclue un certain nombre de fonctions
pour g�rer les dates. Il y en a probablement une qui fait �a. Il y a
aussi http://xsltsl.sourceforge.net/.

-- 
Pierre-Charles David (pcdavid <at> emn <dot> fr)
Computer Science PhD Student, �cole des Mines de Nantes, France
Homepage: http://purl.org/net/home/pcdavid
Technical Details
Message-ID: <83pu60bpz4.fsf@kluane.info.emn.fr>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!isdnet!enst!univ-angers.fr!univ-rennes1.fr!irisa.fr!news.emn.fr!not-for-mail
References: <3C05F28E.B65446A2@mcc-soft.com>

Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII
X-Google-Thread: 114f60,dec7c19c4f69e1cd
X-Google-Attributes: gid114f60,public
X-Google-ArrivalTime: 2001-11-30 01:29:05 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!isdnet!enst!univ-angers.fr!univ-rennes1.fr!irisa.fr!news.emn.fr!not-for-mail
From: Pierre-Charles David <Pierre-Charles.David@emn.fr>
Newsgroups: fr.comp.text.xml
Subject: Re: Manipulation de chaines de caract�res
Date: 30 Nov 2001 09:52:15 +0100
Organization: �cole des Mines de Nantes
Lines: 25
Message-ID: <83pu60bpz4.fsf@kluane.info.emn.fr>
References: <3C05F28E.B65446A2@mcc-soft.com>
NNTP-Posting-Host: dhcp71.info.emn.fr
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1