-1

我有一个serviceProvideList包含字符串值的变量。

我使用以下代码分别获取每个字符串:

<xsl:variable name="tokenizedSample" select="str:tokenize($serviceProvideList,'&#xa;')"/>

<xsl:for-each select="$tokenizedSample">
  <xsl:variable name="weakProvide" select="."/>
  <xsl:variable name="tokenized" select="str:tokenize($weakProvide,' ')"/>

  <xsl:for-each select="$tokenized">
    <xsl:variable name="weakP" select="."/>
    <xsl:value-of select="$weakP"/> 
  </xsl:for-each>
</xsl:for-each>

如何避免变量中的重复值serviceProvideList

4

1 回答 1

1

for-each从循环中排除前面具有相同值的标记:

<xsl:for-each select="$tokenizedSample[ not(preceding-sibling::* = .) ]">
于 2011-05-19T15:12:21.767 回答