title: Set a variable to the smaller of two other variables
body: <p>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 (<code>$nextSubPartPos</code> and <code>$nextQuestionStemPos</code>) as my new variable (<code>$nextQuestionPos</code>)?</p>
  
  <pre><code>        &lt;xsl:variable name="nextQuestionPos"/&gt;
          &lt;xsl:choose&gt;
              &lt;xsl:when test="$nextSubPartPos &amp;lt; $nextQuestionStemPos"&gt;
                  &lt;xsl:variable name="nextQuestionPos" select="$nextSubPartPos"/&gt;
              &lt;/xsl:when&gt;
              &lt;xsl:otherwise&gt;
                  &lt;xsl:variable name="nextQuestionPos" select="$nextSubPartPos"/&gt;
              &lt;/xsl:otherwise&gt;
          &lt;/xsl:choose&gt;
  </code></pre>