Retourner au contenu associé (entrée de forum : Soucis xslt...)
Posté par Frédéric Desmoulins (site web personnel) le 20 octobre 2004 à 14:53. En réponse au message Soucis xslt.... Évalué à 0.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
# Une solution
Posté par Frédéric Desmoulins (site web personnel) . En réponse au message Soucis xslt.... Évalué à 0.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform(...)">
<xsl:template match="/">
<xsl:for-each select="/personnes/personne">
<xsl:sort select="@nom" />
<xsl:variable name="currentLetter" select="substring(@nom, 1, 1)" />
<xsl:variable name="thisNode" select="." />
<xsl:for-each select="/personnes/personne[starts-with(@nom, $currentLetter)][1]">
<xsl:sort select="@nom" />
<xsl:if test="generate-id(.)=generate-id($thisNode)">
<h1><xsl:value-of select="$currentLetter" /></h1>
</xsl:if>
</xsl:for-each>
<p><xsl:value-of select="@nom" /></p>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>