title: XSLT how to check if element exist 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="child::*/WorkingTime"/&gt;                 
  </code></pre>
  
  <p>Can I somehow check this variable <code>vTransfers</code> if <code>08:00</code> exist in <code>FromTime</code>. I do not want to loop it beacuse I need to place it in correct <code>TD</code> row. And I am now in this TD and i woul like to check if <code>08:00</code> exist in <code>FromTime</code> in this array.</p>
  
  <p>I try something like</p>
  
  <pre><code>&lt;xsl:when test="contains($vTransfers/ToTime, '08:00')"&gt;
                          &lt;xsl:text&gt;IN&lt;/xsl:text&gt;
                      &lt;/xsl:when&gt;
                      &lt;xsl:otherwise&gt;                                     
                          &lt;xsl:text&gt;OUT&lt;/xsl:text&gt;
                      &lt;/xsl:otherwise&gt;
  </code></pre>
  
  <p>but always takes just firs one and not check whole array.</p>