-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Footnotes.xslt
78 lines (78 loc) · 2.83 KB
/
Footnotes.xslt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="UTF-8" ?>
<!--
#############################################################
# Name: Footnotes.xslt
# Purpose: Provide a view of footnotes
# Part of: PT-Views - https://github.com/SILAsiaPub/PT-Views
# Concept: Mark Penny
# XSLT: Ian McQuay <ian_mcquay@sil.org>
# CSS: Ian McQuay
# Created: 2019-12-05
# Copyright: (c) 2019 SIL International
# Licence: <MIT>
################################################################ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:extensions="urn:extensions" xmlns:usfmextensions="urn:usfmextensions">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:template match="/*">
<div class="usfm">
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="para">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="note">
<div class="{@style}">
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>marker</xsl:text>
</xsl:attribute>
<xsl:text>\</xsl:text>
<xsl:value-of select="@style"/>
<xsl:text> </xsl:text>
</xsl:element>
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>caller</xsl:text>
</xsl:attribute>
<xsl:value-of select="@caller"/>
<xsl:text> </xsl:text>
</xsl:element>
<xsl:apply-templates mode="fn"/>
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>marker</xsl:text>
</xsl:attribute>
<xsl:text>\</xsl:text>
<xsl:value-of select="@style"/>
<xsl:text>* </xsl:text>
</xsl:element>
</div>
</xsl:template>
<xsl:template match="char" mode="fn">
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>marker</xsl:text>
</xsl:attribute>
<xsl:text>\</xsl:text>
<xsl:value-of select="@style"/>
<xsl:text> </xsl:text>
</xsl:element>
<span class="{@style}">
<xsl:apply-templates mode="fn"/>
</span>
</xsl:template>
<xsl:template match="chapter">
<style type="text/css">
.f {vertical-align: text-top;}
.marker {color:gray}
.fr {font-weight:bold;}
.ft {}
.fq {font-style:italic}
</style>
</xsl:template>
<xsl:template match="text()"/>
<xsl:template match="text()" mode="fn">
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>