title: How to compare node attribute against node
body: <p>I am trying to figure out how to do something similar to <code>if exists</code> in (node)</p>
  
  <p>I have the following xml and on xls I´m trying to compare if available flags @id exists in contact/biographical/flags </p>
  
  <pre><code>&lt;availableflags&gt;
          &lt;flag id="happy"&gt;Happy&lt;/flag&gt;
          &lt;flag id="curious"&gt;Curious&lt;/flag&gt;
          &lt;flag id="busy"&gt;Busy&lt;/flag&gt;
          &lt;flag id="expert"&gt;Expert&lt;/flag&gt;
          &lt;flag id="client"&gt;Client&lt;/flag&gt;
          &lt;flag id="manager"&gt;Manager&lt;/flag&gt;
      &lt;/availableflags&gt;
  
  &lt;contact&gt;
  
          &lt;biographical&gt;
              &lt;age&gt;33&lt;/age&gt;
              &lt;flags&gt;
                  &lt;flag&gt;happy&lt;/flag&gt;
                  &lt;flag&gt;expert&lt;/flag&gt;
              &lt;/flags&gt;
          &lt;/biographical&gt;
          &lt;contact&gt;
  </code></pre>
  
  <p><strong>xls</strong></p>
  
  <pre><code>   &lt;xsl:if test="@id=contact/biographical/flags/@flag"&gt;
          &lt;input type="checkbox"  checked="checked"&gt; &lt;xsl:text&gt;{contact/biographical/flags/@flag}&lt;/xsl:text&gt;
      &lt;/input&gt;
  
              &lt;/xsl:if&gt;
  </code></pre>
  
  <p>I have tried different variations of the if statement, but no luck.</p>