title: XSLT 2.0 co-ordinating multiple modes
body: <p>XSLT 2.0, stylesheet and data at <a href="https://xsltfiddle.liberty-development.net/bFDb2D3/4" rel="nofollow noreferrer">https://xsltfiddle.liberty-development.net/bFDb2D3/4</a></p>
  
  <p>I am transforming medieval documents encoded in tei-xml into webpages where the user can toggle between two different views of the documents, as well as see the translation and various footnotes (<a href="https://stackoverflow.com/questions/52918041/xslt-doubling-outputs-with-variances-for-toggled-html-view">eg</a>). This requires multiple layers of processing to output:</p>
  
  <ul>
  <li>Two latin versions ('inter' and 'diplo') between which the user can toggle (derived from the same tei markup)</li>
  <li>Translated version with almost no transformations (just paragraph formatting and italics)</li>
  <li>Critical apparatus using footnoting # a, b, c, etc.</li>
  <li>Historical footnotes using footnoting # 1, 2, 3, etc.</li>
  </ul>
  
  <p>I am using <code>modes</code> in order to handle the levels of processing, and each mode on its own works fine, but together they are missing outputs. </p>
  
  <p>What should output:</p>
  
  <ol>
  <li><p><code>&lt;div class="inter"&gt;&lt;p&gt;</code> with all transformations mode <code>inter</code> + <code>fn-add-marker</code> 
  [this should contain <code>&lt;a href&gt;</code>, superscript letters and numbers in text]</p></li>
  <li><p><code>&lt;div  class="diplo"&gt;&lt;p&gt;</code> with all transformations mode <code>diplo</code> + <code>fn-add-marker</code> 
  [this should contain [text] , line numbers, superscript letters and numbers in text]</p></li>
  <li><p><code>&lt;div&gt;&lt;p&gt;</code> with translations </p></li>
  <li><p><code>&lt;div&gt;</code> with critical apparatus </p></li>
  <li><p><code>&lt;div&gt;</code> with footnotes </p></li>
  </ol>
  
  <p>The XSLTfiddle output is:</p>
  
  <ol>
  <li>URL and superscript letters ok! <strong>missing superscript numbers</strong> (mode <code>fn-add-marker</code>)</li>
  <li>Superscript letters ok! Line # and [text] ok <strong>except where inside <code>&lt;persName&gt;</code> or <code>&lt;placeName&gt;</code></strong> (ie.<code>&lt;xsl:template match="tei:lb"&gt;</code> <code>&lt;xsl:template match="tei:supplied"&gt;</code>) and <strong>missing superscript numbers</strong> (mode <code>fn-add-marker</code>)</li>
  <li>ok!</li>
  <li>ok!</li>
  <li>ok!</li>
  </ol>
  
  <p>With respect to #2, the missing line # and [text] appear to be a result of the templates that treat <code>&lt;persName&gt;</code> and <code>&lt;placeName&gt;</code> not handing off to other templates? (templates at lines 173-218)</p>
  
  <p>All templates concerning mode <code>fn-add-marker</code> are at lines 41-77.</p>
  
  <p>Many thanks in advance.</p>