title: xslt processing on select attribute on apply-templates
body: <p>I have a XSLT as below and apply this xslt into the input xml[pasted below], it is working fine except one thing that need to clarify.</p>
  
  <p>this is the input xml</p>
  
  
  
  <pre><code>&lt;Test&gt;
    &lt;Experiment id='1'&gt;
      &lt;Dish1&gt;
        &lt;Conditions pressure='x' temp='y'/&gt;
        &lt;Measurement timeStamp='8am' reading='y'/&gt;
      &lt;/Dish1&gt;
      &lt;Dish2&gt;
        &lt;Conditions pressure='x' temp='y'/&gt;
        &lt;Measurement timeStamp='8am' reading='y'/&gt;
      &lt;/Dish2&gt;
      &lt;Dish1&gt;
        &lt;Conditions pressure='x' temp='y'/&gt;
        &lt;Measurement timeStamp='2pm' reading='y'/&gt;
      &lt;/Dish1&gt;
      &lt;Dish2&gt;
        &lt;Conditions pressure='x' temp='y'/&gt;
        &lt;Measurement timeStamp='2pm' reading='y'/&gt;
      &lt;/Dish2&gt;
     &lt;/Experiment&gt;
     &lt;Experiment id='2'&gt;
      &lt;Dish1&gt;
        &lt;Conditions pressure='x' temp='y'/&gt;
        &lt;Measurement timeStamp='9am' reading='y'/&gt;
      &lt;/Dish1&gt;
      &lt;/Experiment&gt;
  &lt;/Test&gt;
  </code></pre>
  
  <p>this is the xslt</p>
  
  <pre><code>&lt;xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
     &lt;xsl:output method="xml" indent="yes"/&gt;
  
     &lt;xsl:template match="Experiment"&gt;
        &lt;xsl:copy&gt;
           &lt;xsl:apply-templates select="@*" /&gt;
           &lt;xsl:for-each-group select="*" group-by="local-name()"&gt;
              &lt;xsl:copy&gt;
                 &lt;xsl:apply-templates select="current-group()" /&gt;
  
              &lt;/xsl:copy&gt;
           &lt;/xsl:for-each-group&gt;
        &lt;/xsl:copy&gt;
     &lt;/xsl:template&gt;
  
     &lt;xsl:template match="Experiment/*"&gt;
        &lt;Observation&gt;
           &lt;xsl:apply-templates select="*/@*" /&gt;
        &lt;/Observation&gt;
     &lt;/xsl:template&gt;
  
     &lt;xsl:template match="@*|node()"&gt;
        &lt;xsl:copy&gt;
           &lt;xsl:apply-templates select="@*|node()"/&gt;
        &lt;/xsl:copy&gt;
     &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>This is transformation is working fine. But, if i change as below on the xslt, then, it is getting error. Any idea?</p>
  
  <pre><code>&lt;xsl:template match="@*|node()"&gt;
  &lt;xsl:copy&gt;
  &lt;xsl:apply-templates select="."/&gt;
  &lt;/xsl:copy&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>I.e., On the last match, I have changed  from  <code>&lt;xsl:apply-templates select="@*|node()"/&gt;</code> to     <code>&lt;xsl:apply-templates select="."/&gt;</code></p>