1 <?xml version="1.0" encoding="utf-8"?>
4 This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
5 Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
8 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
9 xmlns:wl="http://wolnelektury.pl/functions"
10 xmlns:dc="http://purl.org/dc/elements/1.1/"
11 xmlns="http://www.gribuser.ru/xml/fictionbook/2.0"
12 xmlns:l="http://www.w3.org/1999/xlink">
14 <!-- footnote body mode -->
15 <xsl:template match="pe" mode="footnotes">
16 <!-- we number them absolutely -->
17 <xsl:variable name="n" select="count(preceding::pe) + 1"/>
19 <xsl:element name="section">
20 <xsl:attribute name="id">fn<xsl:value-of select="$n"/></xsl:attribute>
22 <p><xsl:apply-templates mode="inline"/></p>
25 <xsl:template match="text()" mode="footnotes"/>
27 <!-- footnote links -->
28 <xsl:template match="pe" mode="inline">
29 <xsl:variable name="n" select="count(preceding::pe) + 1"/>
30 <xsl:element name="a">
31 <xsl:attribute name="type">note</xsl:attribute>
32 <xsl:attribute name="l:href">#fn<xsl:value-of select="$n"/></xsl:attribute>
34 <xsl:text>[</xsl:text>
35 <xsl:value-of select="$n"/>
36 <xsl:text>]</xsl:text>