title: XSL template not being applied
body: <p>Following is some XSL that I'm editing. I had to add code to account for html tables and cannot figure out why the templates under [CITATIONS] are being applied, but those under [TABLES] are not. The code for [CITATIONS] was there and working before I started. The code for [TABLES] I stole from another part of the application and where it does work just fine. Does anything here stand out to anyone? Thanks in advance.</p>
  
  <pre><code>&lt;!-- Common template for procedure sub-sections. --&gt;
  &lt;xsl:template match="th:section" priority="1" mode="procedures"&gt;
      &lt;div id="tab{position()}"&gt;
          &lt;xsl:if test="count(*//th:figure) gt 0"&gt;
              &lt;hr/&gt;
              &lt;div class="carrousel floatbox"&gt;
  
              &lt;!-- LOTS OF CODE HERE. --&gt;
  
              &lt;/div&gt;
              &lt;hr/&gt;
          &lt;/xsl:if&gt;
          &lt;xsl:next-match/&gt;
      &lt;/div&gt;
  &lt;/xsl:template&gt;
  
  &lt;!-- [TABLES] Table templates not being applied. --&gt;
  &lt;xsl:template match="th:table" mode="procedures"&gt;
  &lt;table border="1"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/table&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match="th:thead"&gt;
  &lt;thead&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/thead&gt;
  &lt;/xsl:template&gt;
  &lt;!-- [More table templates follow here to handle table body and footer. None are being applied.] --&gt;
  
  &lt;!-- [CITATIONS] These templates are being applied. --&gt;
  &lt;xsl:template match="th:section[@type = 'literature']" mode="procedures"&gt;
      &lt;ol class="litrefs"&gt;
          &lt;xsl:apply-templates mode="refs"/&gt;
      &lt;/ol&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match="th:litref" mode="refs"&gt;
      &lt;li&gt;
          &lt;xsl:apply-templates mode="refs"/&gt;
      &lt;/li&gt;
  &lt;/xsl:template&gt;
  &lt;!-- [More templates follow here to handle citations. No problems here.] --&gt;
  </code></pre>