実際、変数は不変であるため、xslt でこのようなものを作成することはできません。おそらく回避策があるかもしれませんが、必要性をより詳細に指定する必要があります。
編集:
入力がカンマで区切られた値を持つ文字列の場合...
<xsl:variable name="inputString" select="'field1,field2,field3a,field4,field3b'" />
...関数を使用できますtokenize()
...
<xsl:variable name="tokenized" select="tokenize($inputString, ',')" />
...そして、あなたの状態に対応するアイテムを選択してください
<!-- Select item corresponding to condition (e.g. it contains 3). Take first one if there are several such items -->
<xsl:value-of select="$tokenized[contains(., '3')][1]" />
編集2:
区切り値の出力に (xslt 2.0) のseparator
属性を使用できます。xsl:value-of
次の変数を想定
<xsl:variable name="list">
<item>first</item>
<item>second</item>
<item>third</item>
</xsl:variable>
これ<xsl:value-of select="$list/item" separator="," />
により、目的の出力が得られますfirst,second,third