Article View: fr.comp.text.xml
Article #9014[XSLT] tris et ruptures
From: Rapha�l THERY
Date: Fri, 22 Jun 2001 09:40
Date: Fri, 22 Jun 2001 09:40
41 lines
2229 bytes
2229 bytes
Bonjour, puis-je vous soumettre mon petit casse t�te ?? oui je pense que
oui;
Soit le xml suivant
<xxx>
<yyy nom="..." type=".."/>
<yyy nom="..." type=".."/>
....
<yyy nom="..." type=".."/>
</xxx>
je souhaite afficher l'ensemble des noeuds yyy tri�s par type puis par nom
je construit donc la feuille de styles suivante :
<xsl:template match="xxx">
<html>
<xsl:apply-templates select="yyy">
<xsl:sort select="@type" order="ascending" />
<xsl:sort select="@nom" order="ascending" />
</xsl:apply-templates>
</html>
</xsl:template>
<xsl:template match="yyy">
<xsl:value-of select="@nom" /> - <xsl:value-of select="@type" /><br/>
</xsl:template>
Le probl�me c'est qu'� chaque changement de type je souhaite faire une
rupture ... et c'est �a que je n'arrive
pas � faire fonctionner. le pr�c�dent est pour lui toujours le m�me.
<xsl:template match="yyy">
<xsl:if test="not(preceding-sibling::yyy[@type = current()/@type])">
<h1><xsl:value-of select="@type" /></h1>
</xsl:if>
<xsl:value-of select="@nom" /> - <xsl:value-of select="@type" /><br/>
</xsl:template>
d'avance merci.
Rapha�l
Technical Details
Message-ID:
<RnEY6.1071$wi7.625807@nnrp6.proxad.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeed1.bredband.com!bredband!news000.worldonline.se!fr.clara.net!heighliner.fr.clara.net!proxad.net!feeder2-1.proxad.net!nnrp6.proxad.net.POSTED!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII X-Google-Thread: 114f60,689cfa80abbd4d0f,start X-Google-Attributes: gid114f60,public X-Google-ArrivalTime: 2001-06-22 02:40:03 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeed1.bredband.com!bredband!news000.worldonline.se!fr.clara.net!heighliner.fr.clara.net!proxad.net!feeder2-1.proxad.net!nnrp6.proxad.net.POSTED!not-for-mail From: "Rapha�l THERY" <raphael.thery@free.fr> Newsgroups: fr.comp.text.xml Subject: [XSLT] tris et ruptures Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Message-ID: <RnEY6.1071$wi7.625807@nnrp6.proxad.net> Date: Fri, 22 Jun 2001 09:40:01 GMT NNTP-Posting-Host: 195.115.154.77 X-Complaints-To: abuse@proxad.net X-Trace: nnrp6.proxad.net 993202801 195.115.154.77 (Fri, 22 Jun 2001 11:40:01 CEST) NNTP-Posting-Date: Fri, 22 Jun 2001 11:40:01 CEST Organization: Guest of ProXad - France