Subject:Faire un trie selon un nœud en XSLT Author:(Deleted User) Date:22 Mar 2006 10:51 AM
Bonjour,
j'ai le XML sui a la skolette suivante:
<searchs>
<search>
<username>..................</username>
<keywords>
<keyword>....</keyword>
<keyword>....</keyword>
.
.
.
</keywords>
</search>
.
.
.
</searchs>
j'ai fait un XSLT qui me permet d'afficher un tableau en html qui continet pour chaque recherche une ligne contenant un utilisateur et ses keywods
je voulais trier ces resultats en fontion de la longeur de ces keywords(combient de noeuf fils direct elle contient
<xsl:template match="searchs">
<xsl:for-each select="search">
<xsl:sort select="compteur_key" type-data="nomber" order="descending"/>
<tr>
<td><xsl:value-of select="username"/></td>
<xsl:variable name="compteur_key" select="count(keywords/keyword")"/>
<td><xsl:apply-templates select="keywords/keyword"/></td>
</xsl:for-each>
.
.
.
</xsl:template>
le trie ne fonctionne pas SVP aidez moi c'est tres urgent
merci d'avance
Subject:Re: Faire un trie selon un nud en XSLT Author:(Deleted User) Date:22 Mar 2006 12:33 PM
think you a lot Minollo
yes its true now
bye bye
Selon stylus-studio-xslt Listmanager :
> From: Minollo I.
>
> I guess you should change your for loop to:
>
> <xsl:template match="searchs">
> <xsl:for-each select="search">
> <xsl:sort select="count(keywords/keyword)" data-type="number"
> order="descending"/>
> <tr>
> <td><xsl:value-of select="username"/></td>
> <td><xsl:apply-templates select="keywords/keyword"/></td>
> </xsl:for-each>
>
> ...but I'm not sure my poor understanding of French is helping me here...
> Minollo
>
>
> --
> To reply: mailto:stylus-studio-xslt.14354@stylusstudio.com
> To start a new topic: mailto:stylus-studio-xslt@stylusstudio.com
> To login: http://www.stylusstudio.com/SSDN/
> To (un)subscribe: mailto:stylus-studio-xslt.list-request@stylusstudio.com
>
>