Révision 489
tmp/org.txm.libs.cqp.macosx/bin/cqpserver.init (revision 489) | ||
---|---|---|
1 |
host *; # allow access from any host (including localhost) |
|
2 |
|
|
3 |
# users must login with name "anonymous" and explicit "" as password! |
|
4 |
user anonymous ""; |
tmp/org.txm.oriflamms.rcp/bin/oriflamms-convert-nesle-oriflammsxml.xsl (revision 489) | ||
---|---|---|
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 |
xmlns:xi="http://www.w3.org/2001/XInclude" |
|
7 |
xmlns:svg="http://www.w3.org/2000/svg" |
|
8 |
xmlns:math="http://www.w3.org/1998/Math/MathML" |
|
9 |
exclude-result-prefixes="tei edate xd txm xi svg math" version="2.0"> |
|
10 |
|
|
11 |
<xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="no"/> |
|
12 |
|
|
13 |
<xd:doc type="stylesheet"> |
|
14 |
<xd:short> |
|
15 |
Cette feuille permet de convertir les transcription des |
|
16 |
Chartes de Fontenay 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>2015, CNRS / ICAR (Équipe CACTUS)</xd:copyright> |
|
34 |
</xd:doc> |
|
35 |
|
|
36 |
<!--<xsl:strip-space elements="*"/>--> |
|
37 |
|
|
38 |
<xsl:param name="baseMsSiglum">A</xsl:param> |
|
39 |
|
|
40 |
<xsl:variable name="baseMsPattern"><xsl:value-of select="concat('^#?',$baseMsSiglum,'| #?',$baseMsSiglum)"/></xsl:variable> |
|
41 |
|
|
42 |
<xsl:template match="*|comment()"> |
|
43 |
<!-- Copy the current node --> |
|
44 |
<xsl:copy> |
|
45 |
<!-- Including any attributes it has and any child nodes --> |
|
46 |
<xsl:apply-templates select="@*|node()"/> |
|
47 |
</xsl:copy> |
|
48 |
</xsl:template> |
|
49 |
|
|
50 |
<xsl:template match="processing-instruction()"/> |
|
51 |
|
|
52 |
<!-- On supprime les attributs par défaut de la DTD TEI --> |
|
53 |
|
|
54 |
<xsl:template match="@*"> |
|
55 |
<xsl:choose> |
|
56 |
<xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/> |
|
57 |
<xsl:otherwise><xsl:copy/></xsl:otherwise> |
|
58 |
</xsl:choose> |
|
59 |
</xsl:template> |
|
60 |
|
|
61 |
<xsl:template match="@facs"> |
|
62 |
<xsl:attribute name="facs"><xsl:value-of select="replace(.,'\.tif$','.png','i')"/></xsl:attribute> |
|
63 |
</xsl:template> |
|
64 |
|
|
65 |
<xsl:template match="tei:teiHeader"> |
|
66 |
<xsl:copy> |
|
67 |
<xsl:apply-templates select="@*"/> |
|
68 |
<xsl:apply-templates/> |
|
69 |
</xsl:copy> |
|
70 |
</xsl:template> |
|
71 |
|
|
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="2007-01-01" who="#DS">Publication du document original</change> |
|
77 |
<!-- information récupérée à partir de /TEI/text[1]/front[1]/titlePage[1]/docDate[1] --> |
|
78 |
<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> |
|
79 |
<xsl:apply-templates/> |
|
80 |
</xsl:copy> |
|
81 |
</xsl:template> |
|
82 |
|
|
83 |
<xsl:template match="tei:encodingDesc"> |
|
84 |
<xsl:copy> |
|
85 |
<xsl:apply-templates select="@*"/> |
|
86 |
<xsl:apply-templates/> |
|
87 |
<xsl:if test="not(//tei:prefixDef[@ident='ori'])"> |
|
88 |
<listPrefixDef xmlns="http://www.tei-c.org/ns/1.0"> |
|
89 |
<prefixDef xmlns="http://www.tei-c.org/ns/1.0" ident="ori" |
|
90 |
matchPattern="([a-z]+)" |
|
91 |
replacementPattern="oriflamms-annotation-scheme.xml#$1"> |
|
92 |
<p>In the context of this project, private URIs with the prefix |
|
93 |
"ori" point to <gi>interp</gi> elements in the project's |
|
94 |
oriflamms-annotation-scheme.xml file. |
|
95 |
</p> |
|
96 |
</prefixDef> |
|
97 |
</listPrefixDef> |
|
98 |
</xsl:if> |
|
99 |
</xsl:copy> |
|
100 |
</xsl:template> |
|
101 |
|
|
102 |
<!-- On restructure le document pour avoir un TEI par charte --> |
|
103 |
|
|
104 |
<!-- TEI devient teiCorpus --> |
|
105 |
|
|
106 |
<xsl:template match="tei:TEI"> |
|
107 |
<xsl:element name="teiCorpus" xmlns="http://www.tei-c.org/ns/1.0"> |
|
108 |
<xsl:apply-templates select="@*"/> |
|
109 |
<xsl:apply-templates/> |
|
110 |
</xsl:element> |
|
111 |
</xsl:template> |
|
112 |
|
|
113 |
<!-- on supprime l'élément text de niveau 1 et travaille directement sur le niveau 2 (l'élément group intermédiaire disparait)--> |
|
114 |
|
|
115 |
<!-- <xsl:template match="tei:TEI/tei:text"> |
|
116 |
<xsl:apply-templates select="descendant::tei:text"/> |
|
117 |
</xsl:template>--> |
|
118 |
|
|
119 |
|
|
120 |
<xsl:template match="tei:text[descendant::tei:text]"> |
|
121 |
|
|
122 |
<!-- <teiCorpus xmlns="http://www.tei-c.org/ns/1.0"> |
|
123 |
<teiHeader xmlns="http://www.tei-c.org/ns/1.0"> |
|
124 |
<fileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
125 |
<titleStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
126 |
<title xmlns="http://www.tei-c.org/ns/1.0"> |
|
127 |
<xsl:value-of select="tei:group[1]/tei:head[1]"/> |
|
128 |
</title> |
|
129 |
</titleStmt> |
|
130 |
<publicationStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
131 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
132 |
</publicationStmt> |
|
133 |
<sourceDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
134 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
135 |
</sourceDesc> |
|
136 |
</fileDesc> |
|
137 |
<profileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
138 |
<!-\- argument devient profileDesc/abstract -\-> |
|
139 |
<xsl:apply-templates select="descendant::tei:argument[1]"/> |
|
140 |
</profileDesc> |
|
141 |
</teiHeader> |
|
142 |
<xsl:apply-templates/> |
|
143 |
</teiCorpus>--> |
|
144 |
<xsl:apply-templates/> |
|
145 |
</xsl:template> |
|
146 |
|
|
147 |
<xsl:template match="tei:text[descendant::tei:text]/tei:front"> |
|
148 |
<xsl:choose> |
|
149 |
<xsl:when test="descendant::tei:div"> |
|
150 |
<TEI xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no"> |
|
151 |
<teiHeader xmlns="http://www.tei-c.org/ns/1.0"> |
|
152 |
<fileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
153 |
<titleStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
154 |
<title xmlns="http://www.tei-c.org/ns/1.0"> |
|
155 |
<xsl:text>Introduction chercheur</xsl:text> |
|
156 |
</title> |
|
157 |
</titleStmt> |
|
158 |
<publicationStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
159 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
160 |
</publicationStmt> |
|
161 |
<sourceDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
162 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
163 |
</sourceDesc> |
|
164 |
</fileDesc> |
|
165 |
</teiHeader> |
|
166 |
<text xmlns="http://www.tei-c.org/ns/1.0"> |
|
167 |
<body xmlns="http://www.tei-c.org/ns/1.0"> |
|
168 |
<xsl:apply-templates select="descendant::tei:div"/> |
|
169 |
</body> |
|
170 |
|
|
171 |
</text> |
|
172 |
</TEI> |
|
173 |
</xsl:when> |
|
174 |
<xsl:otherwise> |
|
175 |
<xsl:comment><xsl:copy-of select="."/></xsl:comment> |
|
176 |
</xsl:otherwise> |
|
177 |
</xsl:choose> |
|
178 |
</xsl:template> |
|
179 |
|
|
180 |
<xsl:template match="tei:text[descendant::tei:text]/tei:back"> |
|
181 |
<xsl:choose> |
|
182 |
<xsl:when test="descendant::tei:div"> |
|
183 |
<TEI xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no"> |
|
184 |
<teiHeader xmlns="http://www.tei-c.org/ns/1.0"> |
|
185 |
<fileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
186 |
<titleStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
187 |
<title xmlns="http://www.tei-c.org/ns/1.0"> |
|
188 |
<xsl:text>Annexes</xsl:text> |
|
189 |
</title> |
|
190 |
</titleStmt> |
|
191 |
<publicationStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
192 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
193 |
</publicationStmt> |
|
194 |
<sourceDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
195 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
196 |
</sourceDesc> |
|
197 |
</fileDesc> |
|
198 |
</teiHeader> |
|
199 |
<text xmlns="http://www.tei-c.org/ns/1.0"> |
|
200 |
<body xmlns="http://www.tei-c.org/ns/1.0"> |
|
201 |
<xsl:apply-templates select="descendant::tei:div"/> |
|
202 |
</body> |
|
203 |
|
|
204 |
</text> |
|
205 |
</TEI> |
|
206 |
</xsl:when> |
|
207 |
<xsl:otherwise> |
|
208 |
<xsl:comment><xsl:copy-of select="."/></xsl:comment> |
|
209 |
</xsl:otherwise> |
|
210 |
</xsl:choose> |
|
211 |
</xsl:template> |
|
212 |
|
|
213 |
<xsl:template match="tei:group[@n='edition']|tei:group[@n='recueil']"> |
|
214 |
<xsl:apply-templates/> |
|
215 |
</xsl:template> |
|
216 |
|
|
217 |
<xsl:template match="tei:group[@n='edition']/ tei:group[@n='introduction']"> |
|
218 |
<TEI xmlns="http://www.tei-c.org/ns/1.0"> |
|
219 |
<teiHeader xmlns="http://www.tei-c.org/ns/1.0"> |
|
220 |
<fileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
221 |
<titleStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
222 |
<title xmlns="http://www.tei-c.org/ns/1.0"> |
|
223 |
<xsl:text>Introduction</xsl:text> |
|
224 |
</title> |
|
225 |
</titleStmt> |
|
226 |
<publicationStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
227 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
228 |
</publicationStmt> |
|
229 |
<sourceDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
230 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
231 |
</sourceDesc> |
|
232 |
</fileDesc> |
|
233 |
</teiHeader> |
|
234 |
<xsl:apply-templates/> |
|
235 |
</TEI> |
|
236 |
|
|
237 |
</xsl:template> |
|
238 |
|
|
239 |
<xsl:template match="tei:group[@n='edition']/ tei:group[@n='table']"> |
|
240 |
<TEI xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no"> |
|
241 |
<teiHeader xmlns="http://www.tei-c.org/ns/1.0"> |
|
242 |
<fileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
243 |
<titleStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
244 |
<title xmlns="http://www.tei-c.org/ns/1.0"> |
|
245 |
<xsl:text>Table</xsl:text> |
|
246 |
</title> |
|
247 |
</titleStmt> |
|
248 |
<publicationStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
249 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
250 |
</publicationStmt> |
|
251 |
<sourceDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
252 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
253 |
</sourceDesc> |
|
254 |
</fileDesc> |
|
255 |
</teiHeader> |
|
256 |
<text xmlns="http://www.tei-c.org/ns/1.0"> |
|
257 |
<xsl:copy-of select="."/> |
|
258 |
</text> |
|
259 |
</TEI> |
|
260 |
|
|
261 |
</xsl:template> |
|
262 |
|
|
263 |
<xsl:template match="tei:group[@n='edition']/tei:group[@n='recueil']/tei:text"> |
|
264 |
|
|
265 |
<TEI xmlns="http://www.tei-c.org/ns/1.0"> |
|
266 |
<teiHeader xmlns="http://www.tei-c.org/ns/1.0"> |
|
267 |
<fileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
268 |
<titleStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
269 |
<title xmlns="http://www.tei-c.org/ns/1.0"> |
|
270 |
<xsl:value-of select="descendant::tei:docTitle[1]"></xsl:value-of> |
|
271 |
</title> |
|
272 |
<xsl:if test="descendant::tei:docAuthor"> |
|
273 |
<author xmlns="http://www.tei-c.org/ns/1.0"> |
|
274 |
<xsl:value-of select="descendant::tei:docAuthor[1]"></xsl:value-of> |
|
275 |
</author> |
|
276 |
</xsl:if> |
|
277 |
|
|
278 |
</titleStmt> |
|
279 |
<publicationStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
280 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
281 |
</publicationStmt> |
|
282 |
<!-- les éléments listWit et listBibl sont placés dans sourceDesc --> |
|
283 |
<sourceDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
284 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
285 |
</sourceDesc> |
|
286 |
</fileDesc> |
|
287 |
<profileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
288 |
<!-- docDate devient profileDesc/creation/date[@type='documentCreation'] --> |
|
289 |
<creation xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates select="descendant::tei:docDate/tei:date"/></creation> |
|
290 |
</profileDesc> |
|
291 |
</teiHeader> |
|
292 |
<text xmlns="http://www.tei-c.org/ns/1.0"> |
|
293 |
<xsl:if test="preceding-sibling::*[1][self::tei:milestone]"> |
|
294 |
<xsl:copy-of select="preceding-sibling::tei:milestone[1]"></xsl:copy-of> |
|
295 |
</xsl:if> |
|
296 |
<xsl:apply-templates/> |
|
297 |
</text> |
|
298 |
</TEI> |
|
299 |
</xsl:template> |
|
300 |
|
|
301 |
<xsl:template match="tei:text[not(descendant::tei:text)]/tei:front"> |
|
302 |
</xsl:template> |
|
303 |
|
|
304 |
<xsl:template match="tei:argument"/> |
|
305 |
|
|
306 |
|
|
307 |
|
|
308 |
|
|
309 |
<xsl:template match="tei:milestone"> |
|
310 |
<xsl:choose> |
|
311 |
<xsl:when test="parent::tei:group"/> |
|
312 |
<xsl:otherwise> |
|
313 |
<xsl:copy-of select="."/> |
|
314 |
</xsl:otherwise> |
|
315 |
</xsl:choose> |
|
316 |
</xsl:template> |
|
317 |
|
|
318 |
<xsl:template match="tei:group/tei:head"/> |
|
319 |
|
|
320 |
<!-- on supprime listWit du corps du texte (cf. l'entête) --> |
|
321 |
<xsl:template match="tei:listWit"/> |
|
322 |
|
|
323 |
<!-- on supprime les entêtes et pied de pages (non alignables) --> |
|
324 |
|
|
325 |
<xsl:template match="tei:fw"> |
|
326 |
<xsl:comment>fw : <xsl:copy-of select="."/></xsl:comment> |
|
327 |
</xsl:template> |
|
328 |
|
|
329 |
<!-- on ajoute un attribut pour faciliter l'identification des segments à ne pas aligner --> |
|
330 |
|
|
331 |
<xsl:template match="tei:choice/tei:expan|tei:choice/tei:corr|tei:supplied|tei:note"> |
|
332 |
<xsl:copy> |
|
333 |
<xsl:apply-templates select="@*"/> |
|
334 |
<xsl:attribute name="ana">ori:align-no</xsl:attribute> |
|
335 |
<xsl:apply-templates/> |
|
336 |
</xsl:copy> |
|
337 |
</xsl:template> |
|
338 |
|
|
339 |
<xsl:template match="tei:pb"> |
|
340 |
<xsl:variable name="facs"> |
|
341 |
<xsl:value-of select="@facs"/> |
|
342 |
</xsl:variable> |
|
343 |
<xsl:if test="//tei:zone[@xml:id=substring-after($facs,'#')] and not(preceding::tei:pb[@facs=$facs])"> |
|
344 |
<milestone xmlns="http://www.tei-c.org/ns/1.0" unit="surface"> |
|
345 |
<xsl:attribute name="facs"> |
|
346 |
<xsl:value-of select="//tei:surface[tei:zone[@xml:id=substring-after($facs,'#')]][1]/tei:graphic/@url"/> |
|
347 |
</xsl:attribute> |
|
348 |
</milestone> |
|
349 |
</xsl:if> |
|
350 |
<xsl:copy-of select="."/> |
|
351 |
</xsl:template> |
|
352 |
|
|
353 |
|
|
354 |
<xsl:template match="text()[following-sibling::*[1][self::tei:milestone or self::tei:pb or self::tei:cb or self::tei:lb] and following-sibling::tei:lb[1][@break='no']]"> |
|
355 |
<xsl:choose> |
|
356 |
<!-- patch d'espace blanc devant les sauts de ligne à l'intérieur de mots --> |
|
357 |
<xsl:when test="matches(.,'\s+$')"><xsl:value-of select="replace(.,'\s+$','')"/></xsl:when> |
|
358 |
<xsl:otherwise><xsl:copy/></xsl:otherwise> |
|
359 |
</xsl:choose> |
|
360 |
</xsl:template> |
|
361 |
|
|
362 |
<xsl:template match="tei:witDetail"> |
|
363 |
<xsl:text> </xsl:text> |
|
364 |
<xsl:copy> |
|
365 |
<xsl:apply-templates select="@*"/> |
|
366 |
<xsl:attribute name="ana">ori:align-no</xsl:attribute> |
|
367 |
<xsl:apply-templates/> |
|
368 |
</xsl:copy> |
|
369 |
</xsl:template> |
|
370 |
|
|
371 |
</xsl:stylesheet> |
tmp/org.txm.oriflamms.rcp/bin/oriflamms-tokenize-chars-2-identify.xsl (revision 489) | ||
---|---|---|
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 |
exclude-result-prefixes="tei edate" version="2.0"> |
|
5 |
|
|
6 |
<xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/> |
|
7 |
|
|
8 |
<xsl:template match="node()|@*"> |
|
9 |
<!-- Copy the current node --> |
|
10 |
<xsl:copy> |
|
11 |
<!-- Including any attributes it has and any child nodes --> |
|
12 |
<xsl:apply-templates select="@*|node()"/> |
|
13 |
</xsl:copy> |
|
14 |
</xsl:template> |
|
15 |
|
|
16 |
<!-- <xsl:variable name="filename"> |
|
17 |
<xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/]+$"> |
|
18 |
<xsl:matching-substring> |
|
19 |
<xsl:value-of select="regex-group(2)"/> |
|
20 |
</xsl:matching-substring> |
|
21 |
</xsl:analyze-string> |
|
22 |
</xsl:variable> |
|
23 |
|
|
24 |
<xsl:variable name="filedir"> |
|
25 |
<xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/]+$"> |
|
26 |
<xsl:matching-substring> |
|
27 |
<xsl:value-of select="regex-group(1)"/> |
|
28 |
</xsl:matching-substring> |
|
29 |
</xsl:analyze-string> |
|
30 |
</xsl:variable> |
|
31 |
|
|
32 |
<xsl:variable name="filenameresult"> |
|
33 |
<xsl:value-of select="replace($filename,'(-ori)?-w$','')"/> |
|
34 |
</xsl:variable> |
|
35 |
|
|
36 |
<xsl:variable name="path"> |
|
37 |
<xsl:value-of select="concat($filedir,'/',$filenameresult,'-c-temp/?select=*.xml;recurse=yes;on-error=warning')"/> |
|
38 |
</xsl:variable> |
|
39 |
|
|
40 |
<xsl:variable name="files" select="collection($path)"/> |
|
41 |
|
|
42 |
<xsl:template match="/"> |
|
43 |
<root>Processing files from <xsl:value-of select="$filedir/$filenameresult"/>-c-temp directory. Result files saved in <xsl:value-of select="$filedir/$filenameresult"/>-c directory.</root> |
|
44 |
<xsl:for-each select="$files"> |
|
45 |
<xsl:variable name="filename2"> |
|
46 |
<xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+).xml$"> |
|
47 |
<xsl:matching-substring> |
|
48 |
<xsl:value-of select="regex-group(2)"></xsl:value-of> |
|
49 |
</xsl:matching-substring> |
|
50 |
</xsl:analyze-string></xsl:variable> |
|
51 |
<xsl:result-document href="{$filedir}/{$filenameresult}-c/{$filename2}-c.xml"> |
|
52 |
<xsl:apply-templates/> |
|
53 |
</xsl:result-document> |
|
54 |
</xsl:for-each> |
|
55 |
</xsl:template> |
|
56 |
--> |
|
57 |
|
|
58 |
|
|
59 |
<xsl:template match="tei:c"> |
|
60 |
<xsl:variable name="w-id"> |
|
61 |
<xsl:choose> |
|
62 |
<xsl:when test="ancestor::tei:pc"><xsl:value-of select="ancestor::tei:pc[1]/@xml:id"/></xsl:when> |
|
63 |
<xsl:when test="ancestor::tei:w"><xsl:value-of select="ancestor::tei:w[1]/@xml:id"/></xsl:when> |
|
64 |
<xsl:when test="ancestor::tei:seg[@type='deleted']"><xsl:value-of select="ancestor::tei:seg[@type='deleted'][1]/@xml:id"/></xsl:when> |
|
65 |
</xsl:choose> |
|
66 |
</xsl:variable> |
|
67 |
<xsl:variable name="position"><xsl:number from="tei:w|tei:pc|tei:seg[@type='deleted']" level="any"/></xsl:variable> |
|
68 |
<xsl:copy> |
|
69 |
<xsl:apply-templates select="@*"/> |
|
70 |
<xsl:attribute name="xml:id"><xsl:value-of select="concat('c_',$w-id,'_',$position)"/></xsl:attribute> |
|
71 |
<xsl:apply-templates/> |
|
72 |
</xsl:copy> |
|
73 |
</xsl:template> |
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
</xsl:stylesheet> |
tmp/org.txm.oriflamms.rcp/bin/1-oriflamms-split-surfaces.xsl (revision 489) | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<xsl:stylesheet |
|
3 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
4 |
xmlns:xd="http://www.pnp-software.com/XSLTdoc" |
|
5 |
xmlns:tei="http://www.tei-c.org/ns/1.0" |
|
6 |
version="2.0" xpath-default-namespace="http://www.tei-c.org/ns/1.0"> |
|
7 |
|
|
8 |
<xd:doc type="stylesheet"> |
|
9 |
<xd:short> |
|
10 |
Cette feuille permet de découper un fichier XML TEI Oriflamms en pages |
|
11 |
avant de procéder à la tokénisation au niveau de caractère. |
|
12 |
</xd:short> |
|
13 |
<xd:detail> |
|
14 |
This software is dual-licensed: |
|
15 |
|
|
16 |
1. Distributed under a Creative Commons Attribution-ShareAlike 3.0 |
|
17 |
Unported License http://creativecommons.org/licenses/by-sa/3.0/ |
|
18 |
|
|
19 |
2. http://www.opensource.org/licenses/BSD-2-Clause |
|
20 |
|
|
21 |
All rights reserved. |
|
22 |
|
|
23 |
Redistribution and use in source and binary forms, with or without |
|
24 |
modification, are permitted provided that the following conditions are |
|
25 |
met: |
|
26 |
|
|
27 |
* Redistributions of source code must retain the above copyright |
|
28 |
notice, this list of conditions and the following disclaimer. |
|
29 |
|
|
30 |
* Redistributions in binary form must reproduce the above copyright |
|
31 |
notice, this list of conditions and the following disclaimer in the |
|
32 |
documentation and/or other materials provided with the distribution. |
|
33 |
|
|
34 |
This software is provided by the copyright holders and contributors |
|
35 |
"as is" and any express or implied warranties, including, but not |
|
36 |
limited to, the implied warranties of merchantability and fitness for |
|
37 |
a particular purpose are disclaimed. In no event shall the copyright |
|
38 |
holder or contributors be liable for any direct, indirect, incidental, |
|
39 |
special, exemplary, or consequential damages (including, but not |
|
40 |
limited to, procurement of substitute goods or services; loss of use, |
|
41 |
data, or profits; or business interruption) however caused and on any |
|
42 |
theory of liability, whether in contract, strict liability, or tort |
|
43 |
(including negligence or otherwise) arising in any way out of the use |
|
44 |
of this software, even if advised of the possibility of such damage. |
|
45 |
|
|
46 |
$Id$ |
|
47 |
|
|
48 |
This stylesheet is based on TEI processpb.xsl by Sebastian Rahtz |
|
49 |
available at |
|
50 |
https://github.com/TEIC/Stylesheets/blob/master/tools/processpb.xsl |
|
51 |
and is adapted by Alexei Lavrentiev to split an XML TEI Oriflamms file |
|
52 |
into pages for further tokenizatrion at character level. |
|
53 |
|
|
54 |
</xd:detail> |
|
55 |
<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author> |
|
56 |
<xd:copyright>2015, CNRS / ICAR (Équipe CACTUS)</xd:copyright> |
|
57 |
</xd:doc> |
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
<xsl:output indent="no" method="xml"/> |
|
62 |
|
|
63 |
|
|
64 |
<xsl:variable name="filename"> |
|
65 |
<xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/]+$"> |
|
66 |
<xsl:matching-substring> |
|
67 |
<xsl:value-of select="regex-group(2)"/> |
|
68 |
</xsl:matching-substring> |
|
69 |
</xsl:analyze-string> |
|
70 |
</xsl:variable> |
|
71 |
|
|
72 |
<xsl:variable name="filedir"> |
|
73 |
<xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/]+$"> |
|
74 |
<xsl:matching-substring> |
|
75 |
<xsl:value-of select="regex-group(1)"/> |
|
76 |
</xsl:matching-substring> |
|
77 |
</xsl:analyze-string> |
|
78 |
</xsl:variable> |
|
79 |
|
|
80 |
<!--<xsl:variable name="filenameresult"> |
|
81 |
<xsl:value-of select="replace($filename,'(-ori)?-w$','')"/> |
|
82 |
</xsl:variable>--> |
|
83 |
|
|
84 |
<xsl:param name="output-directory"><xsl:value-of select="concat($filedir,'/out')"/></xsl:param> |
|
85 |
|
|
86 |
|
|
87 |
<xsl:template match="teiHeader"> |
|
88 |
<!--<xsl:copy-of select="."/>--> |
|
89 |
</xsl:template> |
|
90 |
|
|
91 |
<xsl:template match="TEI|teiCorpus|group|text"> |
|
92 |
<xsl:copy> |
|
93 |
<xsl:apply-templates select="@*"/> |
|
94 |
<xsl:apply-templates select="*|processing-instruction()|comment()|text()"/> |
|
95 |
</xsl:copy> |
|
96 |
</xsl:template> |
|
97 |
|
|
98 |
|
|
99 |
<xsl:template match="text/body|text/back|text/front"> |
|
100 |
<xsl:variable name="pages"> |
|
101 |
<xsl:copy> |
|
102 |
<xsl:apply-templates select="@*"/> |
|
103 |
<xsl:apply-templates |
|
104 |
select="*|processing-instruction()|comment()|text()"/> |
|
105 |
</xsl:copy> |
|
106 |
</xsl:variable> |
|
107 |
<xsl:for-each select="$pages"> |
|
108 |
<xsl:apply-templates mode="pass2"/> |
|
109 |
</xsl:for-each> |
|
110 |
</xsl:template> |
|
111 |
|
|
112 |
|
|
113 |
<!-- first (recursive) pass. look for <pb> elements and group on them --> |
|
114 |
<xsl:template match="comment()|@*|processing-instruction()|text()"> |
|
115 |
<xsl:copy-of select="."/> |
|
116 |
</xsl:template> |
|
117 |
|
|
118 |
<xsl:template match="*"> |
|
119 |
<xsl:call-template name="checkpb"> |
|
120 |
<xsl:with-param name="eName" select="local-name()"/> |
|
121 |
</xsl:call-template> |
|
122 |
</xsl:template> |
|
123 |
|
|
124 |
<xsl:template match="milestone[@unit='surface']"> |
|
125 |
<xsl:copy-of select="."/> |
|
126 |
</xsl:template> |
|
127 |
|
|
128 |
<xsl:template name="checkpb"> |
|
129 |
<xsl:param name="eName"/> |
|
130 |
<xsl:choose> |
|
131 |
<xsl:when test="not(.//milestone[@unit='surface'])"> |
|
132 |
<xsl:copy-of select="."/> |
|
133 |
</xsl:when> |
|
134 |
<xsl:otherwise> |
|
135 |
<xsl:variable name="pass"> |
|
136 |
<xsl:call-template name="groupbypb"> |
|
137 |
<xsl:with-param name="Name" select="$eName"/> |
|
138 |
</xsl:call-template> |
|
139 |
</xsl:variable> |
|
140 |
<xsl:for-each select="$pass"> |
|
141 |
<xsl:apply-templates/> |
|
142 |
</xsl:for-each> |
|
143 |
</xsl:otherwise> |
|
144 |
</xsl:choose> |
|
145 |
</xsl:template> |
|
146 |
|
|
147 |
<xsl:template name="groupbypb"> |
|
148 |
<xsl:param name="Name"/> |
|
149 |
<xsl:for-each-group select="node()" group-starting-with="milestone[@unit='surface']"> |
|
150 |
<xsl:choose> |
|
151 |
<xsl:when test="self::milestone[@unit='surface']"> |
|
152 |
<xsl:copy-of select="."/> |
|
153 |
<xsl:element name="{$Name}" namespace="http://www.tei-c.org/ns/1.0"> |
|
154 |
<xsl:attribute name="rend">CONTINUED</xsl:attribute> |
|
155 |
<xsl:apply-templates select="current-group() except ."/> |
|
156 |
</xsl:element> |
|
157 |
</xsl:when> |
|
158 |
<xsl:otherwise> |
|
159 |
<xsl:element name="{$Name}" namespace="http://www.tei-c.org/ns/1.0"> |
|
160 |
<xsl:for-each select=".."> |
|
161 |
<xsl:copy-of select="@*"/> |
|
162 |
<xsl:apply-templates select="current-group()"/> |
|
163 |
</xsl:for-each> |
|
164 |
</xsl:element> |
|
165 |
</xsl:otherwise> |
|
166 |
</xsl:choose> |
|
167 |
</xsl:for-each-group> |
|
168 |
</xsl:template> |
|
169 |
|
|
170 |
<!-- second pass. group by <pb> (now all at top level) and wrap groups |
|
171 |
in <page> --> |
|
172 |
<xsl:template match="*" mode="pass2"> |
|
173 |
<xsl:copy> |
|
174 |
<xsl:apply-templates select="@*|*|processing-instruction()|comment()|text()" mode="pass2"/> |
|
175 |
</xsl:copy> |
|
176 |
</xsl:template> |
|
177 |
|
|
178 |
<xsl:template match="comment()|@*|processing-instruction()|text()" mode="pass2"> |
|
179 |
<xsl:copy-of select="."/> |
|
180 |
</xsl:template> |
|
181 |
|
|
182 |
|
|
183 |
<xsl:template match="*[milestone[@unit='surface']]" mode="pass2" > |
|
184 |
<xsl:copy> |
|
185 |
<xsl:apply-templates select="@*"/> |
|
186 |
<xsl:for-each-group select="*" group-starting-with="milestone[@unit='surface']"> |
|
187 |
<xsl:choose> |
|
188 |
<xsl:when test="self::milestone[@unit='surface']"> |
|
189 |
<xsl:comment> Page <xsl:value-of select="@xml:id"/> enregistrée dans <xsl:value-of select="concat($output-directory,'/',$filename,'_',@xml:id,'.xml')"/></xsl:comment> |
|
190 |
<xsl:text>
</xsl:text> |
|
191 |
<xsl:result-document href="{$output-directory}/{$filename}_{@xml:id}.xml" indent="yes" exclude-result-prefixes="#all"> |
|
192 |
<TEI xmlns="http://www.tei-c.org/ns/1.0"> |
|
193 |
<teiHeader> |
|
194 |
<fileDesc> |
|
195 |
<titleStmt> |
|
196 |
<title>Page <xsl:value-of select="@xml:id"/> of <xsl:value-of select="$filename"/> tokenized at character level.</title> |
|
197 |
</titleStmt> |
|
198 |
<publicationStmt> |
|
199 |
<p>Oriflamms project (http://oriflamms.hypotheses.org)</p> |
|
200 |
</publicationStmt> |
|
201 |
<sourceDesc> |
|
202 |
<p>Converted from <xsl:value-of select="$filename"/>.</p> |
|
203 |
</sourceDesc> |
|
204 |
</fileDesc> |
|
205 |
<revisionDesc> |
|
206 |
<change when="{current-dateTime()}">File created.</change> |
|
207 |
</revisionDesc> |
|
208 |
</teiHeader> |
|
209 |
<text> |
|
210 |
<body> |
|
211 |
<xsl:copy-of select="."/> |
|
212 |
<xsl:copy-of select="current-group() except ."/> |
|
213 |
</body> |
|
214 |
</text> |
|
215 |
</TEI> |
|
216 |
</xsl:result-document> |
|
217 |
</xsl:when> |
|
218 |
<xsl:otherwise> |
|
219 |
<xsl:copy-of select="current-group()"/> |
|
220 |
</xsl:otherwise> |
|
221 |
</xsl:choose> |
|
222 |
</xsl:for-each-group> |
|
223 |
</xsl:copy> |
|
224 |
</xsl:template> |
|
225 |
|
|
226 |
</xsl:stylesheet> |
tmp/org.txm.oriflamms.rcp/bin/oriflamms-convert-fontenay-oriflammsxml.xsl (revision 489) | ||
---|---|---|
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 |
xmlns:xi="http://www.w3.org/2001/XInclude" |
|
7 |
xmlns:svg="http://www.w3.org/2000/svg" |
|
8 |
xmlns:math="http://www.w3.org/1998/Math/MathML" |
|
9 |
exclude-result-prefixes="tei edate xd txm xi svg math" version="2.0"> |
|
10 |
|
|
11 |
<xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="yes"/> |
|
12 |
|
|
13 |
<xd:doc type="stylesheet"> |
|
14 |
<xd:short> |
|
15 |
Cette feuille permet de convertir les transcription des |
|
16 |
Chartes de Fontenay 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>2015, CNRS / ICAR (Équipe CACTUS)</xd:copyright> |
|
34 |
</xd:doc> |
|
35 |
|
|
36 |
<xsl:strip-space elements="*"/> |
|
37 |
|
|
38 |
<xsl:param name="baseMsSiglum">A</xsl:param> |
|
39 |
|
|
40 |
<xsl:variable name="baseMsPattern"><xsl:value-of select="concat('^#?',$baseMsSiglum,'| #?',$baseMsSiglum)"/></xsl:variable> |
|
41 |
|
|
42 |
<xsl:template match="node()"> |
|
43 |
<!-- Copy the current node --> |
|
44 |
<xsl:copy> |
|
45 |
<!-- Including any attributes it has and any child nodes --> |
|
46 |
<xsl:apply-templates select="@*|node()"/> |
|
47 |
</xsl:copy> |
|
48 |
</xsl:template> |
|
49 |
|
|
50 |
<!-- On supprime les attributs par défaut de la DTD TEI --> |
|
51 |
|
|
52 |
<xsl:template match="@*"> |
|
53 |
<xsl:choose> |
|
54 |
<xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/> |
|
55 |
<xsl:otherwise><xsl:copy/></xsl:otherwise> |
|
56 |
</xsl:choose> |
|
57 |
</xsl:template> |
|
58 |
|
|
59 |
<xsl:template match="@facs"> |
|
60 |
<xsl:attribute name="facs"> |
|
61 |
<xsl:value-of select="replace(.,'\tif$','.png')"/> |
|
62 |
</xsl:attribute> |
|
63 |
</xsl:template> |
|
64 |
|
|
65 |
<xsl:template match="tei:teiHeader"> |
|
66 |
<xsl:copy> |
|
67 |
<xsl:apply-templates select="@*"/> |
|
68 |
<xsl:apply-templates/> |
|
69 |
</xsl:copy> |
|
70 |
</xsl:template> |
|
71 |
|
|
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="2007-01-01" who="#DS">Publication du document original</change> |
|
77 |
<!-- information récupérée à partir de /TEI/text[1]/front[1]/titlePage[1]/docDate[1] --> |
|
78 |
<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> |
|
79 |
<xsl:apply-templates/> |
|
80 |
</xsl:copy> |
|
81 |
</xsl:template> |
|
82 |
|
|
83 |
<xsl:template match="tei:encodingDesc"> |
|
84 |
<xsl:copy> |
|
85 |
<xsl:apply-templates select="@*"/> |
|
86 |
<xsl:apply-templates/> |
|
87 |
<xsl:if test="not(//tei:prefixDef[@ident='ori'])"> |
|
88 |
<listPrefixDef xmlns="http://www.tei-c.org/ns/1.0"> |
|
89 |
<prefixDef xmlns="http://www.tei-c.org/ns/1.0" ident="ori" |
|
90 |
matchPattern="([a-z]+)" |
|
91 |
replacementPattern="oriflamms-annotation-scheme.xml#$1"> |
|
92 |
<p>In the context of this project, private URIs with the prefix |
|
93 |
"ori" point to <gi>interp</gi> elements in the project's |
|
94 |
oriflamms-annotation-scheme.xml file. |
|
95 |
</p> |
|
96 |
</prefixDef> |
|
97 |
</listPrefixDef> |
|
98 |
</xsl:if> |
|
99 |
</xsl:copy> |
|
100 |
</xsl:template> |
|
101 |
|
|
102 |
<!-- On restructure le document pour avoir un TEI par charte --> |
|
103 |
|
|
104 |
<!-- TEI devient teiCorpus --> |
|
105 |
|
|
106 |
<xsl:template match="tei:TEI"> |
|
107 |
<xsl:element name="teiCorpus" xmlns="http://www.tei-c.org/ns/1.0"> |
|
108 |
<xsl:apply-templates select="@*"/> |
|
109 |
<xsl:apply-templates/> |
|
110 |
</xsl:element> |
|
111 |
</xsl:template> |
|
112 |
|
|
113 |
<!-- on supprime l'élément text de niveau 1 et travaille directement sur le niveau 2 (l'élément group intermédiaire disparait)--> |
|
114 |
|
|
115 |
<xsl:template match="tei:TEI/tei:text"> |
|
116 |
<xsl:apply-templates select="descendant::tei:text"/> |
|
117 |
</xsl:template> |
|
118 |
|
|
119 |
<xsl:template match="tei:text//tei:text"> |
|
120 |
|
|
121 |
<TEI xmlns="http://www.tei-c.org/ns/1.0"> |
|
122 |
<teiHeader xmlns="http://www.tei-c.org/ns/1.0"> |
|
123 |
<fileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
124 |
<titleStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
125 |
<title xmlns="http://www.tei-c.org/ns/1.0"><xsl:text>Acte original </xsl:text> |
|
126 |
<xsl:value-of select="substring-after(preceding-sibling::comment()[contains(.,'acte original')][1],'acte original ')"/></title> |
|
127 |
<author xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="descendant::tei:docAuthor"/></author> |
|
128 |
</titleStmt> |
|
129 |
<publicationStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
130 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the teiCorpus</p> |
|
131 |
</publicationStmt> |
|
132 |
<!-- les éléments listWit et listBibl sont placés dans sourceDesc --> |
|
133 |
<sourceDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
134 |
<xsl:copy-of select="descendant::tei:listWit"/> |
|
135 |
<xsl:copy-of select="descendant::tei:listBibl[1]"></xsl:copy-of> |
|
136 |
</sourceDesc> |
|
137 |
</fileDesc> |
|
138 |
<profileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
139 |
<!-- docDate devient profileDesc/creation/date[@type='documentCreation'] --> |
|
140 |
<creation xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates select="descendant::tei:docDate"/></creation> |
|
141 |
<!-- argument devient profileDesc/abstract --> |
|
142 |
<xsl:apply-templates select="descendant::tei:argument"/> |
|
143 |
</profileDesc> |
|
144 |
</teiHeader> |
|
145 |
<text xmlns="http://www.tei-c.org/ns/1.0"> |
|
146 |
<body xmlns="http://www.tei-c.org/ns/1.0"> |
|
147 |
<xsl:apply-templates select="descendant::tei:div1"/> |
|
148 |
</body> |
|
149 |
</text> |
|
150 |
</TEI> |
|
151 |
</xsl:template> |
|
152 |
|
|
153 |
<xsl:template match="tei:docDate[ancestor::tei:group]"> |
|
154 |
<date type="documentCreation" xmlns="http://www.tei-c.org/ns/1.0"> |
|
155 |
<xsl:apply-templates select="@*"/> |
|
156 |
<xsl:apply-templates/> |
|
157 |
</date> |
|
158 |
</xsl:template> |
|
159 |
|
|
160 |
<xsl:template match="tei:argument"> |
|
161 |
<abstract xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates/></abstract> |
|
162 |
</xsl:template> |
|
163 |
|
|
164 |
|
|
165 |
<!-- patch of the wrong use of @break --> |
|
166 |
|
|
167 |
<xsl:template match="tei:lb[@break='yes']"> |
|
168 |
<xsl:copy> |
|
169 |
<xsl:apply-templates select="@*"/> |
|
170 |
<xsl:attribute name="break">no</xsl:attribute> |
|
171 |
</xsl:copy> |
|
172 |
</xsl:template> |
|
173 |
|
|
174 |
<!-- on ajoute un attribut pour faciliter l'identification des segments à ne pas aligner --> |
|
175 |
|
|
176 |
<xsl:template match="tei:choice/tei:expan|tei:choice/tei:corr"> |
|
177 |
<xsl:copy> |
|
178 |
<xsl:apply-templates select="@*"/> |
|
179 |
<xsl:attribute name="ana">ori:align-no</xsl:attribute> |
|
180 |
<xsl:apply-templates/> |
|
181 |
</xsl:copy> |
|
182 |
</xsl:template> |
|
183 |
|
|
184 |
<xsl:template match="tei:rdg[not(matches(@wit,$baseMsPattern))]"> |
|
185 |
<xsl:copy> |
|
186 |
<xsl:apply-templates select="@*"/> |
|
187 |
<xsl:attribute name="ana">ori:align-no</xsl:attribute> |
|
188 |
<xsl:apply-templates/> |
|
189 |
</xsl:copy> |
|
190 |
</xsl:template> |
|
191 |
|
|
192 |
<xsl:template match="text()[following-sibling::*[1][self::tei:milestone or self::tei:pb or self::tei:cb or self::tei:lb] and following-sibling::tei:lb[1][@break]]"> |
|
193 |
<xsl:choose> |
|
194 |
<!-- patch d'espace blanc devant les sauts de ligne à l'intérieur de mots --> |
|
195 |
<xsl:when test="matches(.,'\s+$')"><xsl:value-of select="replace(.,'\s+$','')"/></xsl:when> |
|
196 |
<xsl:otherwise><xsl:copy/></xsl:otherwise> |
|
197 |
</xsl:choose> |
|
198 |
</xsl:template> |
|
199 |
|
|
200 |
</xsl:stylesheet> |
tmp/org.txm.oriflamms.rcp/bin/oriflamms-convert-inscriptions-oriflammsxml.xsl (revision 489) | ||
---|---|---|
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 |
xmlns:xi="http://www.w3.org/2001/XInclude" |
|
7 |
xmlns:svg="http://www.w3.org/2000/svg" |
|
8 |
xmlns:math="http://www.w3.org/1998/Math/MathML" |
|
9 |
exclude-result-prefixes="tei edate xd txm xi svg math" version="2.0"> |
|
10 |
|
|
11 |
<xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="no"/> |
|
12 |
|
|
13 |
<xd:doc type="stylesheet"> |
|
14 |
<xd:short> |
|
15 |
Cette feuille permet de convertir la transcription tokénisée des |
|
16 |
Chartes de Fontenay 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>2015, CNRS / ICAR (Équipe CACTUS)</xd:copyright> |
|
34 |
</xd:doc> |
|
35 |
|
|
36 |
<xsl:variable name="filename"> |
|
37 |
<xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/]+$"> |
|
38 |
<xsl:matching-substring> |
|
39 |
<xsl:value-of select="regex-group(2)"/> |
|
40 |
</xsl:matching-substring> |
|
41 |
</xsl:analyze-string> |
|
42 |
</xsl:variable> |
|
43 |
|
|
44 |
|
|
45 |
<xsl:strip-space elements="*"/> |
|
46 |
<xsl:template match="/"> |
|
47 |
<xsl:apply-templates/> |
|
48 |
</xsl:template> |
|
49 |
|
|
50 |
|
|
51 |
<xsl:template match="*"> |
|
52 |
<xsl:copy> |
|
53 |
<xsl:apply-templates select="@*"/> |
|
54 |
<xsl:apply-templates select="*|processing-instruction()|comment()|text()"/> |
|
55 |
</xsl:copy> |
|
56 |
</xsl:template> |
|
57 |
|
|
58 |
<xsl:template match="comment()|text()"> |
|
59 |
<xsl:copy/> |
|
60 |
</xsl:template> |
|
61 |
|
|
62 |
<xsl:template match="processing-instruction()"/> |
|
63 |
|
|
64 |
<!-- On supprime les attributs par défaut de la DTD TEI --> |
|
65 |
|
|
66 |
<xsl:template match="@*"> |
|
67 |
<xsl:choose> |
|
68 |
<xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/> |
|
69 |
<!-- <xsl:when test="matches(name(.),'rend')"> |
|
70 |
<xsl:choose> |
|
71 |
<xsl:when test="matches(.,'^aggl$')"><xsl:attribute name="rend">space-after(none)</xsl:attribute></xsl:when> |
|
72 |
<xsl:otherwise><xsl:copy/></xsl:otherwise> |
|
73 |
</xsl:choose> |
|
74 |
</xsl:when>--> |
|
75 |
<xsl:otherwise><xsl:copy/></xsl:otherwise> |
|
76 |
</xsl:choose> |
|
77 |
</xsl:template> |
|
78 |
|
|
79 |
<xsl:template match="tei:teiHeader"> |
|
80 |
<xsl:copy> |
|
81 |
<xsl:apply-templates select="@*"/> |
|
82 |
<xsl:apply-templates/> |
|
83 |
</xsl:copy> |
|
84 |
</xsl:template> |
|
85 |
|
|
86 |
|
|
87 |
<xsl:template match="tei:revisionDesc"> |
|
88 |
<xsl:copy> |
|
89 |
<xsl:apply-templates select="@*"/> |
|
90 |
<change xmlns="http://www.tei-c.org/ns/1.0" when="2007-01-01" who="#DS">Publication du document original</change> |
|
91 |
<!-- information récupérée à partir de /TEI/text[1]/front[1]/titlePage[1]/docDate[1] --> |
|
92 |
<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> |
|
93 |
<xsl:apply-templates/> |
|
94 |
</xsl:copy> |
|
95 |
</xsl:template> |
|
96 |
|
|
97 |
<xsl:template match="tei:encodingDesc"> |
|
98 |
<xsl:copy> |
|
99 |
<xsl:apply-templates select="@*"/> |
|
100 |
<xsl:apply-templates/> |
|
101 |
<xsl:if test="not(//tei:prefixDef[@ident='ori'])"> |
|
102 |
<listPrefixDef xmlns="http://www.tei-c.org/ns/1.0"> |
|
103 |
<prefixDef xmlns="http://www.tei-c.org/ns/1.0" ident="ori" |
|
104 |
matchPattern="([a-z]+)" |
|
105 |
replacementPattern="oriflamms-annotation-scheme.xml#$1"> |
|
106 |
<p>In the context of this project, private URIs with the prefix |
|
107 |
"ori" point to <gi>interp</gi> 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 |
<!-- On restructure le document pour avoir un TEI par charte --> |
|
117 |
|
|
118 |
<!-- TEI devient teiCorpus --> |
|
119 |
|
|
120 |
<xsl:template match="tei:TEI"> |
|
121 |
<xsl:element name="teiCorpus" xmlns="http://www.tei-c.org/ns/1.0"> |
|
122 |
<xsl:apply-templates select="@*"/> |
|
123 |
<xsl:apply-templates select="tei:teiHeader"/> |
|
124 |
<facsimile xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates select="tei:facsimile"/></facsimile> |
|
125 |
<xsl:apply-templates select="tei:text"/> |
|
126 |
</xsl:element> |
|
127 |
</xsl:template> |
|
128 |
|
|
129 |
<xsl:template match="tei:facsimile"> |
|
130 |
<xsl:apply-templates/> |
|
131 |
</xsl:template> |
|
132 |
|
|
133 |
|
|
134 |
<!-- on supprime l'élément text de niveau 1 et travaille directement sur le niveau 2 (l'élément group intermédiaire disparait)--> |
|
135 |
|
|
136 |
<xsl:template match="tei:TEI/tei:text"> |
|
137 |
<xsl:apply-templates select="descendant::tei:text"/> |
|
138 |
</xsl:template> |
|
139 |
|
|
140 |
<xsl:template match="tei:text//tei:text[descendant::*[matches(@facs,'\S')]]"> |
|
141 |
|
|
142 |
<TEI xmlns="http://www.tei-c.org/ns/1.0"> |
|
143 |
<teiHeader xmlns="http://www.tei-c.org/ns/1.0"> |
|
144 |
<fileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
145 |
<titleStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
146 |
<title xmlns="http://www.tei-c.org/ns/1.0"><xsl:text>Acte original </xsl:text> |
|
147 |
<xsl:value-of select="substring-after(preceding-sibling::comment()[contains(.,'acte original')][1],'acte original ')"/></title> |
|
148 |
<author xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="descendant::tei:docAuthor"/></author> |
|
149 |
</titleStmt> |
|
150 |
<publicationStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
151 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the teiCorpus</p> |
|
152 |
</publicationStmt> |
|
153 |
<!-- les éléments listWit et listBibl sont placés dans sourceDesc --> |
|
154 |
<sourceDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
155 |
<xsl:copy-of select="descendant::tei:listWit"/> |
|
156 |
<xsl:copy-of select="descendant::tei:listBibl[1]"></xsl:copy-of> |
|
157 |
</sourceDesc> |
|
158 |
</fileDesc> |
|
159 |
<profileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
160 |
<!-- docDate devient profileDesc/creation/date[@type='documentCreation'] --> |
|
161 |
<creation xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates select="descendant::tei:docDate"/></creation> |
|
162 |
<!-- argument devient profileDesc/abstract --> |
|
163 |
<xsl:apply-templates select="descendant::tei:argument"/> |
|
164 |
</profileDesc> |
|
165 |
</teiHeader> |
|
166 |
<text xmlns="http://www.tei-c.org/ns/1.0"> |
|
167 |
<xsl:apply-templates select="@*"/> |
|
168 |
<body xmlns="http://www.tei-c.org/ns/1.0"> |
|
169 |
<xsl:variable name="facsID"> |
|
170 |
<xsl:value-of select="replace(descendant::*[@facs[matches(.,'\S+')]][1]/@facs,'^#','')"/> |
|
171 |
</xsl:variable> |
|
172 |
<xsl:if test="not(tei:body//tei:milestone[@unit='surface'])"> |
|
173 |
<milestone xmlns="http://www.tei-c.org/ns/1.0" unit="surface"> |
|
174 |
<xsl:attribute name="xml:id"> |
|
175 |
<xsl:value-of select="concat('surf_',$filename,'_',replace(translate($facsID,' ()','_--'),'\.\w+$',''))"/> |
|
176 |
</xsl:attribute> |
|
177 |
<xsl:attribute name="facs"> |
|
178 |
<xsl:choose> |
|
179 |
<xsl:when test="matches(descendant::*[@facs][1]/@facs,'^#')"> |
|
180 |
<xsl:value-of select="//tei:zone[@xml:id=$facsID]/preceding-sibling::tei:graphic[1]/@url"/> |
|
181 |
</xsl:when> |
|
182 |
<xsl:otherwise><xsl:value-of select="$facsID"/></xsl:otherwise> |
|
183 |
</xsl:choose> |
|
184 |
</xsl:attribute> |
|
185 |
</milestone> |
|
186 |
</xsl:if> |
|
187 |
<xsl:if test="not(descendant::tei:pb[@facs]) and not(tei:body//tei:milestone[@unit='surface'])"> |
|
188 |
<pb xmlns="http://www.tei-c.org/ns/1.0"> |
|
189 |
<xsl:attribute name="facs"> |
|
190 |
<xsl:choose> |
|
191 |
<xsl:when test="matches(descendant::*[@facs][1]/@facs,'^#')"> |
|
192 |
<xsl:value-of select="//tei:graphic[following-sibling::tei:zone[@xml:id=$facsID]]/@url"/> |
|
193 |
<!--<xsl:value-of select="$facsID"/>--> |
|
194 |
</xsl:when> |
|
195 |
<xsl:otherwise><xsl:value-of select="descendant::*[@facs][1]/@facs"/></xsl:otherwise> |
|
196 |
</xsl:choose> |
|
197 |
</xsl:attribute> |
|
198 |
</pb> |
|
199 |
</xsl:if> |
|
200 |
<xsl:apply-templates select="descendant::tei:div1"/> |
|
201 |
</body> |
|
202 |
</text> |
|
203 |
</TEI> |
|
204 |
</xsl:template> |
|
205 |
|
|
206 |
<xsl:template match="tei:text//tei:text[not(descendant::*[@facs])]"> |
|
207 |
<xsl:comment>No facs attribute provided for any element in this text (n="<xsl:value-of select="@n"/>")!</xsl:comment> |
|
208 |
<xsl:comment><xsl:copy-of select="."/></xsl:comment> |
|
209 |
</xsl:template> |
|
210 |
|
|
211 |
<xsl:template match="tei:docDate[ancestor::tei:group]"> |
|
212 |
<date type="documentCreation" xmlns="http://www.tei-c.org/ns/1.0"> |
|
213 |
<xsl:apply-templates select="@*"/> |
|
214 |
<xsl:apply-templates/> |
|
215 |
</date> |
|
216 |
</xsl:template> |
|
217 |
|
|
218 |
<xsl:template match="tei:argument"> |
|
219 |
<abstract xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates/></abstract> |
|
220 |
</xsl:template> |
|
221 |
|
|
222 |
<!-- on ajoute un attribut pour faciliter l'identification des segments à ne pas aligner --> |
|
223 |
|
|
224 |
<xsl:template match="tei:choice/tei:expan|tei:choice/tei:corr|tei:div1[@type='edition']"> |
|
225 |
<xsl:copy> |
|
226 |
<xsl:apply-templates select="@*"/> |
|
227 |
<xsl:attribute name="ana">ori:align-no</xsl:attribute> |
|
228 |
<xsl:apply-templates/> |
|
229 |
</xsl:copy> |
|
230 |
</xsl:template> |
|
231 |
|
|
232 |
|
|
233 |
</xsl:stylesheet> |
tmp/org.txm.oriflamms.rcp/bin/oriflamms-patch-milestones.xsl (revision 489) | ||
---|---|---|
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 |
xmlns:xi="http://www.w3.org/2001/XInclude" |
|
7 |
xmlns:svg="http://www.w3.org/2000/svg" |
|
8 |
xmlns:math="http://www.w3.org/1998/Math/MathML" |
|
9 |
exclude-result-prefixes="tei edate xd txm xi svg math" version="2.0"> |
|
10 |
|
|
11 |
<xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="no"/> |
|
12 |
|
|
13 |
<xd:doc type="stylesheet"> |
|
14 |
<xd:short> |
|
15 |
Cette feuille permet de rajouter les éléments milestone et cb, et les identifiants |
|
16 |
manquant sur lb |
|
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>2015, CNRS / ICAR (Équipe CACTUS)</xd:copyright> |
|
34 |
</xd:doc> |
|
35 |
|
|
36 |
<!--<xsl:strip-space elements="*"/>--> |
|
37 |
|
|
38 |
<xsl:variable name="textID"> |
|
39 |
<xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/]+$"> |
|
40 |
<xsl:matching-substring> |
|
41 |
<xsl:value-of select="regex-group(2)"/> |
|
42 |
</xsl:matching-substring> |
|
43 |
</xsl:analyze-string> |
|
44 |
</xsl:variable> |
|
45 |
|
|
46 |
<xsl:template match="/"> |
|
47 |
<xsl:apply-templates/> |
|
48 |
</xsl:template> |
|
49 |
|
|
50 |
|
|
51 |
<xsl:template match="*"> |
|
52 |
<xsl:copy> |
|
53 |
<xsl:apply-templates select="@*"/> |
|
54 |
<xsl:apply-templates select="*|processing-instruction()|comment()|text()"/> |
|
55 |
</xsl:copy> |
|
56 |
</xsl:template> |
|
57 |
|
|
58 |
<xsl:template match="processing-instruction()"></xsl:template> |
|
59 |
|
|
60 |
<xsl:template match="comment()|text()"> |
|
61 |
<xsl:copy/> |
|
62 |
</xsl:template> |
|
63 |
|
|
64 |
<!-- On supprime les attributs par défaut de la DTD TEI --> |
|
65 |
|
|
66 |
<xsl:template match="@*"> |
|
67 |
<xsl:choose> |
|
68 |
<xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/> |
|
69 |
<!-- <xsl:when test="matches(name(.),'rend')"> |
|
70 |
<xsl:choose> |
|
71 |
<xsl:when test="matches(.,'^aggl$')"><xsl:attribute name="rend">space-after(none)</xsl:attribute></xsl:when> |
|
72 |
<xsl:otherwise><xsl:copy/></xsl:otherwise> |
|
73 |
</xsl:choose> |
|
74 |
</xsl:when>--> |
|
75 |
<xsl:otherwise><xsl:copy/></xsl:otherwise> |
|
76 |
</xsl:choose> |
|
77 |
</xsl:template> |
|
78 |
|
|
79 |
<xsl:template match="tei:pb[not(ancestor::tei:supplied)]"> |
|
80 |
<xsl:variable name="facs"><xsl:value-of select="@facs"/></xsl:variable> |
|
81 |
<xsl:if test="matches(@facs,'\.(tiff?|png|jpg)$','i') and not(preceding-sibling::*[position() lt 3][self::tei:milestone[@unit='surface']]) and not(preceding::tei:pb[@facs=$facs])"> |
|
82 |
<milestone xmlns="http://www.tei-c.org/ns/1.0" unit="surface" facs="{@facs}"/> |
|
83 |
</xsl:if> |
|
84 |
<xsl:copy> |
|
85 |
<xsl:apply-templates select="@*"/> |
|
86 |
</xsl:copy> |
|
87 |
<xsl:if test="not(following::*[position() lt 5][self::tei:cb])"> |
|
88 |
<xsl:comment>cb added automatically</xsl:comment> |
|
89 |
<cb xmlns="http://www.tei-c.org/ns/1.0"/> |
|
90 |
</xsl:if> |
|
91 |
<xsl:if test="not(following::*[position() lt 5][self::tei:lb or self::tei:cb])"> |
|
92 |
<lb xmlns="http://www.tei-c.org/ns/1.0"/> |
|
93 |
<xsl:comment>lb added automatically</xsl:comment> |
|
94 |
</xsl:if> |
|
95 |
</xsl:template> |
|
96 |
|
|
97 |
<xsl:template match="tei:cb[not(ancestor::tei:supplied)]"> |
|
98 |
<xsl:copy> |
|
99 |
<xsl:apply-templates select="@*"/> |
|
100 |
</xsl:copy> |
|
101 |
<xsl:if test="not(following::*[position() lt 5][self::tei:lb])"> |
|
102 |
<lb xmlns="http://www.tei-c.org/ns/1.0"/> |
|
103 |
</xsl:if> |
|
104 |
</xsl:template> |
|
105 |
|
|
106 |
<xsl:template match="tei:lb"> |
|
107 |
<xsl:copy> |
|
108 |
<xsl:apply-templates select="@*"/> |
|
109 |
<xsl:if test="matches(@rend,'^(right|center|centre)#')"> |
|
110 |
<xsl:attribute name="type">rejet</xsl:attribute> |
|
111 |
</xsl:if> |
|
112 |
</xsl:copy> |
|
113 |
</xsl:template> |
|
114 |
|
|
115 |
<xsl:template match="tei:milestone[@unit='surface' and @facs=preceding::tei:milestone[@unit='surface']/@facs]"> |
|
116 |
<xsl:comment>Doublon éliminé <xsl:value-of select="@xml:id"/></xsl:comment> |
|
117 |
</xsl:template> |
|
118 |
|
|
119 |
</xsl:stylesheet> |
tmp/org.txm.oriflamms.rcp/bin/oriflamms-convert-graalc-oriflammsxml.xsl (revision 489) | ||
---|---|---|
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,'^#?(.̅|.ͣ|.ͤ|.ͥ|bn̅|chʼꝛ|ch̅ꝛ|chꝛ̅|gnͣt|qnͣt|͛|᷑|⁊|∻|ꝯ|ꝰ|||)$')"> |
|
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̅$')">b<ex xmlns="http://www.tei-c.org/ns/1.0">ie</ex>n</xsl:when> |
|
204 |
<xsl:when test="matches($abbrexpan,'^(chʼꝛ|ch̅ꝛ|chꝛ̅)$')">ch<ex xmlns="http://www.tei-c.org/ns/1.0">evalie</ex>r</xsl:when> |
|
205 |
<xsl:when test="matches($abbrexpan,'gnͣ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ͣ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,'.̅$')"> |
|
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,'.ͣ')"> |
|
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,'.ͤ')"> |
|
226 |
<xsl:value-of select="substring($abbrexpan,1,1)"/> |
Formats disponibles : Unified diff