根据您提供的信息,您可以尝试以下方法: XSLT 1.0 的解决方案可以通过以下方式尝试:使用 Muenchian Grouping 将 xml 中的唯一 Location_ID 组合在一起,并使用已经可用的唯一 Location_ID 迭代原始 xml查找与特定 Location_ID 关联的 Region_Ref_ID 的列表。
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wd="urn:com.workday/bsvc">
<xsl:output method="text"/>
<xsl:key name="uniqueLocation" match="wd:Report_Entry" use="wd:Location_ID"/>
<xsl:template match="/">
<!--variable called data is the variable that contains your xml-->
<xsl:variable name="uniqueLocationData" select="$data/wd:Report_Data/wd:Report_Entry[count(.|key('uniqueLocation',wd:Location_ID)[1])=1]"/>
<xsl:for-each select="$data/wd:Report_Data/wd:Report_Entry/wd:Region_Ref_ID[$data/wd:Report_Data/wd:Report_Entry/wd:Location_ID=$uniqueLocationData/wd:Location_ID]">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>