XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
(Deleted User) 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


DocumentNoname(18).

Postnext
Minollo I.Subject: Faire un trie selon un nœud en XSLT
Author: Minollo I.
Date: 22 Mar 2006 11:40 AM
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

Posttop
(Deleted User) 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
>
>


--
Sonia LAJMI
Master recherche informatique
INSA de Lyon
Batiment Blaise Pascal
tel.:04 37 48 18 71
Por.:06 19 83 36 02

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.