Bonjour, j’ai un p’tit souci de transformation XSL.
voici mon xml
.....
<clients>
<nomClient>cli1</nomClient>
<nomClient>cli3</nomClient>
<nomClient>cli2</nomClient>
</clients>
<clients>
<nomClient>cli3</nomClient>
<nomClient>cli2</nomClient>
</clients>
Dans mon xsl, je tri par nom client puis jeu veux les regroouper par client.
<xsl:for-each select="current()[clients/nomClient=\'cli1\']">
<li class="commande">
<xsl:attribute name="id">c<xsl:value-of select="idArticle"/></xsl:attribute>
<span class="client"><xsl:value-of select="clients/nomClient"/></span>
<span class="priorite"><xsl:value-of select="priorite"/></span>
<span class="titre"><xsl:value-of select="titre"/></span>
<span class="source"><xsl:value-of select="source"/></span>
<span class="date"><xsl:value-of select="dateArticle"/></span>
</li>
</xsl:for-each>
<xsl:for-each select="current()[clients/nomClient=\'cli2\']">
<li class="commande">
<xsl:attribute name="id">c<xsl:value-of select="idArticle"/></xsl:attribute>
<span class="client"><xsl:value-of select="clients/nomClient"/></span>
<span class="priorite"><xsl:value-of select="priorite"/></span>
<span class="titre"><xsl:value-of select="titre"/></span>
<span class="source"><xsl:value-of select="source"/></span>
<span class="date"><xsl:value-of select="dateArticle"/></span>
</li>
</xsl:for-each>
....
le problème est que par exemple, si j’ai plusieur nomclient, je ne prend en compte que le 1er… du coup, dans mon exemple le cli2 n’est jamais affiché puisqu’il ne se trouve jamais en 1er position…
j’ai essayé de mettre des <xsl:for-each select=“current()[clients/nomClient[1 ou 2 ou last etc…]=\‘cli2\’]”> sans succes
qq’un a une idée? merci