When I try to use the code below I get a duplicate variable error because variables are immutable. How do I set the smaller of the two variables ($nextSubPartPos,$nextQuestionStemPos) as my new variable ($nextQuestionPos)?
<xsl:variable name="nextQuestionPos"/>
<xsl:choose>
<xsl:when test="$nextSubPartPos < $nextQuestionStemPos">
<xsl:variable name="nextQuestionPos" select="$nextSubPartPos"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="nextQuestionPos" select="$nextSubPartPos"/>
</xsl:otherwise>
</xsl:choose>