Endnotes

From TEIWiki
Revision as of 06:38, 23 June 2007 by KjxNxp (talk | contribs)
Jump to navigation Jump to search

This xslt transforms tei:note elements for display in xhtml. It places a numbered marker at the insertion point and reproduces the note content in a separate section at the end of the document. Links between the insertion marker and note are automatically generated.

Input TEI

<p>...Lorem ipsum dolor sit amet, consectetuer 
adipiscing elit.<note><p>Suspendisse faucibus. 
Nulla a tortor id pede aliquam venenatis.</p>
<p>Donec eget lectus.</p></note> Fusce hendrerit, 
quam ac nonummy rutrum, turpis odio ultrices tortor...</p>

Output

XHTML 1.0 (Strict)

At the insertion point:

<p>...Lorem ipsum dolor sit amet, consectetuer 
adipiscing elit.<sup><a name="refpoint-1" 
href="#note-1" title="Link to note 1 at the end 
of this document."><span class="hideme">[</span>1<span 
class="hideme">]</span></a></sup> Fusce hendrerit, 
quam ac nonummy rutrum, turpis odio ultrices tortor...</p>

Elsewhere in the document

  <hr class="subdivider"/>
  <div class="notes">
   <h2><a id="notes"/>Notes:</h2>
   <div class="footnote"><p>
      <a id="note-1" href="#refpoint-1" title="Link to insertion point 
       of note in main text."><span class="hideme">[</span>1<span 
       class="hideme">]</span></a>. Suspendisse faucibus. 
       Nulla a tortor id pede aliquam venenatis.</p>
       <p>Donec eget lectus.</p>
   </div>
  <!-- [other html:div[class='note']] -->
  </div>

XSLT

The same stylesheet works in xslt 1.0 and xslt 2.0.

Create note section

The following template should be called (using