Révision 2398
tmp/org.txm.ocaml.core/.classpath (revision 2398) | ||
---|---|---|
1 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 | 2 |
<classpath> |
3 |
<classpathentry exported="true" kind="lib" path="lib/ocaml-lib-files.jar"/> |
|
4 |
<classpathentry exported="true" kind="lib" path="lib/ocamlrun-scripting.jar"/> |
|
5 |
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> |
|
6 |
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"> |
|
7 |
<accessrules> |
|
8 |
<accessrule kind="accessible" pattern="**"/> |
|
9 |
</accessrules> |
|
10 |
</classpathentry> |
|
11 |
<classpathentry kind="src" path="src"/> |
|
12 |
<classpathentry kind="output" path="bin"/> |
|
3 |
<classpathentry exported="true" kind="lib" |
|
4 |
path="lib/ocaml-lib-files.jar" /> |
|
5 |
<classpathentry exported="true" kind="lib" |
|
6 |
path="lib/ocamlrun-scripting.jar" /> |
|
7 |
<classpathentry kind="con" |
|
8 |
path="org.eclipse.jdt.launching.JRE_CONTAINER" /> |
|
9 |
<classpathentry kind="con" |
|
10 |
path="org.eclipse.pde.core.requiredPlugins"> |
|
11 |
<accessrules> |
|
12 |
<accessrule kind="accessible" pattern="**" /> |
|
13 |
</accessrules> |
|
14 |
</classpathentry> |
|
15 |
<classpathentry kind="src" path="src" /> |
|
16 |
<classpathentry kind="output" path="bin" /> |
|
13 | 17 |
</classpath> |
tmp/org.txm.oriflamms.rcp/groovy/org/txm/macro/oriflamms/prepare/oriflamms-convert-nesle-oriflammsxml.xsl (revision 2398) | ||
---|---|---|
1 | 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"> |
|
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 |
xmlns:xi="http://www.w3.org/2001/XInclude" |
|
9 |
xmlns:svg="http://www.w3.org/2000/svg" |
|
10 |
xmlns:math="http://www.w3.org/1998/Math/MathML" |
|
11 |
exclude-result-prefixes="tei edate xd txm xi svg math" version="2.0"> |
|
10 | 12 |
|
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()"/> |
|
13 |
<xsl:output method="xml" encoding="utf-8" |
|
14 |
omit-xml-declaration="no" indent="no" /> |
|
51 | 15 |
|
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> |
|
16 |
<xd:doc type="stylesheet"> |
|
17 |
<xd:short> |
|
18 |
Cette feuille permet de convertir les transcription des |
|
19 |
Chartes de Fontenay au format XML-TEI du projet Oriflamms. |
|
20 |
</xd:short> |
|
21 |
<xd:detail> |
|
22 |
This stylesheet is free software; you can redistribute it and/or |
|
23 |
modify it under the terms of the GNU Lesser General Public |
|
24 |
License as published by the Free Software Foundation; either |
|
25 |
version 3 of the License, or (at your option) any later version. |
|
60 | 26 |
|
61 |
<xsl:template match="@facs"> |
|
62 |
<xsl:attribute name="facs"><xsl:value-of select="replace(.,'\.tif$','.png','i')"/></xsl:attribute> |
|
63 |
</xsl:template> |
|
27 |
This stylesheet is distributed in the hope that it will be useful, |
|
28 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
29 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
30 |
Lesser General Public License for more details. |
|
64 | 31 |
|
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 |
|
|
32 |
You should have received a copy of GNU Lesser Public License with |
|
33 |
this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html |
|
34 |
</xd:detail> |
|
35 |
<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author> |
|
36 |
<xd:copyright>2015, CNRS / ICAR (Équipe CACTUS)</xd:copyright> |
|
37 |
</xd:doc> |
|
72 | 38 |
|
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> |
|
39 |
<!--<xsl:strip-space elements="*"/> --> |
|
101 | 40 |
|
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> |
|
41 |
<xsl:param name="baseMsSiglum"> |
|
42 |
A |
|
43 |
</xsl:param> |
|
112 | 44 |
|
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>--> |
|
45 |
<xsl:variable name="baseMsPattern"> |
|
46 |
<xsl:value-of |
|
47 |
select="concat('^#?',$baseMsSiglum,'| #?',$baseMsSiglum)" /> |
|
48 |
</xsl:variable> |
|
118 | 49 |
|
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> |
|
50 |
<xsl:template match="*|comment()"> |
|
51 |
<!-- Copy the current node --> |
|
52 |
<xsl:copy> |
|
53 |
<!-- Including any attributes it has and any child nodes --> |
|
54 |
<xsl:apply-templates select="@*|node()" /> |
|
55 |
</xsl:copy> |
|
56 |
</xsl:template> |
|
262 | 57 |
|
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> |
|
58 |
<xsl:template match="processing-instruction()" /> |
|
303 | 59 |
|
304 |
<xsl:template match="tei:argument"/> |
|
305 |
|
|
60 |
<!-- On supprime les attributs par défaut de la DTD TEI --> |
|
306 | 61 |
|
62 |
<xsl:template match="@*"> |
|
63 |
<xsl:choose> |
|
64 |
<xsl:when |
|
65 |
test="matches(name(.),'^(part|instant|anchored|full)$')" /> |
|
66 |
<xsl:otherwise> |
|
67 |
<xsl:copy /> |
|
68 |
</xsl:otherwise> |
|
69 |
</xsl:choose> |
|
70 |
</xsl:template> |
|
307 | 71 |
|
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> |
|
72 |
<xsl:template match="@facs"> |
|
73 |
<xsl:attribute name="facs"><xsl:value-of |
|
74 |
select="replace(.,'\.tif$','.png','i')" /></xsl:attribute> |
|
75 |
</xsl:template> |
|
317 | 76 |
|
318 |
<xsl:template match="tei:group/tei:head"/> |
|
77 |
<xsl:template match="tei:teiHeader"> |
|
78 |
<xsl:copy> |
|
79 |
<xsl:apply-templates select="@*" /> |
|
80 |
<xsl:apply-templates /> |
|
81 |
</xsl:copy> |
|
82 |
</xsl:template> |
|
319 | 83 |
|
320 |
<!-- on supprime listWit du corps du texte (cf. l'entête) --> |
|
321 |
<xsl:template match="tei:listWit"/> |
|
322 | 84 |
|
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> |
|
85 |
<xsl:template match="tei:revisionDesc"> |
|
86 |
<xsl:copy> |
|
87 |
<xsl:apply-templates select="@*" /> |
|
88 |
<change xmlns="http://www.tei-c.org/ns/1.0" when="2007-01-01" |
|
89 |
who="#DS">Publication du document original</change> |
|
90 |
<!-- information récupérée à partir de /TEI/text[1]/front[1]/titlePage[1]/docDate[1] --> |
|
91 |
<change xmlns="http://www.tei-c.org/ns/1.0" |
|
92 |
when="{format-date(current-date(),'[Y]-[M01]-[D01]')}" who="#auto">Conversion |
|
93 |
automatique au format XML-TEI-Oriflamms</change> |
|
94 |
<xsl:apply-templates /> |
|
95 |
</xsl:copy> |
|
96 |
</xsl:template> |
|
328 | 97 |
|
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"/> |
|
98 |
<xsl:template match="tei:encodingDesc"> |
|
99 |
<xsl:copy> |
|
100 |
<xsl:apply-templates select="@*" /> |
|
101 |
<xsl:apply-templates /> |
|
102 |
<xsl:if test="not(//tei:prefixDef[@ident='ori'])"> |
|
103 |
<listPrefixDef xmlns="http://www.tei-c.org/ns/1.0"> |
|
104 |
<prefixDef xmlns="http://www.tei-c.org/ns/1.0" |
|
105 |
ident="ori" matchPattern="([a-z]+)" |
|
106 |
replacementPattern="oriflamms-annotation-scheme.xml#$1"> |
|
107 |
<p> |
|
108 |
In the context of this project, private URIs with the prefix |
|
109 |
"ori" point to |
|
110 |
<gi>interp</gi> |
|
111 |
elements in the project's |
|
112 |
oriflamms-annotation-scheme.xml file. |
|
113 |
</p> |
|
114 |
</prefixDef> |
|
115 |
</listPrefixDef> |
|
116 |
</xsl:if> |
|
117 |
</xsl:copy> |
|
118 |
</xsl:template> |
|
119 |
|
|
120 |
<!-- On restructure le document pour avoir un TEI par charte --> |
|
121 |
|
|
122 |
<!-- TEI devient teiCorpus --> |
|
123 |
|
|
124 |
<xsl:template match="tei:TEI"> |
|
125 |
<xsl:element name="teiCorpus" |
|
126 |
xmlns="http://www.tei-c.org/ns/1.0"> |
|
127 |
<xsl:apply-templates select="@*" /> |
|
128 |
<xsl:apply-templates /> |
|
129 |
</xsl:element> |
|
130 |
</xsl:template> |
|
131 |
|
|
132 |
<!-- on supprime l'élément text de niveau 1 et travaille directement sur |
|
133 |
le niveau 2 (l'élément group intermédiaire disparait) --> |
|
134 |
|
|
135 |
<!-- <xsl:template match="tei:TEI/tei:text"> <xsl:apply-templates select="descendant::tei:text"/> |
|
136 |
</xsl:template> --> |
|
137 |
|
|
138 |
|
|
139 |
<xsl:template match="tei:text[descendant::tei:text]"> |
|
140 |
|
|
141 |
<!-- <teiCorpus xmlns="http://www.tei-c.org/ns/1.0"> <teiHeader xmlns="http://www.tei-c.org/ns/1.0"> |
|
142 |
<fileDesc xmlns="http://www.tei-c.org/ns/1.0"> <titleStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
143 |
<title xmlns="http://www.tei-c.org/ns/1.0"> <xsl:value-of select="tei:group[1]/tei:head[1]"/> |
|
144 |
</title> </titleStmt> <publicationStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
145 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
146 |
</publicationStmt> <sourceDesc xmlns="http://www.tei-c.org/ns/1.0"> <p xmlns="http://www.tei-c.org/ns/1.0">See |
|
147 |
the header of the top level teiCorpus</p> </sourceDesc> </fileDesc> <profileDesc |
|
148 |
xmlns="http://www.tei-c.org/ns/1.0"> <!-\- argument devient profileDesc/abstract |
|
149 |
-\-> <xsl:apply-templates select="descendant::tei:argument[1]"/> </profileDesc> |
|
150 |
</teiHeader> <xsl:apply-templates/> </teiCorpus> --> |
|
151 |
<xsl:apply-templates /> |
|
152 |
</xsl:template> |
|
153 |
|
|
154 |
<xsl:template |
|
155 |
match="tei:text[descendant::tei:text]/tei:front"> |
|
156 |
<xsl:choose> |
|
157 |
<xsl:when test="descendant::tei:div"> |
|
158 |
<TEI xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no"> |
|
159 |
<teiHeader xmlns="http://www.tei-c.org/ns/1.0"> |
|
160 |
<fileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
161 |
<titleStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
162 |
<title xmlns="http://www.tei-c.org/ns/1.0"> |
|
163 |
<xsl:text>Introduction chercheur</xsl:text> |
|
164 |
</title> |
|
165 |
</titleStmt> |
|
166 |
<publicationStmt |
|
167 |
xmlns="http://www.tei-c.org/ns/1.0"> |
|
168 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
169 |
</publicationStmt> |
|
170 |
<sourceDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
171 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
172 |
</sourceDesc> |
|
173 |
</fileDesc> |
|
174 |
</teiHeader> |
|
175 |
<text xmlns="http://www.tei-c.org/ns/1.0"> |
|
176 |
<body xmlns="http://www.tei-c.org/ns/1.0"> |
|
177 |
<xsl:apply-templates |
|
178 |
select="descendant::tei:div" /> |
|
179 |
</body> |
|
180 |
|
|
181 |
</text> |
|
182 |
</TEI> |
|
183 |
</xsl:when> |
|
184 |
<xsl:otherwise> |
|
185 |
<xsl:comment> |
|
186 |
<xsl:copy-of select="." /> |
|
187 |
</xsl:comment> |
|
188 |
</xsl:otherwise> |
|
189 |
</xsl:choose> |
|
190 |
</xsl:template> |
|
191 |
|
|
192 |
<xsl:template |
|
193 |
match="tei:text[descendant::tei:text]/tei:back"> |
|
194 |
<xsl:choose> |
|
195 |
<xsl:when test="descendant::tei:div"> |
|
196 |
<TEI xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no"> |
|
197 |
<teiHeader xmlns="http://www.tei-c.org/ns/1.0"> |
|
198 |
<fileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
199 |
<titleStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
200 |
<title xmlns="http://www.tei-c.org/ns/1.0"> |
|
201 |
<xsl:text>Annexes</xsl:text> |
|
202 |
</title> |
|
203 |
</titleStmt> |
|
204 |
<publicationStmt |
|
205 |
xmlns="http://www.tei-c.org/ns/1.0"> |
|
206 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
207 |
</publicationStmt> |
|
208 |
<sourceDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
209 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
210 |
</sourceDesc> |
|
211 |
</fileDesc> |
|
212 |
</teiHeader> |
|
213 |
<text xmlns="http://www.tei-c.org/ns/1.0"> |
|
214 |
<body xmlns="http://www.tei-c.org/ns/1.0"> |
|
215 |
<xsl:apply-templates |
|
216 |
select="descendant::tei:div" /> |
|
217 |
</body> |
|
218 |
|
|
219 |
</text> |
|
220 |
</TEI> |
|
221 |
</xsl:when> |
|
222 |
<xsl:otherwise> |
|
223 |
<xsl:comment> |
|
224 |
<xsl:copy-of select="." /> |
|
225 |
</xsl:comment> |
|
226 |
</xsl:otherwise> |
|
227 |
</xsl:choose> |
|
228 |
</xsl:template> |
|
229 |
|
|
230 |
<xsl:template |
|
231 |
match="tei:group[@n='edition']|tei:group[@n='recueil']"> |
|
232 |
<xsl:apply-templates /> |
|
233 |
</xsl:template> |
|
234 |
|
|
235 |
<xsl:template |
|
236 |
match="tei:group[@n='edition']/ tei:group[@n='introduction']"> |
|
237 |
<TEI xmlns="http://www.tei-c.org/ns/1.0"> |
|
238 |
<teiHeader xmlns="http://www.tei-c.org/ns/1.0"> |
|
239 |
<fileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
240 |
<titleStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
241 |
<title xmlns="http://www.tei-c.org/ns/1.0"> |
|
242 |
<xsl:text>Introduction</xsl:text> |
|
243 |
</title> |
|
244 |
</titleStmt> |
|
245 |
<publicationStmt |
|
246 |
xmlns="http://www.tei-c.org/ns/1.0"> |
|
247 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
248 |
</publicationStmt> |
|
249 |
<sourceDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
250 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
251 |
</sourceDesc> |
|
252 |
</fileDesc> |
|
253 |
</teiHeader> |
|
254 |
<xsl:apply-templates /> |
|
255 |
</TEI> |
|
256 |
|
|
257 |
</xsl:template> |
|
258 |
|
|
259 |
<xsl:template |
|
260 |
match="tei:group[@n='edition']/ tei:group[@n='table']"> |
|
261 |
<TEI xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no"> |
|
262 |
<teiHeader xmlns="http://www.tei-c.org/ns/1.0"> |
|
263 |
<fileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
264 |
<titleStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
265 |
<title xmlns="http://www.tei-c.org/ns/1.0"> |
|
266 |
<xsl:text>Table</xsl:text> |
|
267 |
</title> |
|
268 |
</titleStmt> |
|
269 |
<publicationStmt |
|
270 |
xmlns="http://www.tei-c.org/ns/1.0"> |
|
271 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
272 |
</publicationStmt> |
|
273 |
<sourceDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
274 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
275 |
</sourceDesc> |
|
276 |
</fileDesc> |
|
277 |
</teiHeader> |
|
278 |
<text xmlns="http://www.tei-c.org/ns/1.0"> |
|
279 |
<xsl:copy-of select="." /> |
|
280 |
</text> |
|
281 |
</TEI> |
|
282 |
|
|
283 |
</xsl:template> |
|
284 |
|
|
285 |
<xsl:template |
|
286 |
match="tei:group[@n='edition']/tei:group[@n='recueil']/tei:text"> |
|
287 |
|
|
288 |
<TEI xmlns="http://www.tei-c.org/ns/1.0"> |
|
289 |
<teiHeader xmlns="http://www.tei-c.org/ns/1.0"> |
|
290 |
<fileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
291 |
<titleStmt xmlns="http://www.tei-c.org/ns/1.0"> |
|
292 |
<title xmlns="http://www.tei-c.org/ns/1.0"> |
|
293 |
<xsl:value-of select="descendant::tei:docTitle[1]"></xsl:value-of> |
|
294 |
</title> |
|
295 |
<xsl:if test="descendant::tei:docAuthor"> |
|
296 |
<author xmlns="http://www.tei-c.org/ns/1.0"> |
|
297 |
<xsl:value-of select="descendant::tei:docAuthor[1]"></xsl:value-of> |
|
298 |
</author> |
|
299 |
</xsl:if> |
|
300 |
|
|
301 |
</titleStmt> |
|
302 |
<publicationStmt |
|
303 |
xmlns="http://www.tei-c.org/ns/1.0"> |
|
304 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
305 |
</publicationStmt> |
|
306 |
<!-- les éléments listWit et listBibl sont placés dans sourceDesc --> |
|
307 |
<sourceDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
308 |
<p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p> |
|
309 |
</sourceDesc> |
|
310 |
</fileDesc> |
|
311 |
<profileDesc xmlns="http://www.tei-c.org/ns/1.0"> |
|
312 |
<!-- docDate devient profileDesc/creation/date[@type='documentCreation'] --> |
|
313 |
<creation xmlns="http://www.tei-c.org/ns/1.0"> |
|
314 |
<xsl:apply-templates |
|
315 |
select="descendant::tei:docDate/tei:date" /> |
|
316 |
</creation> |
|
317 |
</profileDesc> |
|
318 |
</teiHeader> |
|
319 |
<text xmlns="http://www.tei-c.org/ns/1.0"> |
|
320 |
<xsl:if test="preceding-sibling::*[1][self::tei:milestone]"> |
|
321 |
<xsl:copy-of |
|
322 |
select="preceding-sibling::tei:milestone[1]"></xsl:copy-of> |
|
323 |
</xsl:if> |
|
324 |
<xsl:apply-templates /> |
|
325 |
</text> |
|
326 |
</TEI> |
|
327 |
</xsl:template> |
|
328 |
|
|
329 |
<xsl:template |
|
330 |
match="tei:text[not(descendant::tei:text)]/tei:front"> |
|
331 |
</xsl:template> |
|
332 |
|
|
333 |
<xsl:template match="tei:argument" /> |
|
334 |
|
|
335 |
|
|
336 |
|
|
337 |
|
|
338 |
<xsl:template match="tei:milestone"> |
|
339 |
<xsl:choose> |
|
340 |
<xsl:when test="parent::tei:group" /> |
|
341 |
<xsl:otherwise> |
|
342 |
<xsl:copy-of select="." /> |
|
343 |
</xsl:otherwise> |
|
344 |
</xsl:choose> |
|
345 |
</xsl:template> |
|
346 |
|
|
347 |
<xsl:template match="tei:group/tei:head" /> |
|
348 |
|
|
349 |
<!-- on supprime listWit du corps du texte (cf. l'entête) --> |
|
350 |
<xsl:template match="tei:listWit" /> |
|
351 |
|
|
352 |
<!-- on supprime les entêtes et pied de pages (non alignables) --> |
|
353 |
|
|
354 |
<xsl:template match="tei:fw"> |
|
355 |
<xsl:comment> |
|
356 |
fw : |
|
357 |
<xsl:copy-of select="." /> |
|
358 |
</xsl:comment> |
|
359 |
</xsl:template> |
|
360 |
|
|
361 |
<!-- on ajoute un attribut pour faciliter l'identification des segments |
|
362 |
à ne pas aligner --> |
|
363 |
|
|
364 |
<xsl:template |
|
365 |
match="tei:choice/tei:expan|tei:choice/tei:corr|tei:supplied|tei:note"> |
|
366 |
<xsl:copy> |
|
367 |
<xsl:apply-templates select="@*" /> |
|
368 |
<xsl:attribute name="ana">ori:align-no</xsl:attribute> |
|
369 |
<xsl:apply-templates /> |
|
370 |
</xsl:copy> |
|
371 |
</xsl:template> |
|
372 |
|
|
373 |
<xsl:template match="tei:pb"> |
|
374 |
<xsl:variable name="facs"> |
|
375 |
<xsl:value-of select="@facs" /> |
|
376 |
</xsl:variable> |
|
377 |
<xsl:if |
|
378 |
test="//tei:zone[@xml:id=substring-after($facs,'#')] and not(preceding::tei:pb[@facs=$facs])"> |
|
379 |
<milestone xmlns="http://www.tei-c.org/ns/1.0" |
|
380 |
unit="surface"> |
|
381 |
<xsl:attribute name="facs"> |
|
382 |
<xsl:value-of |
|
383 |
select="//tei:surface[tei:zone[@xml:id=substring-after($facs,'#')]][1]/tei:graphic/@url" /> |
|
347 | 384 |
</xsl:attribute> |
348 |
</milestone> |
|
349 |
</xsl:if> |
|
350 |
<xsl:copy-of select="."/> |
|
351 |
</xsl:template> |
|
352 |
|
|
385 |
</milestone> |
|
386 |
</xsl:if> |
|
387 |
<xsl:copy-of select="." /> |
|
388 |
</xsl:template> |
|
353 | 389 |
|
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 | 390 |
|
391 |
<xsl:template |
|
392 |
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']]"> |
|
393 |
<xsl:choose> |
|
394 |
<!-- patch d'espace blanc devant les sauts de ligne à l'intérieur de mots --> |
|
395 |
<xsl:when test="matches(.,'\s+$')"> |
|
396 |
<xsl:value-of select="replace(.,'\s+$','')" /> |
|
397 |
</xsl:when> |
|
398 |
<xsl:otherwise> |
|
399 |
<xsl:copy /> |
|
400 |
</xsl:otherwise> |
|
401 |
</xsl:choose> |
|
402 |
</xsl:template> |
|
403 |
|
|
404 |
<xsl:template match="tei:witDetail"> |
|
405 |
<xsl:text> </xsl:text> |
|
406 |
<xsl:copy> |
|
407 |
<xsl:apply-templates select="@*" /> |
|
408 |
<xsl:attribute name="ana">ori:align-no</xsl:attribute> |
|
409 |
<xsl:apply-templates /> |
|
410 |
</xsl:copy> |
|
411 |
</xsl:template> |
|
412 |
|
|
371 | 413 |
</xsl:stylesheet> |
tmp/org.txm.oriflamms.rcp/groovy/org/txm/macro/oriflamms/prepare/oriflamms-patch-words-with-lb.xsl (revision 2398) | ||
---|---|---|
1 | 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"> |
|
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 |
exclude-result-prefixes="tei edate" version="2.0"> |
|
5 | 7 |
|
6 |
<xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/> |
|
8 |
<xsl:output method="xml" encoding="utf-8" |
|
9 |
omit-xml-declaration="no" /> |
|
7 | 10 |
|
8 | 11 |
<xsl:template match="node()|@*"> |
9 | 12 |
<!-- Copy the current node --> |
10 | 13 |
<xsl:copy> |
11 | 14 |
<!-- Including any attributes it has and any child nodes --> |
12 |
<xsl:apply-templates select="@*|node()"/> |
|
15 |
<xsl:apply-templates select="@*|node()" />
|
|
13 | 16 |
</xsl:copy> |
14 | 17 |
</xsl:template> |
15 | 18 |
|
16 | 19 |
<xsl:template name="wp1"> |
17 |
<xsl:for-each select="child::node()[not(self::tei:pb or self::tei:cb or self::tei:milestone) and following-sibling::*[descendant-or-self::tei:lb]]"> |
|
18 |
<xsl:apply-templates select="."/> |
|
20 |
<xsl:for-each |
|
21 |
select="child::node()[not(self::tei:pb or self::tei:cb or self::tei:milestone) and following-sibling::*[descendant-or-self::tei:lb]]"> |
|
22 |
<xsl:apply-templates select="." /> |
|
19 | 23 |
</xsl:for-each> |
20 | 24 |
<xsl:for-each select="child::*[descendant::tei:lb]"> |
21 | 25 |
<xsl:copy> |
22 |
<xsl:apply-templates select="@*"/> |
|
23 |
<xsl:call-template name="wp1"/> |
|
26 |
<xsl:apply-templates select="@*" />
|
|
27 |
<xsl:call-template name="wp1" />
|
|
24 | 28 |
</xsl:copy> |
25 | 29 |
</xsl:for-each> |
26 | 30 |
</xsl:template> |
27 |
|
|
31 |
|
|
28 | 32 |
<xsl:template name="wp2"> |
29 | 33 |
<xsl:for-each select="child::*[descendant::tei:lb]"> |
30 | 34 |
<xsl:copy> |
31 |
<xsl:apply-templates select="@*"/> |
|
32 |
<xsl:call-template name="wp2"/> |
|
35 |
<xsl:apply-templates select="@*" />
|
|
36 |
<xsl:call-template name="wp2" />
|
|
33 | 37 |
</xsl:copy> |
34 |
</xsl:for-each> |
|
35 |
<xsl:for-each select="child::node()[not(self::tei:pb or self::tei:cb or self::tei:milestone) and preceding-sibling::*[descendant-or-self::tei:lb]]"> |
|
36 |
<xsl:apply-templates select="."/> |
|
37 | 38 |
</xsl:for-each> |
39 |
<xsl:for-each |
|
40 |
select="child::node()[not(self::tei:pb or self::tei:cb or self::tei:milestone) and preceding-sibling::*[descendant-or-self::tei:lb]]"> |
|
41 |
<xsl:apply-templates select="." /> |
|
42 |
</xsl:for-each> |
|
38 | 43 |
</xsl:template> |
39 | 44 |
|
40 |
<xsl:template match="tei:w[not(ancestor::tei:w or ancestor::tei:pc)]"> |
|
45 |
<xsl:template |
|
46 |
match="tei:w[not(ancestor::tei:w or ancestor::tei:pc)]"> |
|
41 | 47 |
<xsl:copy> |
42 |
<xsl:apply-templates select="@*"/> |
|
48 |
<xsl:apply-templates select="@*" />
|
|
43 | 49 |
<xsl:choose> |
44 |
<xsl:when test="descendant::tei:lb and not(descendant::tei:seg[@type='wp'])"> |
|
50 |
<xsl:when |
|
51 |
test="descendant::tei:lb and not(descendant::tei:seg[@type='wp'])"> |
|
45 | 52 |
<seg xmlns="http://www.tei-c.org/ns/1.0" type="wp" part="I"> |
46 |
<xsl:call-template name="wp1"/> |
|
53 |
<xsl:call-template name="wp1" />
|
|
47 | 54 |
</seg> |
48 |
<xsl:apply-templates select="descendant::tei:milestone|descendant::tei:pb|descendant::tei:cb|descendant::tei:lb"/> |
|
55 |
<xsl:apply-templates |
|
56 |
select="descendant::tei:milestone|descendant::tei:pb|descendant::tei:cb|descendant::tei:lb" /> |
|
49 | 57 |
<seg xmlns="http://www.tei-c.org/ns/1.0" type="wp" part="F"> |
50 |
<xsl:call-template name="wp2"/> |
|
58 |
<xsl:call-template name="wp2" />
|
|
51 | 59 |
</seg> |
52 | 60 |
</xsl:when> |
53 |
<xsl:otherwise><xsl:apply-templates/></xsl:otherwise> |
|
54 |
</xsl:choose> |
|
61 |
<xsl:otherwise> |
|
62 |
<xsl:apply-templates /> |
|
63 |
</xsl:otherwise> |
|
64 |
</xsl:choose> |
|
55 | 65 |
</xsl:copy> |
56 | 66 |
</xsl:template> |
57 |
|
|
67 |
|
|
58 | 68 |
<!-- on supprime les w et pc imbriqués --> |
59 |
<xsl:template match="tei:w[ancestor::tei:w or ancestor::tei:pc]|tei:pc[ancestor::tei:w or ancestor::tei:pc]"> |
|
60 |
<xsl:apply-templates/> |
|
69 |
<xsl:template |
|
70 |
match="tei:w[ancestor::tei:w or ancestor::tei:pc]|tei:pc[ancestor::tei:w or ancestor::tei:pc]"> |
|
71 |
<xsl:apply-templates /> |
|
61 | 72 |
</xsl:template> |
62 | 73 |
|
63 | 74 |
</xsl:stylesheet> |
tmp/org.txm.oriflamms.rcp/groovy/org/txm/macro/oriflamms/prepare/3-facsimile-pager.xsl (revision 2398) | ||
---|---|---|
2 | 2 |
<xsl:stylesheet |
3 | 3 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
4 | 4 |
xmlns:xs="http://www.w3.org/2001/XMLSchema" |
5 |
xmlns:tei="http://www.tei-c.org/ns/1.0" |
|
6 |
exclude-result-prefixes="#all" |
|
7 |
version="2.0" > |
|
8 |
<!-- |
|
9 |
This software is dual-licensed: |
|
5 |
xmlns:tei="http://www.tei-c.org/ns/1.0" exclude-result-prefixes="#all" |
|
6 |
version="2.0"> |
|
7 |
<!-- This software is dual-licensed: 1. Distributed under a Creative Commons |
|
8 |
Attribution-ShareAlike 3.0 Unported License http://creativecommons.org/licenses/by-sa/3.0/ |
|
9 |
2. http://www.opensource.org/licenses/BSD-2-Clause All rights reserved. Redistribution |
|
10 |
and use in source and binary forms, with or without modification, are permitted |
|
11 |
provided that the following conditions are met: * Redistributions of source |
|
12 |
code must retain the above copyright notice, this list of conditions and |
|
13 |
the following disclaimer. * Redistributions in binary form must reproduce |
|
14 |
the above copyright notice, this list of conditions and the following disclaimer |
|
15 |
in the documentation and/or other materials provided with the distribution. |
|
16 |
This software is provided by the copyright holders and contributors "as is" |
|
17 |
and any express or implied warranties, including, but not limited to, the |
|
18 |
implied warranties of merchantability and fitness for a particular purpose |
|
19 |
are disclaimed. In no event shall the copyright holder or contributors be |
|
20 |
liable for any direct, indirect, incidental, special, exemplary, or consequential |
|
21 |
damages (including, but not limited to, procurement of substitute goods or |
|
22 |
services; loss of use, data, or profits; or business interruption) however |
|
23 |
caused and on any theory of liability, whether in contract, strict liability, |
|
24 |
or tort (including negligence or otherwise) arising in any way out of the |
|
25 |
use of this software, even if advised of the possibility of such damage. |
|
26 |
$Id$ This stylesheet is based on TEI processpb.xsl by Sebastian Rahtz available |
|
27 |
at https://github.com/TEIC/Stylesheets/blob/master/tools/processpb.xsl and |
|
28 |
is adapted by Alexei Lavrentiev to split an HTML edition for TXM platform. --> |
|
29 |
<xsl:output indent="no" method="xml" /> |
|
10 | 30 |
|
11 |
1. Distributed under a Creative Commons Attribution-ShareAlike 3.0 |
|
12 |
Unported License http://creativecommons.org/licenses/by-sa/3.0/ |
|
31 |
<xsl:param name="css-name-txm"> |
|
32 |
txm |
|
33 |
</xsl:param> |
|
34 |
<xsl:param name="css-name"> |
|
35 |
tei |
|
36 |
</xsl:param> |
|
37 |
<xsl:param name="edition-name"> |
|
38 |
facs |
|
39 |
</xsl:param> |
|
40 |
<xsl:param name="number-words-per-page"> |
|
41 |
999999 |
|
42 |
</xsl:param> |
|
43 |
<xsl:param name="pagination-element"> |
|
44 |
pb |
|
45 |
</xsl:param> |
|
46 |
<xsl:param name="output-directory"> |
|
47 |
<xsl:value-of |
|
48 |
select="concat($current-file-directory,'/',$edition-name)" /> |
|
49 |
</xsl:param> |
|
50 |
<xsl:param name="image-directory"> |
|
51 |
/home/alavrent/Bureau/Oriflamms_sources/mss-dates/mss-dates/img |
|
52 |
</xsl:param> |
|
53 |
<xsl:param name="word-element"> |
|
54 |
w |
|
55 |
</xsl:param> |
|
13 | 56 |
|
14 |
2. http://www.opensource.org/licenses/BSD-2-Clause |
|
15 |
|
|
16 |
All rights reserved. |
|
57 |
<!-- /home/alavrent/Bureau/Oriflamms_sources/mss-dates/mss-dates/img --> |
|
17 | 58 |
|
18 |
Redistribution and use in source and binary forms, with or without |
|
19 |
modification, are permitted provided that the following conditions are |
|
20 |
met: |
|
21 |
|
|
22 |
* Redistributions of source code must retain the above copyright |
|
23 |
notice, this list of conditions and the following disclaimer. |
|
24 |
|
|
25 |
* Redistributions in binary form must reproduce the above copyright |
|
26 |
notice, this list of conditions and the following disclaimer in the |
|
27 |
documentation and/or other materials provided with the distribution. |
|
28 |
|
|
29 |
This software is provided by the copyright holders and contributors |
|
30 |
"as is" and any express or implied warranties, including, but not |
|
31 |
limited to, the implied warranties of merchantability and fitness for |
|
32 |
a particular purpose are disclaimed. In no event shall the copyright |
|
33 |
holder or contributors be liable for any direct, indirect, incidental, |
|
34 |
special, exemplary, or consequential damages (including, but not |
|
35 |
limited to, procurement of substitute goods or services; loss of use, |
|
36 |
data, or profits; or business interruption) however caused and on any |
|
37 |
theory of liability, whether in contract, strict liability, or tort |
|
38 |
(including negligence or otherwise) arising in any way out of the use |
|
39 |
of this software, even if advised of the possibility of such damage. |
|
40 |
|
|
41 |
$Id$ |
|
42 |
|
|
43 |
This stylesheet is based on TEI processpb.xsl by Sebastian Rahtz |
|
44 |
available at |
|
45 |
https://github.com/TEIC/Stylesheets/blob/master/tools/processpb.xsl |
|
46 |
and is adapted by Alexei Lavrentiev to split an HTML edition for |
|
47 |
TXM platform. |
|
48 |
|
|
49 |
--> |
|
50 |
<xsl:output indent="no" method="xml"/> |
|
51 |
|
|
52 |
<xsl:param name="css-name-txm">txm</xsl:param> |
|
53 |
<xsl:param name="css-name">tei</xsl:param> |
|
54 |
<xsl:param name="edition-name">facs</xsl:param> |
|
55 |
<xsl:param name="number-words-per-page">999999</xsl:param> |
|
56 |
<xsl:param name="pagination-element">pb</xsl:param> |
|
57 |
<xsl:param name="output-directory"><xsl:value-of select="concat($current-file-directory,'/',$edition-name)"/></xsl:param> |
|
58 |
<xsl:param name="image-directory">/home/alavrent/Bureau/Oriflamms_sources/mss-dates/mss-dates/img</xsl:param> |
|
59 |
<xsl:param name="word-element">w</xsl:param> |
|
60 |
|
|
61 |
<!-- /home/alavrent/Bureau/Oriflamms_sources/mss-dates/mss-dates/img --> |
|
62 |
|
|
63 | 59 |
<xsl:variable name="current-file-name"> |
64 |
<xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/]+$"> |
|
60 |
<xsl:analyze-string select="document-uri(.)" |
|
61 |
regex="^(.*)/([^/]+)\.[^/]+$"> |
|
65 | 62 |
<xsl:matching-substring> |
66 |
<xsl:value-of select="regex-group(2)"/> |
|
63 |
<xsl:value-of select="regex-group(2)" />
|
|
67 | 64 |
</xsl:matching-substring> |
68 | 65 |
</xsl:analyze-string> |
69 | 66 |
</xsl:variable> |
70 |
|
|
67 |
|
|
71 | 68 |
<xsl:variable name="current-file-directory"> |
72 |
<xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/]+$"> |
|
69 |
<xsl:analyze-string select="document-uri(.)" |
|
70 |
regex="^(.*)/([^/]+)\.[^/]+$"> |
|
73 | 71 |
<xsl:matching-substring> |
74 |
<xsl:value-of select="regex-group(1)"/> |
|
72 |
<xsl:value-of select="regex-group(1)" />
|
|
75 | 73 |
</xsl:matching-substring> |
76 | 74 |
</xsl:analyze-string> |
77 | 75 |
</xsl:variable> |
78 |
|
|
76 |
|
|
79 | 77 |
<xsl:variable as="xs:integer" name="page-number-adjust"> |
80 | 78 |
<xsl:choose> |
81 |
<xsl:when test="$word-element='c'">1</xsl:when> |
|
82 |
<xsl:otherwise>2</xsl:otherwise> |
|
79 |
<xsl:when test="$word-element='c'"> |
|
80 |
1 |
|
81 |
</xsl:when> |
|
82 |
<xsl:otherwise> |
|
83 |
2 |
|
84 |
</xsl:otherwise> |
|
83 | 85 |
</xsl:choose> |
84 | 86 |
</xsl:variable> |
85 |
|
|
86 |
|
|
87 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
88 | 90 |
<xsl:template match="/"> |
89 |
<dummy><xsl:apply-templates select="descendant::*[local-name()=$pagination-element]"/></dummy> |
|
91 |
<dummy> |
|
92 |
<xsl:apply-templates |
|
93 |
select="descendant::*[local-name()=$pagination-element]" /> |
|
94 |
</dummy> |
|
90 | 95 |
<xsl:if test="$word-element='w'"> |
91 |
<xsl:result-document href="{$output-directory}/{$current-file-name}_1.html"> |
|
96 |
<xsl:result-document |
|
97 |
href="{$output-directory}/{$current-file-name}_1.html"> |
|
92 | 98 |
<html> |
93 | 99 |
<head> |
94 |
<meta name="txm:first-word-id" content="w_0"/> |
|
95 |
<title><xsl:value-of select="concat($current-file-name,', Page de garde')"/></title> |
|
96 |
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> |
|
97 |
<link rel="stylesheet" media="all" type="text/css" href="css/{$css-name-txm}.css"/> |
|
98 |
<xsl:if test="matches($css-name,'\S')"><link rel="stylesheet" media="all" type="text/css" href="css/{$css-name}.css"/></xsl:if> |
|
99 |
<!--<xsl:copy-of select="$style"/>--> |
|
100 |
<meta name="txm:first-word-id" content="w_0" /> |
|
101 |
<title> |
|
102 |
<xsl:value-of |
|
103 |
select="concat($current-file-name,', Page de garde')" /> |
|
104 |
</title> |
|
105 |
<meta http-equiv="Content-Type" |
|
106 |
content="text/html;charset=UTF-8" /> |
|
107 |
<link rel="stylesheet" media="all" type="text/css" |
|
108 |
href="css/{$css-name-txm}.css" /> |
|
109 |
<xsl:if test="matches($css-name,'\S')"> |
|
110 |
<link rel="stylesheet" media="all" type="text/css" |
|
111 |
href="css/{$css-name}.css" /> |
|
112 |
</xsl:if> |
|
113 |
<!--<xsl:copy-of select="$style"/> --> |
|
100 | 114 |
</head> |
101 | 115 |
<body> |
102 | 116 |
<div class="txmeditionpage"> |
103 |
<h2><xsl:value-of select="$current-file-name"/></h2> |
|
117 |
<h2> |
|
118 |
<xsl:value-of select="$current-file-name" /> |
|
119 |
</h2> |
|
104 | 120 |
<h3>Reproductions des pages</h3> |
105 |
|
|
121 |
|
|
106 | 122 |
</div> |
107 | 123 |
</body> |
108 | 124 |
</html> |
109 |
</xsl:result-document>
|
|
110 |
</xsl:if>
|
|
125 |
</xsl:result-document> |
|
126 |
</xsl:if> |
|
111 | 127 |
</xsl:template> |
112 |
|
|
113 |
|
|
128 |
|
|
129 |
|
|
114 | 130 |
<xsl:template match="*[local-name()=$pagination-element]"> |
115 | 131 |
<xsl:variable name="next-word-position" as="xs:integer"> |
116 | 132 |
<xsl:choose> |
117 | 133 |
<xsl:when test="following::*[local-name()=$word-element]"> |
118 |
<xsl:value-of select="count(following::*[local-name()=$word-element][1]/preceding::*[local-name()=$word-element])"/> |
|
134 |
<xsl:value-of |
|
135 |
select="count(following::*[local-name()=$word-element][1]/preceding::*[local-name()=$word-element])" /> |
|
119 | 136 |
</xsl:when> |
120 |
<xsl:otherwise>0</xsl:otherwise> |
|
137 |
<xsl:otherwise> |
|
138 |
0 |
|
139 |
</xsl:otherwise> |
|
121 | 140 |
</xsl:choose> |
122 | 141 |
</xsl:variable> |
123 | 142 |
<xsl:variable name="next-pb-position" as="xs:integer"> |
124 | 143 |
<xsl:choose> |
125 |
<xsl:when test="following::*[local-name()=$pagination-element]"> |
|
126 |
<xsl:value-of select="count(following::*[local-name()=$pagination-element][1]/preceding::*[local-name()=$word-element])"/> |
|
144 |
<xsl:when |
|
145 |
test="following::*[local-name()=$pagination-element]"> |
|
146 |
<xsl:value-of |
|
147 |
select="count(following::*[local-name()=$pagination-element][1]/preceding::*[local-name()=$word-element])" /> |
|
127 | 148 |
</xsl:when> |
128 |
<xsl:otherwise>999999999</xsl:otherwise> |
|
149 |
<xsl:otherwise> |
|
150 |
999999999 |
|
151 |
</xsl:otherwise> |
|
129 | 152 |
</xsl:choose> |
130 | 153 |
</xsl:variable> |
131 | 154 |
<xsl:variable name="next-word-id"> |
132 | 155 |
<xsl:choose> |
133 |
<xsl:when test="$next-pb-position - $next-word-position = 999999999">w_0</xsl:when> |
|
134 |
<xsl:when test="$next-pb-position > $next-word-position"><xsl:value-of select="following::*[local-name()=$word-element][1]/@id"/></xsl:when> |
|
135 |
<xsl:otherwise>w_0</xsl:otherwise> |
|
156 |
<xsl:when |
|
157 |
test="$next-pb-position - $next-word-position = 999999999"> |
|
158 |
w_0 |
|
159 |
</xsl:when> |
|
160 |
<xsl:when test="$next-pb-position > $next-word-position"> |
|
161 |
<xsl:value-of |
|
162 |
select="following::*[local-name()=$word-element][1]/@id" /> |
|
163 |
</xsl:when> |
|
164 |
<xsl:otherwise> |
|
165 |
w_0 |
|
166 |
</xsl:otherwise> |
|
136 | 167 |
</xsl:choose> |
137 | 168 |
</xsl:variable> |
138 |
<xsl:variable name="pageId"><xsl:value-of select="@id"/></xsl:variable> |
|
139 |
<xsl:comment> Page <xsl:value-of select="@id"/> enregistrée dans <xsl:value-of select="concat($output-directory,'/',$current-file-name,'_',count(preceding::*[local-name()=$pagination-element]) + $page-number-adjust,'.html')"/></xsl:comment> |
|
140 |
<xsl:result-document href="{$output-directory}/{$current-file-name}_{count(preceding::*[local-name()=$pagination-element]) + $page-number-adjust}.html"> |
|
141 |
<html> |
|
142 |
<head> |
|
143 |
<meta name="txm:first-word-id" content="{$next-word-id}"/> |
|
144 |
<title><xsl:value-of select="concat($current-file-name,', Page ',@n)"/></title> |
|
145 |
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> |
|
146 |
<link rel="stylesheet" media="all" type="text/css" href="css/{$css-name-txm}.css"/> |
|
147 |
<xsl:if test="matches($css-name,'\S')"><link rel="stylesheet" media="all" type="text/css" href="css/{$css-name}.css"/></xsl:if> |
|
148 |
<script type="text/javascript" src="js/viewer/Simple_Viewer_beta_1.1-min.js"><xsl:text> </xsl:text></script> |
|
149 |
<script type="text/javascript" src="js/viewer/toolbar-ext.js"><xsl:text> </xsl:text></script> |
|
150 |
<link rel="stylesheet" type="text/css" href="js/viewer/toolbar-ext.css" /> |
|
151 |
<!--<xsl:copy-of select="$style"/>--> |
|
152 |
</head> |
|
153 |
<body> |
|
154 |
<div class="txmeditionpage"> |
|
155 |
<img src="{$image-directory}/{@facs}" |
|
156 |
alt="Image {@id} indisponible" onLoad="viewer.toolbarImages='images/icons';viewer.onload=viewer.toolbar;new viewer({{image: this, frame: ['100%','100%']}});"></img> |
|
157 |
<!--<span class="invisible" id="{following::tei:w[1]/@id}"></span>--> |
|
158 |
<span class="invisible" id="{$next-word-id}"></span> |
|
159 |
|
|
160 |
</div> |
|
161 |
</body> |
|
162 |
</html> |
|
163 |
</xsl:result-document> |
|
164 |
|
|
169 |
<xsl:variable name="pageId"> |
|
170 |
<xsl:value-of select="@id" /> |
|
171 |
</xsl:variable> |
|
172 |
<xsl:comment> |
|
173 |
Page |
|
174 |
<xsl:value-of select="@id" /> |
|
175 |
enregistrée dans |
|
176 |
<xsl:value-of |
|
177 |
select="concat($output-directory,'/',$current-file-name,'_',count(preceding::*[local-name()=$pagination-element]) + $page-number-adjust,'.html')" /> |
|
178 |
</xsl:comment> |
|
179 |
<xsl:result-document |
|
180 |
href="{$output-directory}/{$current-file-name}_{count(preceding::*[local-name()=$pagination-element]) + $page-number-adjust}.html"> |
|
181 |
<html> |
|
182 |
<head> |
|
183 |
<meta name="txm:first-word-id" content="{$next-word-id}" /> |
|
184 |
<title> |
|
185 |
<xsl:value-of |
|
186 |
select="concat($current-file-name,', Page ',@n)" /> |
|
187 |
</title> |
|
188 |
<meta http-equiv="Content-Type" |
|
189 |
content="text/html;charset=UTF-8" /> |
|
190 |
<link rel="stylesheet" media="all" type="text/css" |
|
191 |
href="css/{$css-name-txm}.css" /> |
|
192 |
<xsl:if test="matches($css-name,'\S')"> |
|
193 |
<link rel="stylesheet" media="all" type="text/css" |
|
194 |
href="css/{$css-name}.css" /> |
|
195 |
</xsl:if> |
|
196 |
<script type="text/javascript" |
|
197 |
src="js/viewer/Simple_Viewer_beta_1.1-min.js"> |
|
198 |
<xsl:text> </xsl:text> |
|
199 |
</script> |
|
200 |
<script type="text/javascript" |
|
201 |
src="js/viewer/toolbar-ext.js"> |
|
202 |
<xsl:text> </xsl:text> |
|
203 |
</script> |
|
204 |
<link rel="stylesheet" type="text/css" |
|
205 |
href="js/viewer/toolbar-ext.css" /> |
|
206 |
<!--<xsl:copy-of select="$style"/> --> |
|
207 |
</head> |
|
208 |
<body> |
|
209 |
<div class="txmeditionpage"> |
|
210 |
<img src="{$image-directory}/{@facs}" |
|
211 |
alt="Image {@id} indisponible" |
|
212 |
onLoad="viewer.toolbarImages='images/icons';viewer.onload=viewer.toolbar;new viewer({{image: this, frame: ['100%','100%']}});"></img> |
|
213 |
<!--<span class="invisible" id="{following::tei:w[1]/@id}"></span> --> |
|
214 |
<span class="invisible" id="{$next-word-id}"></span> |
|
215 |
|
|
216 |
</div> |
|
217 |
</body> |
|
218 |
</html> |
|
219 |
</xsl:result-document> |
|
220 |
|
|
165 | 221 |
</xsl:template> |
166 |
|
|
167 |
|
|
222 |
|
|
223 |
|
|
168 | 224 |
</xsl:stylesheet> |
tmp/org.txm.oriflamms.rcp/groovy/org/txm/macro/oriflamms/prepare/1-oriflamms-split-surfaces.xsl (revision 2398) | ||
---|---|---|
1 | 1 |
<?xml version="1.0" encoding="utf-8"?> |
2 | 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">
|
|
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" version="2.0"
|
|
6 |
xpath-default-namespace="http://www.tei-c.org/ns/1.0"> |
|
7 | 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"/> |
|
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: |
|
62 | 15 |
|
16 |
1. Distributed under a Creative Commons Attribution-ShareAlike 3.0 |
|
17 |
Unported License http://creativecommons.org/licenses/by-sa/3.0/ |
|
63 | 18 |
|
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>--> |
|
19 |
2. http://www.opensource.org/licenses/BSD-2-Clause |
|
83 | 20 |
|
84 |
<xsl:param name="output-directory"><xsl:value-of select="concat($filedir,'/out')"/></xsl:param>
|
|
21 |
All rights reserved.
|
|
85 | 22 |
|
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> |
|
23 |
Redistribution and use in source and binary forms, with or without |
|
24 |
modification, are permitted provided that the following conditions are |
|
25 |
met: |
|
97 | 26 |
|
27 |
* Redistributions of source code must retain the above copyright |
|
28 |
notice, this list of conditions and the following disclaimer. |
|
98 | 29 |
|
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> |
|
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. |
|
111 | 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, |
|
39 |
incidental, |
|
40 |
special, exemplary, or consequential damages (including, but not |
|
41 |
limited to, procurement of substitute goods or services; loss of use, |
|
42 |
data, or profits; or business interruption) however caused and on any |
|
43 |
theory of liability, whether in contract, strict liability, or tort |
|
44 |
(including negligence or otherwise) arising in any way out of the use |
|
45 |
of this software, even if advised of the possibility of such damage. |
|
112 | 46 |
|
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> |
|
47 |
$Id$ |
|
117 | 48 |
|
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> |
|
49 |
This stylesheet is based on TEI processpb.xsl by Sebastian Rahtz |
|
50 |
available at |
|
51 |
https://github.com/TEIC/Stylesheets/blob/master/tools/processpb.xsl |
|
52 |
and is adapted by Alexei Lavrentiev to split an XML TEI Oriflamms |
|
53 |
file |
|
54 |
into pages for further tokenizatrion at character level. |
|
123 | 55 |
|
124 |
<xsl:template match="milestone[@unit='surface']"> |
|
125 |
<xsl:copy-of select="."/> |
|
126 |
</xsl:template> |
|
56 |
</xd:detail> |
|
57 |
<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author> |
|
58 |
<xd:copyright>2015, CNRS / ICAR (Équipe CACTUS)</xd:copyright> |
|
59 |
</xd:doc> |
|
127 | 60 |
|
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 | 61 |
|
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.w3.org/1999/xhtml"> |
|
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.w3.org/1999/xhtml"> |
|
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 | 62 |
|
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> |
|
63 |
<xsl:output indent="no" method="xml" /> |
|
177 | 64 |
|
178 |
<xsl:template match="comment()|@*|processing-instruction()|text()" mode="pass2"> |
|
179 |
<xsl:copy-of select="."/> |
|
180 |
</xsl:template> |
|
181 | 65 |
|
66 |
<xsl:variable name="filename"> |
|
67 |
<xsl:analyze-string select="document-uri(.)" |
|
68 |
regex="^(.*)/([^/]+)\.[^/]+$"> |
|
69 |
<xsl:matching-substring> |
|
70 |
<xsl:value-of select="regex-group(2)" /> |
|
71 |
</xsl:matching-substring> |
|
72 |
</xsl:analyze-string> |
|
73 |
</xsl:variable> |
|
182 | 74 |
|
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> |
Formats disponibles : Unified diff