-
Notifications
You must be signed in to change notification settings - Fork 0
/
htm-teiapp.xsl
168 lines (158 loc) · 6.71 KB
/
htm-teiapp.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id$ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns:t="http://www.tei-c.org/ns/1.0" exclude-result-prefixes="t"
version="2.0">
<!-- Contains app and its children rdg, ptr, note and lem -->
<xsl:template match="t:app">
<xsl:param name="parm-apparatus-style" tunnel="yes" required="no"/>
<xsl:param name="location" tunnel="yes" required="no"/>
<xsl:choose>
<xsl:when test="@resp='previous'">
<span class="previouslyread">
<xsl:apply-templates/>
</span>
</xsl:when>
<xsl:when test="@resp='autopsy'"/>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
<!-- Found in htm-tpl-apparatus - creates links to footnote in apparatus -->
<xsl:if test="$parm-apparatus-style = 'ddbdp'">
<xsl:call-template name="app-link">
<xsl:with-param name="location">
<xsl:choose>
<xsl:when test="$location = 'apparatus'">apparatus</xsl:when>
<xsl:otherwise>text</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="t:rdg">
<xsl:param name="parm-edition-type" tunnel="yes" required="no"/>
<xsl:choose>
<xsl:when test="$parm-edition-type = 'diplomatic'">
<xsl:choose>
<xsl:when test="@resp='previous'"/>
<xsl:when test="@resp='autopsy'">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:when>
<xsl:when test="@resp='previous'">
<xsl:apply-templates/>
</xsl:when>
<xsl:when test="@resp='autopsy'"/>
<xsl:when test="parent::t:app"/>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="t:wit">
<xsl:choose>
<!-- Temporary -->
<xsl:when test="parent::t:app"/>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="t:lem">
<xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
<xsl:param name="parm-hgv-gloss" tunnel="yes" required="no"></xsl:param>
<xsl:choose>
<xsl:when test="$parm-leiden-style=('ddbdp','dclp','sammelbuch') and ancestor::t:div[@type='translation']">
<xsl:variable name="wit-val" select="@resp"/>
<xsl:variable name="lang" select="ancestor::t:div[@type = 'translation']/@xml:lang"/>
<span class="term">
<xsl:apply-templates/>
<span class="gloss" style="display:none">
<b><xsl:choose>
<xsl:when test="$lang = 'en'">
<xsl:if test=".//t:term[@target]">
<xsl:text>Glossary/</xsl:text>
</xsl:if>
<xsl:text>Correction:</xsl:text>
</xsl:when>
<xsl:when test="$lang = 'de'">
<xsl:if test=".//t:term[@target]">
<xsl:text>Glossar/</xsl:text>
</xsl:if>
<xsl:text>Korrektur:</xsl:text>
</xsl:when>
</xsl:choose></b>
<xsl:for-each select=".//t:term[@target]">
<xsl:value-of select="document($parm-hgv-gloss)//t:item[@xml:id = current()/@target]/t:term"/>
<xsl:text>. </xsl:text>
<xsl:value-of select="document($parm-hgv-gloss)//t:item[@xml:id = current()/@target]/t:gloss[@xml:lang = $lang]"/>
<xsl:text>; </xsl:text>
</xsl:for-each>
<xsl:value-of select="$wit-val"/>
</span>
</span>
</xsl:when>
<xsl:when test="$parm-leiden-style=('ddbdp','dclp','sammelbuch') and ancestor::t:*[local-name()=('reg','corr','rdg')
or self::t:del[@rend='corrected']]">
<xsl:apply-templates/>
<xsl:if test="@resp">
<xsl:choose>
<xsl:when test="$parm-leiden-style=('ddbdp','dclp')"><xsl:text> FNORD-SPLIT </xsl:text></xsl:when>
<xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
</xsl:choose>
<xsl:if test="parent::t:app[@type='BL']">
<xsl:text>BL </xsl:text>
</xsl:if>
<xsl:value-of select="@resp"/>
<xsl:if test="parent::t:app[@type='SoSOL']">
<xsl:text> (via PE)</xsl:text>
</xsl:if>
<xsl:choose>
<xsl:when test="$parm-leiden-style=('ddbdp','dclp')"><xsl:text> FNORD-DELIM </xsl:text></xsl:when>
<xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:choose>
<xsl:when test="parent::t:app[@type='editorial']">
<xsl:text> (</xsl:text><xsl:for-each select="following-sibling::t:rdg">
<!-- found in tpl-apparatus.xsl -->
<xsl:call-template name="app-ed-mult"/>
</xsl:for-each><xsl:text>)</xsl:text>
</xsl:when>
<xsl:when test="parent::t:app[@type='alternative']">
<xsl:text> (or </xsl:text>
<xsl:for-each select="following-sibling::t:rdg">
<xsl:apply-templates/>
<xsl:if test="position()!=last()">
<xsl:text> or </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>)</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="parent::t:app[@type='previouslyread']">
<span class="previouslyread">
<xsl:apply-templates/>
</span>
</xsl:when>
<xsl:when test="$parm-leiden-style='iospe' and ../t:rdg">
<xsl:apply-templates/>
<xsl:text> resp. </xsl:text>
<xsl:for-each select="../t:rdg">
<xsl:apply-templates/>
<xsl:if test="not(position()=last())">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>