Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- $Id: teispace.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
   xmlns:EDF="http://epidoc.sourceforge.net/ns/functions"
6
  
7
   exclude-result-prefixes="t EDF" version="2.0">
8
   <!-- Found in [htm|txt]-teispace.xsl -->
9

    
10
   <xsl:template match="t:space">
11
       <xsl:param name="parm-edition-type" tunnel="yes" required="no"></xsl:param>
12
       <xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
13
       <!-- function EDF:f-wwrap declared in htm-teilb.xsl; tests if lb break=no immediately follows space -->
14
      <xsl:if test="EDF:f-wwrap(.) = true()">
15
         <xsl:text>- </xsl:text>
16
      </xsl:if>
17
      <xsl:choose>
18
          <xsl:when test="$parm-edition-type = 'diplomatic'">
19
            <xsl:choose>
20
               <xsl:when test="@unit='line'">
21
                  <xsl:text>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;</xsl:text>
22
                  <xsl:call-template name="dip-space"/>
23
               </xsl:when>
24
               <xsl:when test="@unit='character' or not(@unit)">
25
                  <xsl:variable name="sp-ext">
26
                     <xsl:choose>
27
                        <xsl:when test="@quantity">
28
                           <xsl:number value="@quantity"/>
29
                        </xsl:when>
30
                        <xsl:when test="number(@extent)">
31
                           <xsl:number value="@extent"/>
32
                        </xsl:when>
33
                        <xsl:otherwise>
34
                           <xsl:number value="3"/>
35
                        </xsl:otherwise>
36
                     </xsl:choose>
37
                  </xsl:variable>
38
                  <xsl:for-each select="1 to $sp-ext">
39
                     <xsl:text>&#xa0;&#xa0;</xsl:text>
40
                  </xsl:for-each>
41
               </xsl:when>
42
               <xsl:otherwise/>
43
            </xsl:choose>
44
         </xsl:when>
45

    
46
         <xsl:otherwise>
47
            <xsl:choose>
48
                <xsl:when test="($parm-leiden-style = 'ddbdp' or $parm-leiden-style = 'sammelbuch')">
49
                  <xsl:text> vac. </xsl:text>
50
                  <xsl:choose>
51
                     <xsl:when test="@quantity">
52
                        <xsl:if test="@precision='low'">
53
                           <xsl:text>ca. </xsl:text>
54
                        </xsl:if>
55
                        <xsl:value-of select="@quantity"/>
56
                     </xsl:when>
57
                     <xsl:when test="@atLeast and @atMost">
58
                        <xsl:value-of select="@atLeast"/>
59
                        <xsl:text>-</xsl:text>
60
                        <xsl:value-of select="@atMost"/>
61
                     </xsl:when>
62
                     <xsl:when test="@atLeast ">
63
                        <xsl:text>&#x2265;</xsl:text>
64
                        <xsl:value-of select="@atLeast"/>
65
                     </xsl:when>
66
                     <xsl:when test="@atMost ">
67
                        <xsl:text>&#x2264;</xsl:text>
68
                        <xsl:value-of select="@atMost"/>
69
                     </xsl:when>
70
                     <xsl:otherwise>
71
                        <xsl:text>?</xsl:text>
72
                     </xsl:otherwise>
73
                  </xsl:choose>
74
                  <xsl:if test="@unit='line'">
75
                        <xsl:text> line</xsl:text>
76
                        <xsl:if test="@quantity > 1 or @extent='unknown' or @atLeast or @atMost">
77
                           <xsl:text>s</xsl:text>
78
                        </xsl:if>
79
                     </xsl:if>
80
                  
81
                  <xsl:if test="child::t:certainty[@match='..']">
82
                     <xsl:text>(?)</xsl:text>
83
                  </xsl:if>
84
               </xsl:when>
85
               
86
                <xsl:when test="$parm-leiden-style='london'">
87
                  <xsl:choose>
88
                     <xsl:when test="@extent = 'unknown'">
89
                        <!-- Found in [htm|txt]-teispace.xsl -->
90
                        <xsl:call-template name="space-content">
91
                           <xsl:with-param name="vacat" select="' vac '"/>
92
                        </xsl:call-template>
93
                     </xsl:when>
94
                     <xsl:when test="@quantity = string(1) and @unit='character'">
95
                        <xsl:call-template name="space-content">
96
                           <xsl:with-param name="vacat" select="' v '"/>
97
                        </xsl:call-template>
98
                     </xsl:when>
99
                     <xsl:when test="@quantity = string(2) and @unit='character'">
100
                        <xsl:call-template name="space-content">
101
                           <xsl:with-param name="vacat" select="' vv '"/>
102
                        </xsl:call-template>
103
                     </xsl:when>
104
                     <xsl:when test="contains('345', @quantity) and @unit='character'">
105
                        <!-- Found in [htm|txt]-teispace.xsl -->
106
                        <xsl:call-template name="space-content">
107
                           <xsl:with-param name="vacat" select="' vac '"/>
108
                        </xsl:call-template>
109
                     </xsl:when>
110
                     <xsl:when test="@quantity &gt;= 6 and @unit='character'">
111
                        <xsl:call-template name="space-content">
112
                           <xsl:with-param name="vacat" select="' vacat '"/>
113
                        </xsl:call-template>
114
                     </xsl:when>
115
                     <xsl:when test="@unit='line'">
116
                        <xsl:text>&#160;&#160;&#160;&#160;&#160;</xsl:text>
117
                        <xsl:call-template name="space-content">
118
                           <xsl:with-param name="vacat" select="' vacat '"/>
119
                        </xsl:call-template>
120
                     </xsl:when>
121
                     <xsl:otherwise>
122
                        <xsl:call-template name="space-content">
123
                           <xsl:with-param name="vacat" select="' vac '"/>
124
                        </xsl:call-template>
125
                     </xsl:otherwise>
126
                  </xsl:choose>
127
               </xsl:when>
128

    
129
                <xsl:when test="$parm-leiden-style='iospe'">
130
                  <xsl:variable name="vacat" select="' vac. '"/>
131
                  <xsl:choose>
132
                     <xsl:when test="@quantity and @unit='character'">
133
                        <xsl:call-template name="space-content">
134
                           <xsl:with-param name="vacat" select="$vacat"/>
135
                           <xsl:with-param name="extent" select="concat(@quantity,' litt. ')"/>
136
                        </xsl:call-template>
137
                     </xsl:when>
138
                     <xsl:when test="@unit='character'">
139
                        <xsl:call-template name="space-content">
140
                           <xsl:with-param name="vacat" select="$vacat"/>
141
                        </xsl:call-template>
142
                     </xsl:when>
143
                     <xsl:otherwise>
144
                        <xsl:call-template name="space-content">
145
                           <xsl:with-param name="vacat" select="$vacat"/>
146
                        </xsl:call-template>
147
                     </xsl:otherwise>
148
                  </xsl:choose>
149
               </xsl:when>
150

    
151
                <xsl:when test="$parm-leiden-style='panciera'">
152
                  <xsl:variable name="precision">
153
                     <xsl:if test="@precision = 'low'">?</xsl:if>
154
                  </xsl:variable>
155

    
156
                  <xsl:choose>
157
                     <xsl:when test="@extent = 'unknown'">
158
                        <!-- Found in [htm|txt]-teispace.xsl -->
159
                        <xsl:call-template name="space-content">
160
                           <xsl:with-param name="vacat" select="' vac. '"/>
161
                        </xsl:call-template>
162
                     </xsl:when>
163
                     <xsl:when test="@quantity and @unit='character'">
164
                        <xsl:call-template name="space-content">
165
                           <xsl:with-param name="vacat"><xsl:text> vac. </xsl:text></xsl:with-param>
166
                           <xsl:with-param name="extent">
167
                              <xsl:value-of select="@quantity"/>
168
                              <xsl:value-of select="$precision"/>
169
                           </xsl:with-param>
170
                        </xsl:call-template>
171
                     </xsl:when>
172
                     <xsl:when test="@quantity and @unit='line'">
173
                        <xsl:call-template name="space-content">
174
                        <!-- Found in [htm|txt]-teispace.xsl -->
175
                           <xsl:with-param name="vacat"><xsl:text> vac. </xsl:text></xsl:with-param>
176
                           <xsl:with-param name="extent">
177
                              <xsl:value-of select="@quantity"/>
178
                              <xsl:text> line</xsl:text>
179
                              <xsl:if test="@quantity > 1">
180
                                 <xsl:text>s</xsl:text>
181
                              </xsl:if>
182
                              <xsl:value-of select="$precision"/>
183
                           </xsl:with-param>
184
                        </xsl:call-template>
185
                     </xsl:when>
186
                     <xsl:when test="@quantity and @unit != 'line' and @unit != 'character'">
187
                        <xsl:call-template name="space-content">
188
                           <xsl:with-param name="vacat"><xsl:text> vac. </xsl:text></xsl:with-param>
189
                           <xsl:with-param name="extent">
190
                              <xsl:value-of select="@quantity"/>
191
                              <xsl:text> </xsl:text>
192
                              <xsl:value-of select="@unit"/>
193
                              <xsl:value-of select="$precision"/>
194
                           </xsl:with-param>
195
                        </xsl:call-template>
196
                     </xsl:when>
197
                     <xsl:otherwise>
198
                        <xsl:call-template name="space-content">
199
                           <xsl:with-param name="vacat" select="' vac. '"/>
200
                        </xsl:call-template>
201
                     </xsl:otherwise>
202
                  </xsl:choose>
203
               </xsl:when>
204

    
205
               <xsl:otherwise>
206
                  <xsl:call-template name="space-content">
207
                     <xsl:with-param name="vacat" select="' vac. '"/>
208
                  </xsl:call-template>
209
               </xsl:otherwise>
210
            </xsl:choose>
211
         </xsl:otherwise>
212
      </xsl:choose>
213
   </xsl:template>
214

    
215
   <!-- Called from [htm|txt]-teispace.xsl -->
216
   <xsl:template name="space-content-1">
217
      <xsl:param name="vacat"/>
218
      <xsl:if test="child::t:certainty[starts-with(@match,'..')]">
219
         <xsl:text>(?)</xsl:text>
220
      </xsl:if>
221
      <xsl:value-of select="$vacat"/>
222
   </xsl:template>
223

    
224

    
225
   <!-- Called from [htm|txt]-teispace.xsl -->
226
   <xsl:template name="space-content-2">
227
       <xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
228
       <xsl:param name="vacat"/>
229
      <xsl:param name="extent"/>
230
       <xsl:if test="$parm-leiden-style='panciera'"><xsl:text>(</xsl:text></xsl:if>
231
      <xsl:value-of select="$vacat"/>
232
      <xsl:if test="child::t:certainty[starts-with(@match,'..')]">
233
         <xsl:text>(?)</xsl:text>
234
      </xsl:if>
235
      <xsl:if test="string-length($extent) &gt; 0">
236
         <xsl:text> </xsl:text>
237
         <xsl:value-of select="$extent"/>
238
      </xsl:if>
239
       <xsl:if test="$parm-leiden-style='panciera'"><xsl:text>)</xsl:text></xsl:if>
240
   </xsl:template>
241

    
242
</xsl:stylesheet>
(68-68/95)