From: Sandrine Cordonnier (scordonnier@silicom.fr)
Date: 14/05/2003 - 14:03
J'ai déjà eu besoin de faire quelque chose comme ça, et j'ai utilisé xsl:key
<xsl:key name="C-by-node" match="B" use=".//C" />
<xsl:template match="A">
<html>
<xsl:for-each select="B[generate-id(.) = generate-id(key(C-by-node',
.//C)[1] )]">
<xsl:value-of select="C"/>
</xsl:for-each>
Avec ça, tu ne devrais pas afficher un type que tu as déjà affiché.
Sandrine
>
> Voici mon fichier xml a transformer:
>
> <A>
> <B>
> <C>type1</C>
> </B>
> <B>
> <C>type2</C>
> </B>
> <B>
> <C>type3</C>
> </B>
> <B>
> <C>type2</C>
> </B>
> <B>
> <C>type1</C>
> </B>
> <B>
> <C>type...N</C>
> </B>
> </A>
>
> Et je voudrais obtenir uniquement les types non redondants dans une
> table. Tous les types existants en fait. Sans connaitre au prealable les
> differents types...
>
> -> <row>type1</row>
> <row>type2</row>
> <row>type3</row>
> <row>type...N</row>
>
> Comment faire? D'avance merci!
>
> Guillaume
> --
> 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)
--
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
|