title: XSLT not behaving as expected: Attribute not considered correctly
body: <p>Currently I am redesigning an import process of XML files. The structure features a node which again has an attribute called "EntryMethod". Currently, the string value of this attribute is replaced by an int value during import using <code>xsl:choose</code>:</p>
  
  <pre><code>&lt;xsl:attribute name="EntryMethodKey"&gt;
      &lt;xsl:choose&gt;
          &lt;xsl:when test="self::*[@EntryMethod = 'Scanned']"&gt;1&lt;/xsl:when&gt;
          ....
  </code></pre>
  
  <p>However, decision has been made to keep the string value instead of the int value in order to dynamically receive new values as they arrive without extending the XSL. So - besides changing the column of the destination table - I changed the XSL as follows:</p>
  
  <pre><code>    &lt;xsl:attribute name="EntryMethodKey"&gt;
          &lt;xsl:value-of select="self::*[@EntryMethod]" /&gt;
      &lt;/xsl:attribute&gt;
  </code></pre>
  
  <p>But instead of 'Scanned' or whatever is the value of the attribute, I receive a whole lot of crap displaying anything but the entry method. Seems to be some kind of row from the XML, but I couldn't figure out which. But it doesn't include the EntryMethod attribute.</p>
  
  <p>Anyways, if I change the XSL as follows, I receive (at least seemingly) the correct value:</p>
  
  <pre><code>&lt;xsl:attribute name="EntryMethodKey"&gt;
      &lt;xsl:value-of select="@EntryMethod" /&gt;
  &lt;/xsl:attribute&gt;
  </code></pre>
  
  <p>But I don't understand why! Isn't there any risk in losing the correct value if I drop the <code>self::*</code>? Is it guaranteed that <code>select="@EntryMethod"</code> always returns the correct value? I tested it with something like 1.5k files and it looks OK - however, I'll have to reload millions of files and I want to reduce the risk of loosing information to an absolute minimum.</p>