title: Is there a syntax difference between template match and if test?
body: <p>I'm currently trying to improve code and i came across this:</p>
  
  <pre><code>&lt;xsl:template match="activator"&gt;
      &lt;xsl:if test="not(ancestor::repeater)"&gt;
          Test1
      &lt;/xsl:if&gt; 
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>since the if seemed not necessary i replaced it:</p>
  
  <pre><code>&lt;xsl:template match="activator[not(ancestor::repeater)]"&gt;
      Test2
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>I tested it with</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;repeater&gt;
      &lt;activator&gt;
          &lt;text&gt;
              &lt;string&gt;T_Auswahl&lt;/string&gt;
          &lt;/text&gt;
      &lt;/activator&gt;
  &lt;/repeater&gt;
  </code></pre>
  
  <p>but it doesn't match now and i can't figure out what i did wrong.</p>