Statistics
| Revision:

root / tmp / org.txm.oriflamms.rcp / res / oriflamms-convert-graalc-oriflammsxml.xsl @ 476

History | View | Annotate | Download (21.8 kB)

1
<?xml version="1.0"?>
2
<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
3
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
4
  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
5
  xmlns:txm="http://textometrie.org/1.0"
6
  exclude-result-prefixes="tei edate xd txm" version="2.0">
7

    
8
  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="no"/>
9
  
10
  <xd:doc type="stylesheet">
11
    <xd:short>
12
      Cette feuille permet de convertir la transcription compacte de la 
13
      Queste del saint Graal au format XML-TEI du projet Oriflamms.
14
    </xd:short>
15
    <xd:detail>
16
      This stylesheet is free software; you can redistribute it and/or
17
      modify it under the terms of the GNU Lesser General Public
18
      License as published by the Free Software Foundation; either
19
      version 3 of the License, or (at your option) any later version.
20
      
21
      This stylesheet is distributed in the hope that it will be useful,
22
      but WITHOUT ANY WARRANTY; without even the implied warranty of
23
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
24
      Lesser General Public License for more details.
25
      
26
      You should have received a copy of GNU Lesser Public License with
27
      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
28
    </xd:detail>
29
    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
30
    <xd:copyright>2014, CNRS / ICAR (Équipe CACTUS)</xd:copyright>
31
  </xd:doc>
32
  
33
  <xsl:template match="/">
34
    <xsl:apply-templates/>
35
  </xsl:template>
36
  
37
  
38
  <xsl:template match="*">
39
        <xsl:copy>
40
          <xsl:apply-templates select="@*"/>
41
          <xsl:apply-templates select="*|processing-instruction()|comment()|text()"/>
42
        </xsl:copy>
43
  </xsl:template>
44

    
45
  <xsl:template match="comment()|text()">
46
    <xsl:copy/>
47
  </xsl:template>
48
  
49
  <xsl:template match="processing-instruction()"></xsl:template>
50

    
51
  <!-- On supprime les attributs par défaut de la DTD TEI -->
52
  
53
  <xsl:template match="@*">
54
    <xsl:choose>
55
      <xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/>
56
      <xsl:when test="matches(name(.),'rend')">
57
        <xsl:choose>
58
          <xsl:when test="matches(.,'^aggl$')"><xsl:attribute name="rend">space-after(none)</xsl:attribute></xsl:when>
59
          <xsl:otherwise><xsl:copy/></xsl:otherwise>
60
        </xsl:choose>
61
      </xsl:when>
62
      <xsl:otherwise><xsl:copy/></xsl:otherwise>
63
    </xsl:choose>
64
  </xsl:template>
65

    
66
  <xsl:template match="tei:teiHeader">    
67
      <xsl:copy>
68
        <xsl:apply-templates select="@*"/>
69
        <xsl:apply-templates/>
70
      </xsl:copy>    
71
  </xsl:template>
72

    
73
<xsl:template match="tei:revisionDesc">
74
  <xsl:copy>
75
  <xsl:apply-templates select="@*"/>
76
  <change xmlns="http://www.tei-c.org/ns/1.0" when="{format-date(current-date(),'[Y]-[M01]-[D01]')}" who="#auto">Conversion automatique au format XML-TEI-Oriflamms</change>
77
  <xsl:apply-templates/>
78
  </xsl:copy>
79
</xsl:template>
80
  
81
  <xsl:template match="tei:encodingDesc">
82
    <xsl:copy>
83
      <xsl:apply-templates select="@*"/>
84
      <xsl:apply-templates/>
85
      <xsl:if test="not(//tei:prefixDef[@ident='ori'])">
86
        <listPrefixDef xmlns="http://www.tei-c.org/ns/1.0">
87
          <prefixDef xmlns="http://www.tei-c.org/ns/1.0" ident="ori" 
88
            matchPattern="([a-z]+)" 
89
            replacementPattern="oriflamms-annotation-scheme.xml#$1">
90
            <p>In the context of this project, private URIs with the prefix
91
              "ori" point to <gi>interp</gi> elements in the project's
92
              oriflamms-annotation-scheme.xml file.
93
            </p>
94
          </prefixDef>
95
        </listPrefixDef>
96
      </xsl:if>
97
    </xsl:copy>
98
  </xsl:template>
99

    
100

    
101
<xsl:template match="tei:cb[@rend='hidden']">
102
  <xsl:comment>cb factice supprimé</xsl:comment>
103
</xsl:template>
104

    
105
<xsl:template match="tei:note|tei:supplied[not(descendant::tei:lb)]">
106
  <xsl:copy>
107
    <xsl:apply-templates select="@*"/>
108
    <xsl:attribute name="ana">
109
      <xsl:if test="@ana"><xsl:value-of select="concat(@ana,' ')"/></xsl:if>
110
      <xsl:text>ori:align-no</xsl:text>
111
    </xsl:attribute>
112
    <xsl:apply-templates/>
113
  </xsl:copy>
114
</xsl:template>
115
  
116
  <xsl:template match="tei:supplied[descendant::tei:lb]">
117
    <xsl:comment>Ajout éditorial supprimé.</xsl:comment>
118
  </xsl:template>
119

    
120
<!--<xsl:template match="tei:pb[not(preceding-sibling::*[1][self::tei:milestone[@unit='surface']] or ancestor::tei:supplied)]">
121
  <milestone xmlns="http://www.tei-c.org/ns/1.0" unit="surface" facs="{@facs}"/>
122
  <xsl:copy>
123
    <xsl:apply-templates select="@*"/>
124
  </xsl:copy>
125
</xsl:template>-->
126

    
127
<xsl:template match="tei:w[matches(@type,'^PON')]">
128
  <pc xmlns="http://www.tei-c.org/ns/1.0">
129
    <xsl:apply-templates select="@*"/>
130
    <xsl:analyze-string select="." regex="^(.*)%(.*)%(.*)$">
131
      <xsl:matching-substring>
132
        <xsl:choose>
133
          <xsl:when test="matches(regex-group(3),'^$')">
134
            <xsl:attribute name="ana">ori:align-no</xsl:attribute>
135
            <reg xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no"><xsl:value-of select="regex-group(1)"/></reg>
136
          </xsl:when>
137
          <xsl:when test="matches(regex-group(1),'^$')">
138
            <orig xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="regex-group(3)"/></orig>
139
          </xsl:when>
140
          <xsl:otherwise>
141
            <choice xmlns="http://www.tei-c.org/ns/1.0">
142
              <reg xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no"><xsl:value-of select="regex-group(1)"/></reg>
143
              <orig xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="regex-group(3)"/></orig>
144
            </choice>
145
          </xsl:otherwise>
146
        </xsl:choose>        
147
      </xsl:matching-substring>
148
      <xsl:non-matching-substring><xsl:value-of select="."/></xsl:non-matching-substring>
149
    </xsl:analyze-string>
150
  </pc>
151
</xsl:template>
152

    
153
  <xsl:template match="tei:orig">
154
    <xsl:apply-templates/>
155
  </xsl:template>
156

    
157

    
158

    
159
  <xsl:template match="tei:w[not(matches(@type,'^PON'))]//text()|tei:del[not(ancestor::tei:w or descendant::tei:w)]//text()">
160
    <xsl:choose>
161
      <xsl:when test="matches(.,'^\s*$')"><xsl:copy/></xsl:when>
162
      <xsl:otherwise>
163
        <xsl:analyze-string select="." regex="#?\*[ijuvIJUVí]|#[A-Za-zÀ-ÿſ]|\{{\{{[^}}]+\}}\}}|#?\(\([^)]+\)\).?|_">
164
          <xsl:matching-substring>
165
            <xsl:choose>
166
              <xsl:when test="matches(.,'\(\(')">
167
                <xsl:analyze-string select="." regex="^#?\(\(([^\)]+)\)\)(.?)$">
168
                  <xsl:matching-substring>
169
                    <xsl:variable name="capitalize">
170
                      <xsl:choose>
171
                        <xsl:when test="matches(.,'^#') or matches(.,'_#')">yes</xsl:when>
172
                        <xsl:otherwise>no</xsl:otherwise>
173
                      </xsl:choose>
174
                    </xsl:variable>
175
                    <xsl:variable name="nextLetter"><xsl:value-of select="regex-group(2)"/></xsl:variable>
176
                    <xsl:variable name="abbrexpan">
177
                      <xsl:value-of select="replace(regex-group(1),'#','')"/>
178
                      <!--<xsl:value-of select="regex-group(1)"/>-->
179
                    </xsl:variable>
180
                    
181
                    <xsl:variable name="abbr">
182
                      <xsl:choose>
183
                        <xsl:when test="matches($abbrexpan,'_')"><xsl:value-of select="substring-before($abbrexpan,'_')"/></xsl:when>
184
                        <xsl:when test="matches($abbrexpan,'^#?(.&#x0305;|.&#x0363;|.&#x0364;|.&#x0365;|bn&#x0305;|ch&#x02BC;&#xA75B;|ch&#x0305;&#xA75B;|ch&#xA75B;&#x0305;|gn&#x0363;t|qn&#x0363;t|&#x035B;|&#x1DD1;|&#x204A;|&#x223B;|&#xA76F;|&#xA770;|&#xF153;|&#xF158;|&#xF1C8;)$')">
185
                          <xsl:value-of select="$abbrexpan"/>
186
                        </xsl:when>
187
                        <xsl:otherwise>xxx</xsl:otherwise>
188
                      </xsl:choose>
189
                    </xsl:variable>
190
                    <xsl:variable name="expannocap" as="element()">
191
                      <expan xmlns="http://www.tei-c.org/ns/1.0">
192
                        <xsl:choose>
193
                          <xsl:when test="matches($abbrexpan,'_')">
194
                            <xsl:analyze-string select="substring-after($abbrexpan,'_')" regex="\[([^\]]+)\]">
195
                              <xsl:matching-substring>
196
                                <ex xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="regex-group(1)"/></ex>
197
                              </xsl:matching-substring>
198
                              <xsl:non-matching-substring>
199
                                <xsl:copy/>
200
                              </xsl:non-matching-substring>
201
                            </xsl:analyze-string>
202
                          </xsl:when>
203
                          <xsl:when test="matches($abbrexpan,'^bn&#x0305;$')">b<ex xmlns="http://www.tei-c.org/ns/1.0">ie</ex>n</xsl:when>
204
                          <xsl:when test="matches($abbrexpan,'^(ch&#x02BC;&#xA75B;|ch&#x0305;&#xA75B;|ch&#xA75B;&#x0305;)$')">ch<ex xmlns="http://www.tei-c.org/ns/1.0">evalie</ex>r</xsl:when>
205
                          <xsl:when test="matches($abbrexpan,'gn&#x0363;t')">g<ex xmlns="http://www.tei-c.org/ns/1.0">r</ex><c xmlns="http://www.tei-c.org/ns/1.0" rend="position(combsup)">a</c>nt</xsl:when>
206
                          <xsl:when test="matches($abbrexpan,'qn&#x0363;t')">q<ex xmlns="http://www.tei-c.org/ns/1.0">u</ex><c xmlns="http://www.tei-c.org/ns/1.0" rend="position(combsup)">a</c>nt</xsl:when>
207
                          <xsl:when test="matches($abbrexpan,'.&#x0305;$')">
208
                            <xsl:value-of select="substring($abbrexpan,1,1)"/>
209
                            <xsl:choose>
210
                              <xsl:when test="matches($abbrexpan,'^[aeiou]') and matches($nextLetter,'[bmnp]')"><ex xmlns="http://www.tei-c.org/ns/1.0">m</ex></xsl:when>
211
                              <xsl:when test="matches($abbrexpan,'^[aeiou]')"><ex xmlns="http://www.tei-c.org/ns/1.0">n</ex></xsl:when>
212
                              <xsl:when test="matches($abbrexpan,'^[q]')"><ex xmlns="http://www.tei-c.org/ns/1.0">ue</ex></xsl:when>
213
                              <xsl:when test="matches($abbrexpan,'^[p]')"><ex xmlns="http://www.tei-c.org/ns/1.0">re</ex></xsl:when>
214
                              <xsl:otherwise>‹bar›</xsl:otherwise>
215
                            </xsl:choose>
216
                          </xsl:when>
217
                          <xsl:when test="matches($abbrexpan,'.&#x0363;')">
218
                            <xsl:value-of select="substring($abbrexpan,1,1)"/>
219
                            <xsl:choose>
220
                              <xsl:when test="matches($abbrexpan,'^[Qq]')"><ex xmlns="http://www.tei-c.org/ns/1.0">u</ex></xsl:when>
221
                              <xsl:otherwise><ex xmlns="http://www.tei-c.org/ns/1.0">r</ex></xsl:otherwise>
222
                            </xsl:choose>
223
                            <c xmlns="http://www.tei-c.org/ns/1.0" rend="position(combsup)">a</c>
224
                          </xsl:when>
225
                          <xsl:when test="matches($abbrexpan,'.&#x0364;')">
226
                            <xsl:value-of select="substring($abbrexpan,1,1)"/>
227
                            <xsl:choose>
228
                              <xsl:when test="matches($abbrexpan,'^[Qq]')"><ex xmlns="http://www.tei-c.org/ns/1.0">u</ex></xsl:when>
229
                              <xsl:otherwise><ex xmlns="http://www.tei-c.org/ns/1.0">r</ex></xsl:otherwise>
230
                            </xsl:choose>
231
                            <c xmlns="http://www.tei-c.org/ns/1.0" rend="position(combsup)">e</c>
232
                          </xsl:when>
233
                          <xsl:when test="matches($abbrexpan,'.&#x0365;')">
234
                            <xsl:value-of select="substring($abbrexpan,1,1)"/>
235
                            <xsl:choose>
236
                              <xsl:when test="matches($abbrexpan,'^[Qq]')"><ex xmlns="http://www.tei-c.org/ns/1.0">u</ex></xsl:when>
237
                              <xsl:otherwise><ex xmlns="http://www.tei-c.org/ns/1.0">r</ex></xsl:otherwise>
238
                            </xsl:choose>
239
                            <c xmlns="http://www.tei-c.org/ns/1.0" rend="position(combsup)">i</c>
240
                          </xsl:when>
241
                          <xsl:when test="matches($abbrexpan,'&#xA76F;') and matches($nextLetter,'[bmnp]')">
242
                            <ex xmlns="http://www.tei-c.org/ns/1.0">com</ex>
243
                          </xsl:when>
244
                          <xsl:when test="matches($abbrexpan,'&#xA76F;')">
245
                            <ex xmlns="http://www.tei-c.org/ns/1.0">con</ex>
246
                          </xsl:when>
247
                          <xsl:when test="matches($abbrexpan,'&#x035B;|&#xF1C8;')">
248
                            <ex xmlns="http://www.tei-c.org/ns/1.0">er</ex>
249
                          </xsl:when>
250
                          <xsl:when test="matches($abbrexpan,'&#x204A;|&#xF158;')">
251
                            <ex xmlns="http://www.tei-c.org/ns/1.0">et</ex>
252
                          </xsl:when>
253
                          <xsl:when test="matches($abbrexpan,'&#x1DD1;|&#xF153;')">
254
                            <ex xmlns="http://www.tei-c.org/ns/1.0">ur</ex>
255
                          </xsl:when>
256
                          <xsl:when test="matches($abbrexpan,'&#xA770;')">
257
                            <ex xmlns="http://www.tei-c.org/ns/1.0">us</ex>
258
                          </xsl:when>
259
                          <xsl:otherwise>
260
                            <ex xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="$abbrexpan"/></ex><!--<xsl:comment>Unknown expan!</xsl:comment>-->
261
                          </xsl:otherwise>
262
                        </xsl:choose></expan>
263
                    </xsl:variable>
264
                    <xsl:variable name="expan">
265
                      <xsl:choose>
266
                        <xsl:when test="$capitalize eq 'yes'">
267
                          <expan xmlns="http://www.tei-c.org/ns/1.0">
268
                            <xsl:for-each select="$expannocap/node()">
269
                              <xsl:choose>
270
                                <xsl:when test="self::text()[not(preceding-sibling::*)]">
271
                                  <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-small"><xsl:value-of select="upper-case(substring(.,1,1))"/></g><xsl:value-of select="substring(.,2)"/>
272
                                </xsl:when>
273
                                <xsl:when test="self::*[not(preceding-sibling::text())]">
274
                                  <xsl:copy><g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-small"><xsl:value-of select="upper-case(substring(.,1,1))"/></g><xsl:value-of select="substring(.,2)"/></xsl:copy>
275
                                </xsl:when>
276
                                <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
277
                              </xsl:choose>
278
                            </xsl:for-each>
279
                          </expan>
280
                        </xsl:when>
281
                        <xsl:otherwise><xsl:copy-of select="$expannocap"/></xsl:otherwise>
282
                      </xsl:choose>
283
                    </xsl:variable>
284
                    <xsl:choose>
285
                      <xsl:when test="matches($abbr,'.+')">
286
                        <choice xmlns="http://www.tei-c.org/ns/1.0">
287
                          <abbr xmlns="http://www.tei-c.org/ns/1.0"><xsl:copy-of select="$abbr"/></abbr>
288
                          <xsl:copy-of select="$expan"/>
289
                        </choice>
290
                      </xsl:when>
291
                      <xsl:otherwise><xsl:copy-of select="$expan"/><!--<xsl:comment>Unknown abbr!</xsl:comment>--></xsl:otherwise>
292
                    </xsl:choose>
293
                    <xsl:value-of select="$nextLetter"/>
294
                  </xsl:matching-substring>
295
                  <xsl:non-matching-substring><xsl:copy-of select="."/><!--<xsl:comment>Unknown abbr-expan!</xsl:comment>--></xsl:non-matching-substring>
296
                </xsl:analyze-string>
297
              </xsl:when>
298
              <xsl:when test="matches(.,'#\*([ij])')">
299
                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-j"><xsl:value-of select="upper-case(regex-group(1))"/></g>
300
              </xsl:when>
301
              <xsl:when test="matches(.,'#\*([uv])')">
302
                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-v"><xsl:value-of select="upper-case(regex-group(1))"/></g>
303
              </xsl:when>
304
              <xsl:when test="matches(.,'\*í')">
305
                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-i ori:facs-iacute">j</g>
306
              </xsl:when>
307
              <xsl:when test="matches(.,'\*([ij])')">
308
                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-j"><xsl:value-of select="regex-group(1)"/></g>
309
              </xsl:when>
310
              <xsl:when test="matches(.,'\*([uv])')">
311
                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-v"><xsl:value-of select="regex-group(1)"/></g>
312
              </xsl:when>
313
              <xsl:when test="matches(.,'#\*([IJ])')">
314
                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-I"><xsl:value-of select="lower-case(regex-group(1))"/></g>
315
              </xsl:when>
316
              <xsl:when test="matches(.,'#\*([UV])')">
317
                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-V"><xsl:value-of select="lower-case(regex-group(1))"/></g>
318
              </xsl:when>
319
              <xsl:when test="matches(.,'\*([IJ])')">
320
                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-I"><xsl:value-of select="regex-group(1)"/></g>
321
              </xsl:when>
322
              <xsl:when test="matches(.,'\*([UV])')">
323
                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-V"><xsl:value-of select="regex-group(1)"/></g>
324
              </xsl:when>
325
              <xsl:when test="matches(.,'#ſ')">
326
                <xsl:analyze-string select="." regex="^#(.)">
327
                  <xsl:matching-substring>
328
                    <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-caps ori:facs-slong">S</g>
329
                  </xsl:matching-substring>
330
                </xsl:analyze-string>
331
              </xsl:when>
332
              <!--  -->
333
<!--              <xsl:when test="matches(.,'#')">
334
                <xsl:analyze-string select="." regex="^#(.)">
335
                  <xsl:matching-substring>
336
                    <choice xmlns="http://www.tei-c.org/ns/1.0">
337
                      <abbr xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="regex-group(1)"/></abbr>
338
                      <expan xmlns="http://www.tei-c.org/ns/1.0"><ex xmlns="http://www.tei-c.org/ns/1.0"><g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-small">E</g>t</ex></expan>
339
                    </choice>
340
                  </xsl:matching-substring>
341
                </xsl:analyze-string>
342
              </xsl:when>              -->
343
              <xsl:when test="matches(.,'#[A-Z]')">
344
                <xsl:analyze-string select="." regex="^#(.)">
345
                  <xsl:matching-substring>
346
                    <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-caps"><xsl:value-of select="lower-case(regex-group(1))"/></g>
347
                  </xsl:matching-substring>
348
                </xsl:analyze-string>
349
              </xsl:when>
350
              <xsl:when test="matches(.,'#[^(]')">
351
                <xsl:analyze-string select="." regex="^#(.+)$">
352
                  <xsl:matching-substring>
353
                    <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-small"><xsl:value-of select="upper-case(regex-group(1))"/></g>
354
                  </xsl:matching-substring>
355
                </xsl:analyze-string>
356
              </xsl:when>
357
              <xsl:when test="matches(.,'\{\{([^}}]+)\}\}')">
358
                <xsl:analyze-string select="." regex="^\{{\{{([^:]*):([^:]*):([^:]*):([^:]*):?([^:]*)\}}\}}$">
359
                  <xsl:matching-substring>
360
                    <xsl:variable name="lettrine"><xsl:value-of select="regex-group(1)"/></xsl:variable>
361
                    <xsl:variable name="size"><xsl:value-of select="regex-group(2)"/></xsl:variable>
362
                    <xsl:variable name="sizeAct"><xsl:value-of select="regex-group(3)"/></xsl:variable>
363
                    <xsl:variable name="color"><xsl:value-of select="regex-group(4)"/></xsl:variable>
364
                    <xsl:variable name="deco"><xsl:value-of select="regex-group(5)"/></xsl:variable>
365
                    <xsl:variable name="rend">
366
                      <xsl:value-of select="concat('size(',$size,')')"/>
367
                      <xsl:if test="matches($sizeAct,'.+')"><xsl:value-of select="concat(' sizeAct(',$sizeAct,')')"/></xsl:if>
368
                      <xsl:if test="matches($color,'.+')"><xsl:value-of select="concat(' color(',$color,')')"/></xsl:if>
369
                      <xsl:if test="matches($deco,'.+')"><xsl:value-of select="concat(' deco(',$deco,')')"/></xsl:if>
370
                    </xsl:variable>
371
                    <g xmlns="http://www.tei-c.org/ns/1.0" type="lettrine" rend="{$rend}"><xsl:value-of select="$lettrine"/></g>
372
                  </xsl:matching-substring>
373
                </xsl:analyze-string>
374
              </xsl:when>
375
              
376
              <xsl:when test="matches(.,'__')">
377
                <space xmlns="http://www.tei-c.org/ns/1.0" ana="ori:figement"/>
378
              </xsl:when>
379
              <xsl:when test="matches(.,'_')">
380
                <space xmlns="http://www.tei-c.org/ns/1.0"/>
381
              </xsl:when>              
382
              <xsl:otherwise>Match: <xsl:copy/></xsl:otherwise>
383
            </xsl:choose>
384
          </xsl:matching-substring>
385
          <xsl:non-matching-substring>
386
            <xsl:copy/>
387
          </xsl:non-matching-substring>
388
        </xsl:analyze-string>
389
      </xsl:otherwise>
390
    </xsl:choose>
391
  </xsl:template>
392
  
393

    
394

    
395
</xsl:stylesheet>