我需要过滤一些重复的节点中的操作(在一个键上)以下是我的数据文件。
数据.xml
<root>
    <node name="item1" />
    <node name="item2" />
    <node name="item3" />
    <node name="item4" />
</root>
在文件 item1.xml
<item>
 <group>A</group>
</item>
item2.xml
<item>
 <group>B</group>
</item>
item3.xml
<item>
 <group>B</group>
</item>
item4.xml
<item>
 <group>D</group>
</item>
XSLT 文件
<xsl:for-each select="/root/node">
     <xsl:variable name="itemName"   select="@name"/>
     <xsl:variable name="groupName"  select="document($itemName)/item/group"/>
     <xsl:value-of select="concat('Group ',$groupName)"/>
</xsl:for-each>   
输出
A组 B组 B组 C组
期望的输出
A组 B组 C组
这里第 2 项和第 3 项根据它们的组属性属于同一组,所以我只需要打印其中任何一个的组名。