私はxslを持っています:それが表示されるとき:
- カテゴリ
- 画像
私が欲しいのは、すべての画像を表示することですが、それらはその画像セットですべて同じであるため、それらの上に1回だけカテゴリ名を表示します。
Q:これを達成するにはどうすればよいですか?
<xsl:for-each select="/data/commissions/entry">
<xsl:variable name="category-path" select="commission-category"/>
<xsl:for-each select="imageset/item">
<xsl:variable name="image-path" select="image/filename"/>
<li>
<!-- this is the category name -->
<xsl:value-of select="$name-path" />
<!-- this is the photo -->
<img src="{$image-path}" alt="" />
</li>
</xsl:for-each>