title: XSLT : Assigning value to a variable after declaration
body: <p>Title is self explanatory. I need to assign a variable in a loop after declaring it outside.</p>
  
  <p>Update:</p>
  
  <p>I am still unable to do it. Below is what my code looks like</p>
  
  <pre><code>&lt;fo:inline color="#2400c0" font-family="Courier" font-size="12px" font-weight="bold"&gt;
         &lt;xsl:if test="string-length($XML1/ROOT/ROWSET/ROW/ORC/LISTORC/QST_ORC/LISTOBR/QST_OBR/RESULTSTATUS) != 0"&gt;
              &lt;xsl:value-of
              select="$XML1/ROOT/ROWSET/ROW/ORC/LISTORC/QST_ORC/LISTOBR/QST_OBR/RESULTSTATUS" /&gt;
          &lt;/xsl:if&gt;
  &lt;/fo:inline&gt;
  </code></pre>
  
  <p>This piece of code lies inside loops. QST_OBR in LISTOBR can have one of following set of values <code>{'P','F','X'}</code>. I want to print 'X' if anyone of the QST_OBR has value 'X'. If no one has 'X', then I need to look for 'P'. 'F' should be printed only if all values are 'F'.</p>
  
  <p>Here are some cases
  for set<code>{'P','X','F'}</code> printed value should be 'X'
  for set <code>{'P','P','F','F'}</code> should be 'P'
  and 'F' only if all values in list are 'F'.</p>