title: the select attribute in xsl:apply-templates
body: <p>I am trying to get back into XSL/XSLT after many years and need some help to understand some XSL that I have received as an example. The TEI-based XML file that I would like to transform, has the following schematic structure:</p>
  
  <pre><code>&lt;text&gt;
   &lt;body&gt;
    &lt;div&gt;
     &lt;div type="text"&gt;
      &lt;ab&gt;
       &lt;lg type="text-de"&gt;
        &lt;l&gt;TEXT&lt;/l&gt;
        ...
       &lt;/lg&gt;
      &lt;/ab&gt;
     &lt;/div&gt;
     &lt;div type="text"&gt;
      &lt;ab&gt;
       &lt;lg type="text-en"&gt;
        &lt;l&gt;TEXT&lt;/l&gt;
        ...
       &lt;/lg&gt;
      &lt;/ab&gt;
     &lt;/div&gt;
    &lt;/div&gt;
   &lt;/body&gt;
  &lt;/text&gt;
  </code></pre>
  
  <p>I have a snippet of XSL that I would like to use to transform the above file. The XSL that I have looks like this:</p>
  
  <pre><code>&lt;xsl:template match="tei:div"&gt;
    SOME HTML CODE
    &lt;div class="text-de"&gt;
     &lt;xsl:apply-templates select="tei:lg[(@type='text-de')]"/&gt;
    &lt;/div&gt;
    &lt;div class="text-en"&gt;
     &lt;xsl:apply-templates select="tei:lg[(@type='text-en')]"/&gt;
    &lt;/div&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>I think the expected HTML output is clear, but please let me know if you need me to explain anything. What I am trying to achieve is that the two different blocks of text get inserted into two different  elements in various places of the resulting HTML. However, when I run the above XSLT no block of text is selected. I would be grateful for any explanations that make me understand the nature of the select attribute in this example.</p>