-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgarden-party.xsl
131 lines (114 loc) · 2.88 KB
/
garden-party.xsl
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- The Entire HTML Web Page -->
<xsl:template match="/">
<html>
<head>
<link rel="stylesheet" href="garden-party.css" />
<link href='https://fonts.googleapis.com/css?family=Merriweather:400,400italic' rel='stylesheet' type='text/css'/>
<script src="jquery-2.1.4.min.js"></script>
<script src="custom.js"></script>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<!--The Entire Set of Text/Commentary Pairs -->
<xsl:template match="TEI/text/body">
<div id="textBody">
<table>
<tr>
<th>Text</th>
<th>Commentary</th>
</tr>
<xsl:apply-templates/>
</table>
</div> <!--End of Container-->
</xsl:template>
<!-- Text/Commentary Pairs -->
<xsl:template match="ab">
<tr class="interp"><xsl:apply-templates/></tr>
</xsl:template>
<!-- Metadata -->
<xsl:template match="TEI/teiHeader">
<div class="metadata">
<xsl:apply-templates/>
</div> <!--end of sourceDesc-->
</xsl:template>
<!-- Text Segments -->
<xsl:template match="seg">
<td class="lexeme">
<xsl:attribute name="id">
<xsl:value-of select="@n"/>
</xsl:attribute>
<xsl:if test="@type = 'startPara' ">
<span class="pilcrow">¶</span>
</xsl:if>
<xsl:apply-templates select="@n | node()"/>
</td>
</xsl:template>
<!-- Lexia IDs -->
<xsl:template match="@n">
<sup class="lexeme-id">
<xsl:value-of select="."/>
</sup>
</xsl:template>
<!-- Commentary -->
<xsl:template match="interp">
<td class="interp">
<xsl:apply-templates/>
</td>
</xsl:template>
<!-- Tags -->
<xsl:template match="interp/desc">
<xsl:for-each select=".">
<span>
<xsl:attribute name="class">tag
<xsl:value-of select="."/>
</xsl:attribute>
<xsl:value-of select="."/>
</span>
</xsl:for-each>
</xsl:template>
<!-- Handle links -->
<xsl:template match="ptr">
<a>
<xsl:attribute name="href">
<xsl:value-of select="@target"/>
</xsl:attribute>
<xsl:apply-templates/>
</a>
</xsl:template>
<!-- Title -->
<xsl:template match="head[@type='title']">
<h1><xsl:apply-templates/></h1>
</xsl:template>
<!-- Byline -->
<xsl:template match="head[@type='byline']">
<h2><xsl:apply-templates/></h2>
</xsl:template>
<!-- Verse Stanzas -->
<xsl:template match="lg">
<p class="song">
<xsl:apply-templates/>
</p>
</xsl:template>
<!-- Verse Lines -->
<xsl:template match="l">
<xsl:apply-templates/><br/>
</xsl:template>
<!-- Emphasized Text (Italics) -->
<xsl:template match="emph">
<span class="emph"><xsl:apply-templates/></span>
</xsl:template>
<xsl:template match="foreign">
<span class="emph"><xsl:apply-templates/></span>
</xsl:template>
<!-- This inserts a placeholder which sed will swap out with the contents of header.html. -->
<xsl:template match="div[@type='header']">
<div class="header-area">
INSERTHEADERHERE
</div>
</xsl:template>
</xsl:stylesheet>