Statistics
| Revision:

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

History | View | Annotate | Download (21.5 kB)

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

    
10
	<xsl:output method="xml" encoding="utf-8"
11
		omit-xml-declaration="no" indent="no" />
12

    
13
	<xd:doc type="stylesheet">
14
		<xd:short>
15
			Cette feuille permet de convertir la transcription compacte de la
16
			Queste del saint Graal au format XML-TEI du projet Oriflamms.
17
		</xd:short>
18
		<xd:detail>
19
			This stylesheet is free software; you can redistribute it and/or
20
			modify it under the terms of the GNU Lesser General Public
21
			License as published by the Free Software Foundation; either
22
			version 3 of the License, or (at your option) any later version.
23

    
24
			This stylesheet is distributed in the hope that it will be useful,
25
			but WITHOUT ANY WARRANTY; without even the implied warranty of
26
			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27
			Lesser General Public License for more details.
28

    
29
			You should have received a copy of GNU Lesser Public License with
30
			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
31
		</xd:detail>
32
		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
33
		<xd:copyright>2014, CNRS / ICAR (Équipe CACTUS)</xd:copyright>
34
	</xd:doc>
35

    
36
	<xsl:template match="/">
37
		<xsl:apply-templates />
38
	</xsl:template>
39

    
40

    
41
	<xsl:template match="*">
42
		<xsl:copy>
43
			<xsl:apply-templates select="@*" />
44
			<xsl:apply-templates
45
				select="*|processing-instruction()|comment()|text()" />
46
		</xsl:copy>
47
	</xsl:template>
48

    
49
	<xsl:template match="comment()|text()">
50
		<xsl:copy />
51
	</xsl:template>
52

    
53
	<xsl:template match="processing-instruction()"></xsl:template>
54

    
55
	<!-- On supprime les attributs par défaut de la DTD TEI -->
56

    
57
	<xsl:template match="@*">
58
		<xsl:choose>
59
			<xsl:when
60
				test="matches(name(.),'^(part|instant|anchored|full)$')" />
61
			<xsl:when test="matches(name(.),'rend')">
62
				<xsl:choose>
63
					<xsl:when test="matches(.,'^aggl$')">
64
						<xsl:attribute name="rend">space-after(none)</xsl:attribute>
65
					</xsl:when>
66
					<xsl:otherwise>
67
						<xsl:copy />
68
					</xsl:otherwise>
69
				</xsl:choose>
70
			</xsl:when>
71
			<xsl:otherwise>
72
				<xsl:copy />
73
			</xsl:otherwise>
74
		</xsl:choose>
75
	</xsl:template>
76

    
77
	<xsl:template match="tei:teiHeader">
78
		<xsl:copy>
79
			<xsl:apply-templates select="@*" />
80
			<xsl:apply-templates />
81
		</xsl:copy>
82
	</xsl:template>
83

    
84
	<xsl:template match="tei:revisionDesc">
85
		<xsl:copy>
86
			<xsl:apply-templates select="@*" />
87
			<change xmlns="http://www.tei-c.org/ns/1.0"
88
				when="{format-date(current-date(),'[Y]-[M01]-[D01]')}" who="#auto">Conversion
89
				automatique au format XML-TEI-Oriflamms</change>
90
			<xsl:apply-templates />
91
		</xsl:copy>
92
	</xsl:template>
93

    
94
	<xsl:template match="tei:encodingDesc">
95
		<xsl:copy>
96
			<xsl:apply-templates select="@*" />
97
			<xsl:apply-templates />
98
			<xsl:if test="not(//tei:prefixDef[@ident='ori'])">
99
				<listPrefixDef xmlns="http://www.tei-c.org/ns/1.0">
100
					<prefixDef xmlns="http://www.tei-c.org/ns/1.0"
101
						ident="ori" matchPattern="([a-z]+)"
102
						replacementPattern="oriflamms-annotation-scheme.xml#$1">
103
						<p>
104
							In the context of this project, private URIs with the prefix
105
							"ori" point to
106
							<gi>interp</gi>
107
							elements in the project's
108
							oriflamms-annotation-scheme.xml file.
109
						</p>
110
					</prefixDef>
111
				</listPrefixDef>
112
			</xsl:if>
113
		</xsl:copy>
114
	</xsl:template>
115

    
116

    
117
	<xsl:template match="tei:cb[@rend='hidden']">
118
		<xsl:comment>
119
			cb factice supprimé
120
		</xsl:comment>
121
	</xsl:template>
122

    
123
	<xsl:template
124
		match="tei:note|tei:supplied[not(descendant::tei:lb)]">
125
		<xsl:copy>
126
			<xsl:apply-templates select="@*" />
127
			<xsl:attribute name="ana">
128
      <xsl:if test="@ana"><xsl:value-of
129
				select="concat(@ana,' ')" /></xsl:if>
130
      <xsl:text>ori:align-no</xsl:text>
131
    </xsl:attribute>
132
			<xsl:apply-templates />
133
		</xsl:copy>
134
	</xsl:template>
135

    
136
	<xsl:template match="tei:supplied[descendant::tei:lb]">
137
		<xsl:comment>
138
			Ajout éditorial supprimé.
139
		</xsl:comment>
140
	</xsl:template>
141

    
142
	<!--<xsl:template match="tei:pb[not(preceding-sibling::*[1][self::tei:milestone[@unit='surface']] 
143
		or ancestor::tei:supplied)]"> <milestone xmlns="http://www.tei-c.org/ns/1.0" 
144
		unit="surface" facs="{@facs}"/> <xsl:copy> <xsl:apply-templates select="@*"/> 
145
		</xsl:copy> </xsl:template> -->
146

    
147
	<xsl:template match="tei:w[matches(@type,'^PON')]">
148
		<pc xmlns="http://www.tei-c.org/ns/1.0">
149
			<xsl:apply-templates select="@*" />
150
			<xsl:analyze-string select="."
151
				regex="^(.*)%(.*)%(.*)$">
152
				<xsl:matching-substring>
153
					<xsl:choose>
154
						<xsl:when test="matches(regex-group(3),'^$')">
155
							<xsl:attribute name="ana">ori:align-no</xsl:attribute>
156
							<reg xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no">
157
								<xsl:value-of select="regex-group(1)" />
158
							</reg>
159
						</xsl:when>
160
						<xsl:when test="matches(regex-group(1),'^$')">
161
							<orig xmlns="http://www.tei-c.org/ns/1.0">
162
								<xsl:value-of select="regex-group(3)" />
163
							</orig>
164
						</xsl:when>
165
						<xsl:otherwise>
166
							<choice xmlns="http://www.tei-c.org/ns/1.0">
167
								<reg xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no">
168
									<xsl:value-of select="regex-group(1)" />
169
								</reg>
170
								<orig xmlns="http://www.tei-c.org/ns/1.0">
171
									<xsl:value-of select="regex-group(3)" />
172
								</orig>
173
							</choice>
174
						</xsl:otherwise>
175
					</xsl:choose>
176
				</xsl:matching-substring>
177
				<xsl:non-matching-substring>
178
					<xsl:value-of select="." />
179
				</xsl:non-matching-substring>
180
			</xsl:analyze-string>
181
		</pc>
182
	</xsl:template>
183

    
184
	<xsl:template match="tei:orig">
185
		<xsl:apply-templates />
186
	</xsl:template>
187

    
188

    
189

    
190
	<xsl:template
191
		match="tei:w[not(matches(@type,'^PON'))]//text()|tei:del[not(ancestor::tei:w or descendant::tei:w)]//text()">
192
		<xsl:choose>
193
			<xsl:when test="matches(.,'^\s*$')">
194
				<xsl:copy />
195
			</xsl:when>
196
			<xsl:otherwise>
197
				<xsl:analyze-string select="."
198
					regex="#?\*[ijuvIJUVí]|#[A-Za-zÀ-ÿſ]|\{{\{{[^}}]+\}}\}}|#?\(\([^)]+\)\).?|_">
199
					<xsl:matching-substring>
200
						<xsl:choose>
201
							<xsl:when test="matches(.,'\(\(')">
202
								<xsl:analyze-string select="."
203
									regex="^#?\(\(([^\)]+)\)\)(.?)$">
204
									<xsl:matching-substring>
205
										<xsl:variable name="capitalize">
206
											<xsl:choose>
207
												<xsl:when test="matches(.,'^#') or matches(.,'_#')">
208
													yes
209
												</xsl:when>
210
												<xsl:otherwise>
211
													no
212
												</xsl:otherwise>
213
											</xsl:choose>
214
										</xsl:variable>
215
										<xsl:variable name="nextLetter">
216
											<xsl:value-of select="regex-group(2)" />
217
										</xsl:variable>
218
										<xsl:variable name="abbrexpan">
219
											<xsl:value-of
220
												select="replace(regex-group(1),'#','')" />
221
											<!--<xsl:value-of select="regex-group(1)"/> -->
222
										</xsl:variable>
223

    
224
										<xsl:variable name="abbr">
225
											<xsl:choose>
226
												<xsl:when test="matches($abbrexpan,'_')">
227
													<xsl:value-of
228
														select="substring-before($abbrexpan,'_')" />
229
												</xsl:when>
230
												<xsl:when
231
													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;)$')">
232
													<xsl:value-of select="$abbrexpan" />
233
												</xsl:when>
234
												<xsl:otherwise>
235
													xxx
236
												</xsl:otherwise>
237
											</xsl:choose>
238
										</xsl:variable>
239
										<xsl:variable name="expannocap" as="element()">
240
											<expan xmlns="http://www.tei-c.org/ns/1.0">
241
												<xsl:choose>
242
													<xsl:when test="matches($abbrexpan,'_')">
243
														<xsl:analyze-string
244
															select="substring-after($abbrexpan,'_')"
245
															regex="\[([^\]]+)\]">
246
															<xsl:matching-substring>
247
																<ex xmlns="http://www.tei-c.org/ns/1.0">
248
																	<xsl:value-of select="regex-group(1)" />
249
																</ex>
250
															</xsl:matching-substring>
251
															<xsl:non-matching-substring>
252
																<xsl:copy />
253
															</xsl:non-matching-substring>
254
														</xsl:analyze-string>
255
													</xsl:when>
256
													<xsl:when
257
														test="matches($abbrexpan,'^bn&#x0305;$')">
258
														b
259
														<ex xmlns="http://www.tei-c.org/ns/1.0">ie</ex>
260
														n
261
													</xsl:when>
262
													<xsl:when
263
														test="matches($abbrexpan,'^(ch&#x02BC;&#xA75B;|ch&#x0305;&#xA75B;|ch&#xA75B;&#x0305;)$')">
264
														ch
265
														<ex xmlns="http://www.tei-c.org/ns/1.0">evalie</ex>
266
														r
267
													</xsl:when>
268
													<xsl:when test="matches($abbrexpan,'gn&#x0363;t')">
269
														g
270
														<ex xmlns="http://www.tei-c.org/ns/1.0">r</ex>
271
														<c xmlns="http://www.tei-c.org/ns/1.0"
272
															rend="position(combsup)">a</c>
273
														nt
274
													</xsl:when>
275
													<xsl:when test="matches($abbrexpan,'qn&#x0363;t')">
276
														q
277
														<ex xmlns="http://www.tei-c.org/ns/1.0">u</ex>
278
														<c xmlns="http://www.tei-c.org/ns/1.0"
279
															rend="position(combsup)">a</c>
280
														nt
281
													</xsl:when>
282
													<xsl:when test="matches($abbrexpan,'.&#x0305;$')">
283
														<xsl:value-of
284
															select="substring($abbrexpan,1,1)" />
285
														<xsl:choose>
286
															<xsl:when
287
																test="matches($abbrexpan,'^[aeiou]') and matches($nextLetter,'[bmnp]')">
288
																<ex xmlns="http://www.tei-c.org/ns/1.0">m</ex>
289
															</xsl:when>
290
															<xsl:when test="matches($abbrexpan,'^[aeiou]')">
291
																<ex xmlns="http://www.tei-c.org/ns/1.0">n</ex>
292
															</xsl:when>
293
															<xsl:when test="matches($abbrexpan,'^[q]')">
294
																<ex xmlns="http://www.tei-c.org/ns/1.0">ue</ex>
295
															</xsl:when>
296
															<xsl:when test="matches($abbrexpan,'^[p]')">
297
																<ex xmlns="http://www.tei-c.org/ns/1.0">re</ex>
298
															</xsl:when>
299
															<xsl:otherwise>
300
																‹bar›
301
															</xsl:otherwise>
302
														</xsl:choose>
303
													</xsl:when>
304
													<xsl:when test="matches($abbrexpan,'.&#x0363;')">
305
														<xsl:value-of
306
															select="substring($abbrexpan,1,1)" />
307
														<xsl:choose>
308
															<xsl:when test="matches($abbrexpan,'^[Qq]')">
309
																<ex xmlns="http://www.tei-c.org/ns/1.0">u</ex>
310
															</xsl:when>
311
															<xsl:otherwise>
312
																<ex xmlns="http://www.tei-c.org/ns/1.0">r</ex>
313
															</xsl:otherwise>
314
														</xsl:choose>
315
														<c xmlns="http://www.tei-c.org/ns/1.0"
316
															rend="position(combsup)">a</c>
317
													</xsl:when>
318
													<xsl:when test="matches($abbrexpan,'.&#x0364;')">
319
														<xsl:value-of
320
															select="substring($abbrexpan,1,1)" />
321
														<xsl:choose>
322
															<xsl:when test="matches($abbrexpan,'^[Qq]')">
323
																<ex xmlns="http://www.tei-c.org/ns/1.0">u</ex>
324
															</xsl:when>
325
															<xsl:otherwise>
326
																<ex xmlns="http://www.tei-c.org/ns/1.0">r</ex>
327
															</xsl:otherwise>
328
														</xsl:choose>
329
														<c xmlns="http://www.tei-c.org/ns/1.0"
330
															rend="position(combsup)">e</c>
331
													</xsl:when>
332
													<xsl:when test="matches($abbrexpan,'.&#x0365;')">
333
														<xsl:value-of
334
															select="substring($abbrexpan,1,1)" />
335
														<xsl:choose>
336
															<xsl:when test="matches($abbrexpan,'^[Qq]')">
337
																<ex xmlns="http://www.tei-c.org/ns/1.0">u</ex>
338
															</xsl:when>
339
															<xsl:otherwise>
340
																<ex xmlns="http://www.tei-c.org/ns/1.0">r</ex>
341
															</xsl:otherwise>
342
														</xsl:choose>
343
														<c xmlns="http://www.tei-c.org/ns/1.0"
344
															rend="position(combsup)">i</c>
345
													</xsl:when>
346
													<xsl:when
347
														test="matches($abbrexpan,'&#xA76F;') and matches($nextLetter,'[bmnp]')">
348
														<ex xmlns="http://www.tei-c.org/ns/1.0">com</ex>
349
													</xsl:when>
350
													<xsl:when test="matches($abbrexpan,'&#xA76F;')">
351
														<ex xmlns="http://www.tei-c.org/ns/1.0">con</ex>
352
													</xsl:when>
353
													<xsl:when
354
														test="matches($abbrexpan,'&#x035B;|&#xF1C8;')">
355
														<ex xmlns="http://www.tei-c.org/ns/1.0">er</ex>
356
													</xsl:when>
357
													<xsl:when
358
														test="matches($abbrexpan,'&#x204A;|&#xF158;')">
359
														<ex xmlns="http://www.tei-c.org/ns/1.0">et</ex>
360
													</xsl:when>
361
													<xsl:when
362
														test="matches($abbrexpan,'&#x1DD1;|&#xF153;')">
363
														<ex xmlns="http://www.tei-c.org/ns/1.0">ur</ex>
364
													</xsl:when>
365
													<xsl:when test="matches($abbrexpan,'&#xA770;')">
366
														<ex xmlns="http://www.tei-c.org/ns/1.0">us</ex>
367
													</xsl:when>
368
													<xsl:otherwise>
369
														<ex xmlns="http://www.tei-c.org/ns/1.0">
370
															<xsl:value-of select="$abbrexpan" />
371
														</ex><!--<xsl:comment>Unknown expan!</xsl:comment> -->
372
													</xsl:otherwise>
373
												</xsl:choose>
374
											</expan>
375
										</xsl:variable>
376
										<xsl:variable name="expan">
377
											<xsl:choose>
378
												<xsl:when test="$capitalize eq 'yes'">
379
													<expan xmlns="http://www.tei-c.org/ns/1.0">
380
														<xsl:for-each select="$expannocap/node()">
381
															<xsl:choose>
382
																<xsl:when
383
																	test="self::text()[not(preceding-sibling::*)]">
384
																	<g xmlns="http://www.tei-c.org/ns/1.0"
385
																		ana="ori:dipl-small">
386
																		<xsl:value-of
387
																			select="upper-case(substring(.,1,1))" />
388
																	</g>
389
																	<xsl:value-of select="substring(.,2)" />
390
																</xsl:when>
391
																<xsl:when
392
																	test="self::*[not(preceding-sibling::text())]">
393
																	<xsl:copy>
394
																		<g xmlns="http://www.tei-c.org/ns/1.0"
395
																			ana="ori:dipl-small">
396
																			<xsl:value-of
397
																				select="upper-case(substring(.,1,1))" />
398
																		</g>
399
																		<xsl:value-of select="substring(.,2)" />
400
																	</xsl:copy>
401
																</xsl:when>
402
																<xsl:otherwise>
403
																	<xsl:copy-of select="." />
404
																</xsl:otherwise>
405
															</xsl:choose>
406
														</xsl:for-each>
407
													</expan>
408
												</xsl:when>
409
												<xsl:otherwise>
410
													<xsl:copy-of select="$expannocap" />
411
												</xsl:otherwise>
412
											</xsl:choose>
413
										</xsl:variable>
414
										<xsl:choose>
415
											<xsl:when test="matches($abbr,'.+')">
416
												<choice xmlns="http://www.tei-c.org/ns/1.0">
417
													<abbr xmlns="http://www.tei-c.org/ns/1.0">
418
														<xsl:copy-of select="$abbr" />
419
													</abbr>
420
													<xsl:copy-of select="$expan" />
421
												</choice>
422
											</xsl:when>
423
											<xsl:otherwise>
424
												<xsl:copy-of select="$expan" /><!--<xsl:comment>Unknown 
425
													abbr!</xsl:comment> -->
426
											</xsl:otherwise>
427
										</xsl:choose>
428
										<xsl:value-of select="$nextLetter" />
429
									</xsl:matching-substring>
430
									<xsl:non-matching-substring>
431
										<xsl:copy-of select="." /><!--<xsl:comment>Unknown 
432
											abbr-expan!</xsl:comment> -->
433
									</xsl:non-matching-substring>
434
								</xsl:analyze-string>
435
							</xsl:when>
436
							<xsl:when test="matches(.,'#\*([ij])')">
437
								<g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-j">
438
									<xsl:value-of select="upper-case(regex-group(1))" />
439
								</g>
440
							</xsl:when>
441
							<xsl:when test="matches(.,'#\*([uv])')">
442
								<g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-v">
443
									<xsl:value-of select="upper-case(regex-group(1))" />
444
								</g>
445
							</xsl:when>
446
							<xsl:when test="matches(.,'\*í')">
447
								<g xmlns="http://www.tei-c.org/ns/1.0"
448
									ana="ori:dipl-i ori:facs-iacute">j</g>
449
							</xsl:when>
450
							<xsl:when test="matches(.,'\*([ij])')">
451
								<g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-j">
452
									<xsl:value-of select="regex-group(1)" />
453
								</g>
454
							</xsl:when>
455
							<xsl:when test="matches(.,'\*([uv])')">
456
								<g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-v">
457
									<xsl:value-of select="regex-group(1)" />
458
								</g>
459
							</xsl:when>
460
							<xsl:when test="matches(.,'#\*([IJ])')">
461
								<g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-I">
462
									<xsl:value-of select="lower-case(regex-group(1))" />
463
								</g>
464
							</xsl:when>
465
							<xsl:when test="matches(.,'#\*([UV])')">
466
								<g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-V">
467
									<xsl:value-of select="lower-case(regex-group(1))" />
468
								</g>
469
							</xsl:when>
470
							<xsl:when test="matches(.,'\*([IJ])')">
471
								<g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-I">
472
									<xsl:value-of select="regex-group(1)" />
473
								</g>
474
							</xsl:when>
475
							<xsl:when test="matches(.,'\*([UV])')">
476
								<g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-V">
477
									<xsl:value-of select="regex-group(1)" />
478
								</g>
479
							</xsl:when>
480
							<xsl:when test="matches(.,'#ſ')">
481
								<xsl:analyze-string select="." regex="^#(.)">
482
									<xsl:matching-substring>
483
										<g xmlns="http://www.tei-c.org/ns/1.0"
484
											ana="ori:dipl-caps ori:facs-slong">S</g>
485
									</xsl:matching-substring>
486
								</xsl:analyze-string>
487
							</xsl:when>
488
							<!--  -->
489
							<!-- <xsl:when test="matches(.,'#')"> <xsl:analyze-string select="." 
490
								regex="^#(.)"> <xsl:matching-substring> <choice xmlns="http://www.tei-c.org/ns/1.0"> 
491
								<abbr xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="regex-group(1)"/></abbr> 
492
								<expan xmlns="http://www.tei-c.org/ns/1.0"><ex xmlns="http://www.tei-c.org/ns/1.0"><g 
493
								xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-small">E</g>t</ex></expan> 
494
								</choice> </xsl:matching-substring> </xsl:analyze-string> </xsl:when> -->
495
							<xsl:when test="matches(.,'#[A-Z]')">
496
								<xsl:analyze-string select="." regex="^#(.)">
497
									<xsl:matching-substring>
498
										<g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-caps">
499
											<xsl:value-of
500
												select="lower-case(regex-group(1))" />
501
										</g>
502
									</xsl:matching-substring>
503
								</xsl:analyze-string>
504
							</xsl:when>
505
							<xsl:when test="matches(.,'#[^(]')">
506
								<xsl:analyze-string select="."
507
									regex="^#(.+)$">
508
									<xsl:matching-substring>
509
										<g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-small">
510
											<xsl:value-of
511
												select="upper-case(regex-group(1))" />
512
										</g>
513
									</xsl:matching-substring>
514
								</xsl:analyze-string>
515
							</xsl:when>
516
							<xsl:when test="matches(.,'\{\{([^}}]+)\}\}')">
517
								<xsl:analyze-string select="."
518
									regex="^\{{\{{([^:]*):([^:]*):([^:]*):([^:]*):?([^:]*)\}}\}}$">
519
									<xsl:matching-substring>
520
										<xsl:variable name="lettrine">
521
											<xsl:value-of select="regex-group(1)" />
522
										</xsl:variable>
523
										<xsl:variable name="size">
524
											<xsl:value-of select="regex-group(2)" />
525
										</xsl:variable>
526
										<xsl:variable name="sizeAct">
527
											<xsl:value-of select="regex-group(3)" />
528
										</xsl:variable>
529
										<xsl:variable name="color">
530
											<xsl:value-of select="regex-group(4)" />
531
										</xsl:variable>
532
										<xsl:variable name="deco">
533
											<xsl:value-of select="regex-group(5)" />
534
										</xsl:variable>
535
										<xsl:variable name="rend">
536
											<xsl:value-of select="concat('size(',$size,')')" />
537
											<xsl:if test="matches($sizeAct,'.+')">
538
												<xsl:value-of
539
													select="concat(' sizeAct(',$sizeAct,')')" />
540
											</xsl:if>
541
											<xsl:if test="matches($color,'.+')">
542
												<xsl:value-of
543
													select="concat(' color(',$color,')')" />
544
											</xsl:if>
545
											<xsl:if test="matches($deco,'.+')">
546
												<xsl:value-of
547
													select="concat(' deco(',$deco,')')" />
548
											</xsl:if>
549
										</xsl:variable>
550
										<g xmlns="http://www.tei-c.org/ns/1.0" type="lettrine"
551
											rend="{$rend}">
552
											<xsl:value-of select="$lettrine" />
553
										</g>
554
									</xsl:matching-substring>
555
								</xsl:analyze-string>
556
							</xsl:when>
557

    
558
							<xsl:when test="matches(.,'__')">
559
								<space xmlns="http://www.tei-c.org/ns/1.0"
560
									ana="ori:figement" />
561
							</xsl:when>
562
							<xsl:when test="matches(.,'_')">
563
								<space xmlns="http://www.tei-c.org/ns/1.0" />
564
							</xsl:when>
565
							<xsl:otherwise>
566
								Match:
567
								<xsl:copy />
568
							</xsl:otherwise>
569
						</xsl:choose>
570
					</xsl:matching-substring>
571
					<xsl:non-matching-substring>
572
						<xsl:copy />
573
					</xsl:non-matching-substring>
574
				</xsl:analyze-string>
575
			</xsl:otherwise>
576
		</xsl:choose>
577
	</xsl:template>
578

    
579

    
580

    
581
</xsl:stylesheet>