title: XSLT / apply-templates ignore or apply attribute at (xmlns, version)
body: <p>I have a problem to translate XML with attributes. XSLT works only when the XML element <code>&lt;Invoice&gt;</code> has no attributes.</p>
  <p>In this format is output empty:</p>
  <pre><code>&lt;Invoice xmlns=&quot;http://isdoc.cz/namespace/2013&quot; version=&quot;6.0.1&quot;&gt;
  </code></pre>
  <p>Thanks</p>
  <p>XML</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;Invoice xmlns=&quot;http://isdoc.cz/namespace/2013&quot; version=&quot;6.0.1&quot;&gt;
      &lt;DocumentType&gt;1&lt;/DocumentType&gt;
      &lt;ID&gt;202200001&lt;/ID&gt;
      &lt;IssueDate&gt;2022-01-31&lt;/IssueDate&gt;
  &lt;/Invoice&gt;
  </code></pre>
  <p>XSLT</p>
  <pre><code>&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;
      &lt;xsl:output method=&quot;xml&quot; version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; indent=&quot;yes&quot;/&gt;
  
      &lt;xsl:template match=&quot;/&quot;&gt;
          &lt;Money&gt;     
              &lt;xsl:apply-templates select=&quot;Invoice&quot; /&gt;
          &lt;/Money&gt;
      &lt;/xsl:template&gt;
  
      &lt;xsl:template match=&quot;Invoice&quot;&gt;
          &lt;xsl:element name=&quot;No&quot;&gt;
              &lt;xsl:value-of select=&quot;ID&quot;/&gt;
          &lt;/xsl:element&gt;
          &lt;xsl:element name=&quot;Date&quot;&gt;
              &lt;xsl:value-of select=&quot;IssueDate&quot;/&gt;
          &lt;/xsl:element&gt;
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  <p>Output</p>
  <pre><code>&lt;Money&gt;
      &lt;No&gt;202200001&lt;/No&gt;
      &lt;Date&gt;2022-01-31&lt;/Date&gt;
  &lt;/Money&gt;
  </code></pre>
  <p>Final working sollution - create namespace in header</p>
  <pre><code>&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=http://www.w3.org/1999/XSL/Transform xmlns:isdoc=http://isdoc.cz/namespace/2013&gt;
  
    &lt;xsl:output method=&quot;xml&quot; version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; indent=&quot;yes&quot; /&gt;
  
    &lt;xsl:template match=&quot;/&quot;&gt;
      &lt;Money&gt;
        &lt;xsl:apply-templates select=&quot;isdoc:Invoice&quot; /&gt;
      &lt;/Money&gt;
    &lt;/xsl:template&gt;
  
    &lt;xsl:template match=&quot;isdoc:Invoice&quot;&gt;
      &lt;No&gt;
        &lt;xsl:value-of select=&quot;isdoc:ID&quot; /&gt;
      &lt;/No&gt;
      &lt;Date&gt;
        &lt;xsl:value-of select=&quot;isdoc:IssueDate&quot; /&gt;
      &lt;/Date&gt;
    &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  
  
  </code></pre>