Expand | Collapse

◀ 7. Text elements9. Hypertext links ▶

8. Footnotes

xsl:stylesheet id="stylesheet" exclude-result-prefixes="x2 lit xs" version="1.0" xml:lang="en"

fn
fn in footnotes mode
display-footnotes template

xsl:template name="display-footnotes"
  xsl:variable name="fn" select="//xs:fn"
  xsl:if test="count($fn)>0"
    <hr />
    <h3>Notes</h3>
    <ol>
      xsl:apply-templates select="$fn" mode="footnotes"
    </ol>
  
xsl:template match="xs:fn" mode="footnotes"
  xsl:variable name="n"xsl:number level="any"
  <li id="footnote-{$n}">
    xsl:apply-templates
  </li>
xsl:template match="xs:fn"
  xsl:variable name="n"xsl:number level="any"
  <sup>
    <a id="#footnote-anchor-{$n}" href="#footnote-{$n}">
      xsl:value-of select="$n"
    </a>
  </sup>

Formatted using xhtml2to1 by Steve Cheng.