我有一个 xsl:when 显示:
- 类别
- 图片
我想要的是显示所有图像,但只在它们上方显示一次类别名称,因为它们对于该图像集都是相同的。
问:我该如何做到这一点?
<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>