<xsl:for-each select="/OFFRES-EMPLOI/OFFRE-EMPLOI">
<xsl:sort select="DEPARTEMENT"/>
<xsl:variable name="titre-dep"><xsl:value-of select="DEPARTEMENT"/></xsl:variable>
<xsl:choose>
<xsl:when test="preceding-sibling:: DEPARTEMENT/TITRE[position()=position()-1] != ''">
<xsl:if test="$titre-dep != preceding-sibling:: DEPARTEMENT/TITRE[position()=position()-1]">
<h3><xsl:value-of select="DEPARTEMENT"/>---<xsl:value-of select="preceding-sibling:: DEPARTEMENT/TITRE[position()=position()-1]"/></h3>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<h3><xsl:value-of select="DEPARTEMENT"/></h3>
</xsl:otherwise>
</xsl:choose>
<ul>
<li><xsl:element name="a"><xsl:attribute name="href">offres-emploi.jsp?idposte=<xsl:value-of select="@ID"/></xsl:attribute><xsl:value-of select="TITRE"/></xsl:element> — <xsl:value-of select="LIEU"/>
<xsl:if test="@PROLONGATION = 'true'"> (prolongation)</xsl:if></li>
</ul>
</xsl:for-each>
Partager