重複する要素を取り除く
Posted feedbacks - XSLT
selector ([]) が sequenceに対しても使えるので楽ですね。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
>
<xsl:output method="text" />
<xsl:template match="/" >
<xsl:variable name="seq" as="xs:integer*"
select="(3,1,4,1,5,9,2,6,5)" />
<xsl:value-of
select="$seq[fn:count(fn:index-of($seq,.))=1]" />
</xsl:template>
</xsl:stylesheet>
|

にしお
#3412()
Rating1/1=1.00
これはアレイのuniqの派生問題です。 リストとかアレイという言葉は言語によってまちまちの意味で使われているので、 「配列のようなもの」という漠然とした意味にとって構いません。
[ reply ]