🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: select "distinct"

#8351
From: Thomas Broyer
Date: Thu, 22 Nov 2001 17:17
31 lines
2153 bytes
In <800a6323.0111220855.372a6904@posting.google.com>, Joseph Vallot wrote:
> encore un probl�me d'apply-templates de noeuds tri�s.
> en fait, je voudrais faire un truc du genre
> 
> <xsl:apply-templates select="sub/path">
>   <xsl:sort select="@name"/>
> </xsl:apply-templates>
> 
> le probl�me �tant que le "select" retourne plusieurs homonymes
> potentiels, et que je n'en veux qu'un... bref, je voudrais un select
> distinct(@name), en gros.
> 
> et je n'y arrive pas :(

Jette un oeil � EXSLT <http://exslt.org> et plus particuli�rement 
set:distinct. Il existe une impl�mentation en "100% XSLT". Jeni Tennisson 
expliquait aujourd'hui m�me sur la mailing-list (archives dispo en ligne) 
comment l'utiliser.

Si tu utilises un processeur qui impl�mente la fonction en "natif" (SAXON, 
LibXSLT/xsltproc, 4XSLT, entre autres), tu pourras utiliser (plus court et 
plus lisible):
  <xsl:apply-templates select="set:distinct(sub/path/@name)/..">
    <xsl:sort select="@name" />
  </xsl:apply-templates>

> j'ai aussi essay� de filtrer lors du "match":

� mon avis c'est toujours plus propre de filtrer sur la s�lection.

Tom.
Technical Details
Message-ID: <1865154.mLvFx2qVVI@ltgt.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!proxad.net!feeder2-1.proxad.net!news1-1.free.fr!not-for-mail
References: <800a6323.0111220855.372a6904@posting.google.com>

Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII
X-Google-Thread: 114f60,f5a5cba655272ca0
X-Google-Attributes: gid114f60,public
X-Google-ArrivalTime: 2001-11-22 09:22:34 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!proxad.net!feeder2-1.proxad.net!news1-1.free.fr!not-for-mail
Message-ID: <1865154.mLvFx2qVVI@ltgt.net>
From: Thomas Broyer <tbroyer@domain.tld.invalid>
Subject: Re: select "distinct"
Newsgroups: fr.comp.text.xml
Reply-To: tbroyer-usenet@ltgt.net
Mail-Copies-To: nobody
Date: Thu, 22 Nov 2001 18:17:58 +0100
References: <800a6323.0111220855.372a6904@posting.google.com>
Organization: </>
User-Agent: KNode/0.6.1
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: 8Bit
Lines: 31
NNTP-Posting-Date: 22 Nov 2001 18:10:00 MET
NNTP-Posting-Host: 193.252.183.125
X-Trace: 1006449000 news1-1.free.fr 15819 193.252.183.125
X-Complaints-To: abuse@proxad.net