title: Match attribute on XSLT instead of matching the whole element
body: <p>I want to write an XSL template that matches attributes instead of nodes, </p>
  
  <p>I would think that having something like this:</p>
  
  <pre><code>&lt;xsl:template match="@href | @conref | @conrefend"&gt;
      &lt;xsl:message select="."/&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>would match any of those 3 attribute names and print to console the value of the attribute as the scope is the attribute itself and not a node.</p>
  
  <p>But my testing has proven me wrong and I'm only able to match nodes that contain any of those attributes like this:</p>
  
  <pre><code> &lt;xsl:template match="*[@href or @conref or @conrefend]"&gt;
     &lt;xsl:message select="if(not(@href)) 
                          then    
                            if(not(@conref)) 
                            then @conrefend 
                            else @conref 
                          else @href"/&gt;  
     &lt;/xsl:template&gt;
  </code></pre>
  
  <p>The problem with that approach is that if there happens to exist a node that has more than one of those attributes then only one gets processed and I need to process them all.</p>
  
  <p>Any ideas of why the first approach doesn't work?</p>
  
  <p>EDIT1:
  Full xslt:</p>
  
  <pre><code>  &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        exclude-result-prefixes="xs"
        version="2.0"&gt;
  
       &lt;xsl:output omit-xml-declaration="yes" indent="yes"/&gt;
       &lt;xsl:strip-space elements="*"/&gt;             
       &lt;xsl:template match="@conref|@conrefend|@href"&gt;
          &lt;xsl:message select="."/&gt;
       &lt;/xsl:template&gt;
     &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Test XML:</p>
  
  <pre><code>  &lt;links&gt;
        &lt;image conref="COPY-GUID/*+-862416}39-37CD-4CF7-A7AA-F09F4A763944" /&gt;
     &lt;/links&gt;
  </code></pre>
  
  <p>Right now the XSLT is not matching anything.</p>