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,'
')"/>
<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::* = .) ]">
精彩评论