Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- $Id: htm-teihi.xsl 2090 2013-10-24 15:23:22Z gabrielbodard $ -->
3
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
   xmlns:t="http://www.tei-c.org/ns/1.0"
5
   exclude-result-prefixes="t" version="2.0">
6
   <!-- hi imports in teihi.xsl, html span created here -->
7
   <xsl:import href="teihi.xsl"/>
8

    
9
   <xsl:template match="t:hi">
10
       <xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
11
       <xsl:choose>
12
         <!-- No html code needed for these -->
13
         <xsl:when
14
            test="@rend = 'diaeresis' or @rend = 'grave' or @rend = 'acute' or @rend = 'asper' or @rend = 'lenis' or @rend = 'circumflex'">
15
            <xsl:apply-imports/>
16
         </xsl:when>
17
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
18
         <!-- @rend='apex'                                                       -->
19
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
20
         <xsl:when test="@rend='apex' and ancestor-or-self::t:*[@xml:lang][1][@xml:lang = 'la']">
21
            <xsl:element name="span">
22
               <xsl:attribute name="class">apex</xsl:attribute>
23
               <xsl:attribute name="title">apex over: <xsl:value-of select="."/>
24
               </xsl:attribute>
25
               <xsl:value-of select="translate(., 'aeiou', 'áéíóú')"/>
26
            </xsl:element>
27
         </xsl:when>
28
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
29
         <!-- @rend='caps'                                                       -->
30
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
31
         <xsl:when test="@rend='intraline'">
32
             <xsl:element name="span">
33
                 <xsl:attribute name="class">caps</xsl:attribute>
34
                 <xsl:apply-templates/>
35
             </xsl:element>
36
         </xsl:when>
37
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
38
         <!-- @rend='intraline'                                                  -->
39
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
40
         <xsl:when test="@rend='intraline'">
41
            <xsl:element name="span">
42
               <xsl:attribute name="class">line-through</xsl:attribute>
43
               <xsl:apply-templates/>
44
            </xsl:element>
45
         </xsl:when>
46
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
47
         <!-- @rend='italic'                                                     -->
48
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
49
         <xsl:when test="@rend='italic'">
50
            <xsl:element name="span">
51
               <xsl:attribute name="class">italic</xsl:attribute>
52
               <xsl:apply-templates/>
53
            </xsl:element>
54
         </xsl:when>
55
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
56
         <!-- @rend='ligature'                                                   -->
57
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
58
         <xsl:when test="@rend='ligature'">
59
            <xsl:element name="span">
60
               <xsl:choose>
61
                  <xsl:when test="$parm-leiden-style=('petrae','iospe')">
62
                     <xsl:attribute name="class">petraeligature</xsl:attribute>
63
                  </xsl:when>
64
                  <xsl:otherwise>
65
                     <xsl:attribute name="class">ligature</xsl:attribute>
66
                  </xsl:otherwise>
67
               </xsl:choose>
68
               <xsl:attribute name="title">Ligature: these characters are joined</xsl:attribute>
69
               <xsl:apply-imports/>
70
            </xsl:element>
71
         </xsl:when>
72
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
73
         <!-- @rend='normal'                                                     -->
74
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
75
         <xsl:when test="@rend='normal'">
76
            <xsl:element name="span">
77
               <xsl:attribute name="class">normal</xsl:attribute>
78
               <xsl:apply-templates/>
79
            </xsl:element>
80
         </xsl:when>
81
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
82
         <!-- @rend='plain'                                                      -->
83
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
84
         <xsl:when test="@rend='plain'">
85
             <xsl:element name="span">
86
                 <xsl:attribute name="class">plain</xsl:attribute>
87
                 <xsl:apply-templates/>
88
             </xsl:element>
89
         </xsl:when>
90
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
91
         <!-- @rend='reversed'                                                   -->
92
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
93
         <xsl:when test="@rend='reversed'">
94
            <xsl:element name="span">
95
               <xsl:attribute name="class">reversed</xsl:attribute>
96
               <xsl:attribute name="title">reversed: <xsl:value-of select="."/>
97
               </xsl:attribute> ((<xsl:apply-templates/>)) </xsl:element>
98
         </xsl:when>
99
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
100
         <!-- @rend='small'                                                      -->
101
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
102
         <xsl:when test="@rend='small'">
103
            <xsl:element name="span">
104
               <xsl:attribute name="class">small</xsl:attribute>
105
               <xsl:attribute name="title">small character: <xsl:value-of select="."/>
106
               </xsl:attribute>
107
               <xsl:apply-templates/>
108
            </xsl:element>
109
         </xsl:when>
110
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
111
         <!-- @rend='strong'                                                     -->
112
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
113
         <xsl:when test="@rend='strong'">
114
            <xsl:element name="strong">
115
               <xsl:apply-templates/>
116
            </xsl:element>
117
         </xsl:when>
118
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
119
         <!-- @rend='subscript'                                                  -->
120
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
121
         <xsl:when test="@rend='subscript'">
122
            <xsl:choose>
123
                <xsl:when test="$parm-leiden-style = 'ddbdp' or $parm-leiden-style = 'sammelbuch'">
124
                  <span style="vertical-align:sub;">
125
                     <xsl:apply-imports/>
126
                  </span>
127
               </xsl:when>
128
               <xsl:otherwise>
129
                  <!-- To be decided -->
130
                  <xsl:apply-templates/>
131
               </xsl:otherwise>
132
            </xsl:choose>
133
         </xsl:when>
134
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
135
         <!-- @rend='superscript'                                                -->
136
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
137
         <xsl:when test="@rend='superscript'">
138
            <xsl:choose>
139
                <xsl:when test="$parm-leiden-style = 'ddbdp' or $parm-leiden-style = 'sammelbuch'">
140
                  <span style="vertical-align:super;">
141
                     <xsl:apply-imports/>
142
                  </span>
143
               </xsl:when>
144
               <xsl:otherwise>
145
                  <xsl:element name="sup">
146
                     <xsl:apply-templates/>
147
                  </xsl:element>
148
               </xsl:otherwise>
149
            </xsl:choose>
150
         </xsl:when>
151
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
152
         <!-- @rend='supraline'                                                  -->
153
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
154
         <!-- I wonder if this should be "overline" to match css practice? TE -->
155
         <xsl:when test="@rend='supraline'">
156
            <xsl:element name="span">
157
               <xsl:attribute name="class">supraline</xsl:attribute>
158
               <xsl:attribute name="title">line above</xsl:attribute>
159
               <xsl:apply-templates/>
160
            </xsl:element>
161
         </xsl:when>
162
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
163
         <!-- @rend='tall'                                                       -->
164
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
165
         <xsl:when test="@rend='tall'">
166
            <xsl:element name="span">
167
               <xsl:attribute name="class">tall</xsl:attribute>
168
               <xsl:attribute name="title">tall character: <xsl:value-of select="."/>
169
               </xsl:attribute>
170
               <xsl:apply-templates/>
171
            </xsl:element>
172
         </xsl:when>
173
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
174
         <!-- @rend='underline'                                                  -->
175
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
176
         <xsl:when test="@rend='underline'">
177
            <xsl:element name="span">
178
               <xsl:attribute name="class">underline</xsl:attribute>
179
               <xsl:apply-templates/>
180
            </xsl:element>
181
         </xsl:when>
182
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
183
         <!-- UNTRAPPED REND VALUE                                               -->
184
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
185
         <xsl:otherwise>
186
            <xsl:element name="span">
187
               <xsl:attribute name="class">error</xsl:attribute>
188
               <xsl:attribute name="title">
189
                  <xsl:text>hi tag with rend=</xsl:text>
190
                  <xsl:value-of select="@rend"/>
191
                  <xsl:text> is not supported!</xsl:text>
192
               </xsl:attribute>
193
               <xsl:apply-templates/>
194
            </xsl:element>
195
         </xsl:otherwise>
196
      </xsl:choose>
197
   </xsl:template>
198

    
199
</xsl:stylesheet>
(17-17/95)