开发者

how to avoid getting repeated strings from string variable?

I have a variable servicePro开发者_开发百科videList that contains string values.

I use following code to get each string separately:

<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>

How can I avoid repeating values in the variable serviceProvideList?


Exclude tokens, which have precedings with same value, from for-each loop :

<xsl:for-each select="$tokenizedSample[ not(preceding-sibling::* = .) ]">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜