下面的XML和xsl按预期选择项目但产生重复我的问题是如果有任何具有相同名称的类别,如何删除重复项?
XML
<div><b>Departments:</b>Supevisor</div>
<div><b>Location:</b> <a >Treausry</a></div>
<div><b>Cat:</b> <a >Trials</a></div>
<div><b>Months:</b></div>
</Documents>
<Documents>
<div><b>Departments:</b>Supevisor</div>
<div><b>Location:</b> <a >Treausry</a></div>
<div><b>Cat:</b> <a >Best</a></div>
<div><b>Months:</b></div>
</Documents>
<Documents>
<div><b>Departments:</b>News Week</div>
<div><b>Location:</b> <a >Treausry</a></div>
<div><b>Cat:</b> <a >Test 2</a></div>
<div><b>Months:</b></div>
</Documents>
<Documents>
<div><b>Departments:</b>Senior</div>
<div><b>Location:</b> <a >Banking</a></div>
<div><b>Cat:</b> <a >Trials</a></div>
<div><b>Months:</b></div>
</Documents>
XSL正在使用
<xsl:for-each select="$Rows">
<xsl:sort select="@Cat" order="ascending"></xsl:sort>
<xsl:if test="@Store != '' and @Location != ''">
<li>
<xsl:choose>
<xsl:when test="contains($PageUrl,concat('Store=',@Store, '&','Location=',@Location, '&', 'Months=',@Months))">
<div>
<a href="{concat('#tabs-',@ID)}">
<xsl:value-of select="self::*/@Cat"></xsl:value-of>
</a>
</div>
</xsl:when>
</xsl:choose>
</li>
</xsl:if>
</xsl:for-each>
立即输出
<documents>
Supervisor
Treasury
Supervisor
Best
News Week
Treasury
Senior
Treasury
预期产出
<documents>
Supervisor
Treasury
Best
News Week
Treasury
Senior
Treasury
由于