From: Eric van der Vlist (vdv@dyomedea.com)
Date: 07/05/2001 - 09:52
Jean-Charles Preaux wrote:
>
> Bonjour ;
> Voici mon souci matinal...
> j'ai un element du type :
>
> <!-- ################################### -->
> <date date-format="DD-MM-YYYY-hh:mm:ss">
> 3-08-2000-16:13:44
> </date>
> <!-- ################################### -->
>
> et je voudrais selectionner seulement la date (jour-mois-annee).
> Quelqu'un pourrait il m'aider dans cette mission
Le nombre de chiffres de vos champs ne semble pas constant et on ne peut
donc pas utiliser la fonction substring [1]...
Il faut donc se retourner sur substring-before [2] et substring-after
[3] et écrire une expression XPath du type:
concat(
substring-before(date, '-'),
'-',
substring-before(substring-after(date, '-'), '-')
'-',
substring-before(substring-after(substring-after(date, '-'), '-'), '-')
)
C'est laborieux, mais cela devrait marcher ;=) ...
Eric van der Vlist
[1] http://xmlfr.org/w3c/TR/xpath/#function-substring
[2] http://xmlfr.org/w3c/TR/xpath/#function-substring-before
[3] http://xmlfr.org/w3c/TR/xpath/#function-substring-after
> Amicalement
> Jean-Charles Preaux
> mailto://jcp@alternative-advice.com
--
See you in Berlin for XML Europe 2001:
http://gca.org/attend/2001_conferences/europe_2001/tutorialsmon.htm
------------------------------------------------------------------------
Eric van der Vlist http://xmlfr.org http://dyomedea.com
http://xsltunit.org http://4xt.org http://examplotron.org
------------------------------------------------------------------------
--
Devenez redacteur <XML>fr et contribuez au developpement du
xml francophone (http://xmlfr.org/infos/redacteurs/) !
Liste de diffusion "xml-tech@xmlfr.org" (http://xmlfr.org).
Cette liste est a votre disposition pour discuter en francais de
tout sujet technique lie a XML.
Pour resilier votre abonnement, envoyez un message contenant
la commande "unsubscribe" a xml-tech-request@xmlfr.org
(mailto:xml-tech-request@xmlfr.org?Subject=unsubscribe)
Archive générée par hypermail 2.1.3 le 28/06/2004 - 11:06 UTC
webmaster@xmlfr.org
|