2つのノードの要素を反転する必要があります。元々、変数は次のコマンドで設定されていました。
<xsl:variable name="matchesLeft" select="$questionObject/descendant::simpleMatchSet[position()=1]/simpleAssociableChoice"/>
<xsl:variable name="matchesRight" select="$questionObject/descendant::simpleMatchSet[position()=2]/simpleAssociableChoice"/>
次のコードで変数を反転させたいと思います。
<xsl:variable name="matchesRight">
<xsl:choose>
<xsl:when test="$flippedQuestions='true'">
<xsl:value-of select="$questionObject/descendant::simpleMatchSet[position()=2]/simpleAssociableChoice"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$questionObject/descendant::simpleMatchSet[position()=1]/simpleAssociableChoice"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
ただし、ノード内のすべての要素ではなく、最初の要素からのみ値を取得します。どうすればこれを達成できますか?