for eachループ内のテキストをxsltで、別のCSSクラスを使用してどのように表示できますか?どういうわけか、いくつかの変数や何かに基づいてCSSクラスの名前を生成できますか?出来ますか? たとえば、foreachループ内の次のコードでは、最初の繰り返しliクラス= "1" ... second second iteartion li class = "2"など、毎回異なるCSSクラスのliを表示できますか? CSSで明らかにli.1 {...}を存在..and、li.2 {...}xslのfor-eachで異なるCSSクラスを使用
<xsl:output method="text" indent="no"/>
<xsl:variable name="newline">
<xsl:text>
</xsl:text>
</xsl:variable>
<xsl:template match="/">
<xsl:text>Collections of books</xsl:text>
<xsl:value-of select="$newline"/>
<xsl:variable name="index" select="0"/>
<xsl:for-each select="collection/book">
<xsl:sort select="category"/>
<xsl:variable name="lastCat" select="category"/>
<xsl:if test="not(preceding-sibling::book[category=$lastCat])">
<xsl:value-of select="$newline"/>
<xsl:value-of select="category"/>
<xsl:value-of select="$newline"/>
<xsl:value-of select="$newline"/>
</xsl:if>
<ul>
<li>
<xsl:value-of select="title"/>
<xsl:text> </xsl:text>
<xsl:value-of select="author"/>
<xsl:text> </xsl:text>
<xsl:value-of select="year"/>
<xsl:text> </xsl:text>
<xsl:value-of select="isbn"/>
</li>
</ul>
<xsl:value-of select="$newline"/>
</xsl:for-each>
</xsl:template>
何ですか?あなたはもっと具体的になりますか?おそらく、望ましい出力の例を表示するでしょうか? –