title: XSLT how to store values in array
body: <p>XML:</p>
  
  <pre><code>&lt;Calendars xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Urnik.xsd"&gt;
      &lt;Calendar&gt;
          &lt;Name&gt;Marko&lt;/Name&gt;
          &lt;Days&gt;
              &lt;Day&gt;
                  &lt;Date&gt;2013-05-13&lt;/Date&gt;
                  &lt;DayType&gt;1&lt;/DayType&gt;
                  &lt;DayWorking&gt;1&lt;/DayWorking&gt;
                  &lt;WorkingTimes&gt;
                      &lt;WorkingTime&gt;
                          &lt;FromTime&gt;08:00&lt;/FromTime&gt;
                          &lt;ToTime&gt;11:00&lt;/ToTime&gt;
                          &lt;Name&gt;Izpit Matematika&lt;/Name&gt;
                          &lt;Owner&gt;Marko&lt;/Owner&gt;
                          &lt;Category&gt;
                              &lt;School Professor="111" Room="1" Subject="882" /&gt;
                          &lt;/Category&gt;
                      &lt;/WorkingTime&gt;
                      &lt;WorkingTime&gt;
                          &lt;FromTime&gt;13:00&lt;/FromTime&gt;
                          &lt;ToTime&gt;17:00&lt;/ToTime&gt;
                          &lt;Name&gt;Vaje APZ&lt;/Name&gt;
                          &lt;Owner&gt;Marko&lt;/Owner&gt;
                          &lt;Category&gt;
                              &lt;School Professor="222" Room="11" Subject="881"/&gt;
                          &lt;/Category&gt;
                      &lt;/WorkingTime&gt;      
                      &lt;WorkingTime&gt;
                          &lt;FromTime&gt;20:00&lt;/FromTime&gt;
                          &lt;ToTime&gt;22:00&lt;/ToTime&gt;
                          &lt;Name&gt;Vaje aaaaaa&lt;/Name&gt;
                          &lt;Owner&gt;Marko&lt;/Owner&gt;
                          &lt;Category&gt;
                              &lt;School Professor="222" Room="11" Subject="881"/&gt;
                          &lt;/Category&gt;
                      &lt;/WorkingTime&gt;                      
                  &lt;/WorkingTimes&gt;
              &lt;/Day&gt;
              &lt;Day&gt;
                  &lt;Date&gt;2013-05-14&lt;/Date&gt;
                  &lt;DayType&gt;2&lt;/DayType&gt;
                  ...
              &lt;/Day&gt;
  </code></pre>
  
  <p>XSLT:</p>
  
  <pre><code>&lt;xsl:for-each select="Calendar/Days/Day"&gt;   
      &lt;xsl:choose&gt;
          &lt;xsl:when test="DayType = 1"&gt;
              &lt;xsl:variable name="vTransfers" select="/*/WorkingTime"/&gt;
              &lt;xsl:value-of select="$vTransfers[1]" /&gt;
  </code></pre>
  
  <p>I am looping <code>Day</code> nodes. And then I want to store all <code>WorkingTime</code> nodes from <code>DayType = 1</code> to array. 
  Not loop it but store it in array because I will print it later in the correct td tag</p>
  
  <p>But  is empty but I expect to get:</p>
  
  <pre><code>&lt;WorkingTime&gt;
                          &lt;FromTime&gt;08:00&lt;/FromTime&gt;
                          &lt;ToTime&gt;11:00&lt;/ToTime&gt;
                          &lt;Name&gt;Izpit Matematika&lt;/Name&gt;
                          &lt;Owner&gt;Marko&lt;/Owner&gt;
                          &lt;Category&gt;
                              &lt;School Professor="111" Room="1" Subject="882" /&gt;
                          &lt;/Category&gt;
                      &lt;/WorkingTime&gt;
  </code></pre>
  
  <p>Can you give me some clue how?</p>