blob: 2f0423136c9d399bb966754ad6575d2115522886 [file] [log] [blame]
Akron9a8ee3e2022-01-31 13:51:49 +01001<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
bansp5e2d1c02022-03-10 04:51:40 +01003 xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:nkjp="http://www.nkjp.pl/ns/1.0"
4 xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:f="func"
Piotr Banskif8af3a92022-05-23 03:20:10 +02005 xmlns:fn="http://www.w3.org/2005/xpath-functions"
Piotr Banski763b41f2022-06-02 01:13:23 +02006 xmlns:xi="http://www.w3.org/2001/XInclude"
7 xmlns:map="http://www.w3.org/2005/xpath-functions/map" exclude-result-prefixes="xs f fn map nkjp tei xi"
bansp5e2d1c02022-03-10 04:51:40 +01008 version="3.0" expand-text="yes">
Akron9a8ee3e2022-01-31 13:51:49 +01009
banspe726b4a2022-03-28 05:47:45 +020010
11<!-- PARAMETERS -->
bansp5e2d1c02022-03-10 04:51:40 +010012
bansp8f6700b2022-03-27 05:27:09 +020013 <xsl:param name="sourceDir" select="'test/resources/nkjp2korap_sample2'" as="xs:string"/>
banspd1bf1db2022-04-04 02:16:24 +020014 <!-- the directory containing NKJP files, in the form of a collection of text-level dirs
15 (that is how we know both the $corpusID and the $docID) -->
Akron9a8ee3e2022-01-31 13:51:49 +010016
bansp8f6700b2022-03-27 05:27:09 +020017 <xsl:param name="targetDir" select="'test/output'" as="xs:string"/>
banspd1bf1db2022-04-04 02:16:24 +020018 <!-- where the corpus/document/text/annotations hierarchy is going to be created -->
banspf2b24e62022-03-28 18:12:08 +020019
20 <xsl:param name="skip_docID" as="xs:string">
Piotr Banskic5950ce2022-05-27 15:07:08 +020021 <!--<xsl:value-of select="''"/>-->
22 <xsl:value-of select="'HellerPodgladanie,IsakowiczZaleskiMoje,KolakowskiOco,MysliwskiKamien,WilkWilczy,ZycieWarszawy_Zycie'"/>
banspb5992532022-03-29 15:55:44 +020023 </xsl:param>
24 <!-- comma-separated list of document IDs to be skipped from processing
banspf2b24e62022-03-28 18:12:08 +020025 example: HellerPodgladanie,KOT
banspd1bf1db2022-04-04 02:16:24 +020026 no functionality beyond string identity is supported
27 (this is just for testing) -->
banspb5992532022-03-29 15:55:44 +020028
Piotr Banski1ae16bd2022-05-25 15:59:40 +020029 <xsl:param name="SHOW_ORTH_IN_STRUCT" as="xs:boolean" select="true()"/>
Piotr Banski09096ee2022-05-25 13:41:03 +020030 <!-- for debugging structure.xml production -->
31
bansp8f6700b2022-03-27 05:27:09 +020032
bansp9dc10002022-05-17 22:33:34 +020033<!-- VARIABLES (= constants...) -->
banspe726b4a2022-03-28 05:47:45 +020034
35 <xsl:variable name="corpusID" as="xs:string" select="'NKJP'" static="yes"/>
36 <xsl:variable name="docID" as="xs:string" select="'NKJP'" static="yes"/>
bansp8f6700b2022-03-27 05:27:09 +020037
38 <xsl:variable name="targetCorpusDir_slashed" select="$targetDir || '/' || $corpusID || '/'" as="xs:string"/>
bansp5e2d1c02022-03-10 04:51:40 +010039
banspd1bf1db2022-04-04 02:16:24 +020040 <xsl:variable name="systemDoctypeI5" as="xs:string"
41 select="'http://corpora.ids-mannheim.de/I5/DTD/i5.dtd'" static="true"/>
bansp5e2d1c02022-03-10 04:51:40 +010042
banspd1bf1db2022-04-04 02:16:24 +020043 <xsl:variable name="publicDoctypeI5" as="xs:string" static="true"
44 select="'-//IDS//DTD I5 1.0//EN'"/>
bansp5e2d1c02022-03-10 04:51:40 +010045
banspd1bf1db2022-04-04 02:16:24 +020046 <xsl:variable name="KorAP_namespace" static="true" as="xs:string"
47 select="'http://ids-mannheim.de/ns/KorAP'"/>
bansp5e2d1c02022-03-10 04:51:40 +010048
bansp5f841732022-03-16 06:27:31 +010049 <xsl:variable name="KorAP-XML_version" select="'KorAP-0.4'" as="xs:string" static="true"/>
50 <!-- this is only a bit funny -->
51
banspe726b4a2022-03-28 05:47:45 +020052 <xsl:variable name="collection_params" as="xs:string" static="yes"
53 select="'recurse=yes;validation=strip;select=text.xml;content-type=application/xml;on-error=warning;xinclude=yes'"
54 />
55 <!-- see https://www.saxonica.com/documentation11/index.html#!sourcedocs/collections/collection-directories -->
56
57 <xsl:variable name="collection_of_text" select="collection($sourceDir || '?' || $collection_params)" as="document-node()+"/>
banspd1bf1db2022-04-04 02:16:24 +020058
banspe726b4a2022-03-28 05:47:45 +020059<!-- MODES -->
bansp5e2d1c02022-03-10 04:51:40 +010060
Piotr Banskifaa910f2022-06-03 00:46:29 +020061 <xsl:mode name="corpus-header" on-no-match="deep-skip"/>
Piotr Banskia0a9fc02022-06-03 01:20:18 +020062 <xsl:mode name="text-header" on-no-match="deep-skip"/>
63 <xsl:mode name="text_inside_header" on-no-match="text-only-copy"/>
Piotr Banski763b41f2022-06-02 01:13:23 +020064 <xsl:mode name="copy" on-no-match="shallow-copy"/>
Piotr Banski6a4a2522022-05-24 01:16:47 +020065 <xsl:mode use-accumulators="#all"/>
Piotr Banski09096ee2022-05-25 13:41:03 +020066
Piotr Banskie1ac5202022-05-30 21:25:21 +020067 <xsl:accumulator name="element-index" as="xs:integer" initial-value="0">
68 <xsl:accumulator-rule match="tei:*[ancestor-or-self::tei:text]" select="$value + 1" phase="start"/>
Piotr Banski09096ee2022-05-25 13:41:03 +020069 </xsl:accumulator>
Piotr Banskifdc858a2022-05-25 02:40:32 +020070
Piotr Banski65a6d0b2022-05-31 17:23:08 +020071
72
73 <!--I think I may be able to actually merge the two accumulators, but let's see-->
74 <xsl:accumulator name="morpho-offsets" as="map(xs:string, item()+)+" initial-value="(map{'null':(0,0)})">
Piotr Banskifdc858a2022-05-25 02:40:32 +020075
76 <xsl:accumulator-rule match="tei:body/tei:p" phase="start">
77 <xsl:variable name="preceding_index" as="xs:integer">
78 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
79 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
Piotr Banski6a4a2522022-05-24 01:16:47 +020080 </xsl:variable>
81
Piotr Banskifdc858a2022-05-25 02:40:32 +020082 <xsl:variable name="our_base" as="xs:integer" select="if($preceding_index eq 0) then $preceding_index else $preceding_index + 1"/>
83 <!-- for paragraphs, it's in either being initial or not -->
Piotr Banski09096ee2022-05-25 13:41:03 +020084
Piotr Banskifdc858a2022-05-25 02:40:32 +020085 <xsl:sequence select="
86 $value,
87 map {
88 string(@xml:id): ($preceding_index,$our_base)
89 }"/>
90 </xsl:accumulator-rule>
Piotr Banski65a6d0b2022-05-31 17:23:08 +020091 <!-- this is morpho-offsets -->
Piotr Banskifdc858a2022-05-25 02:40:32 +020092 <xsl:accumulator-rule match="tei:s" phase="start">
93 <xsl:variable name="preceding_index" as="xs:integer">
94 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
95 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
Piotr Banskifdc858a2022-05-25 02:40:32 +020096 </xsl:variable>
Piotr Banski92791a22022-05-26 01:41:10 +020097 <xsl:variable name="our_base" as="xs:integer" select="if($preceding_index eq 0) then $preceding_index else $preceding_index + xs:integer(f:is_preceded_by_ws(.,true()))"/>
Piotr Banski09096ee2022-05-25 13:41:03 +020098
Piotr Banskifdc858a2022-05-25 02:40:32 +020099 <xsl:sequence select="
100 $value,
101 map {
102 string(@xml:id): ($preceding_index,$our_base)
103 }"/>
104 </xsl:accumulator-rule>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200105 <!-- this is morpho-offsets -->
106
107<!-- I want something that won't be matched in other layers, for efficiency - that
108 may allow me to merge the accumulators, eventually;
109 but I also want to filter out the rejected tokenization alternatives already here -->
110 <xsl:accumulator-rule match="tei:seg[tei:fs[@type eq 'morph' and tei:f[@name eq 'disamb']]]" phase="end">
111
Piotr Banskifdc858a2022-05-25 02:40:32 +0200112 <xsl:variable name="preceding_index" as="xs:integer">
113 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
114 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
Piotr Banskifdc858a2022-05-25 02:40:32 +0200115 </xsl:variable>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200116 <xsl:variable name="our_base" as="xs:integer" select="$preceding_index + xs:integer(f:is_preceded_by_ws(.,true()))"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200117
Piotr Banski6a4a2522022-05-24 01:16:47 +0200118 <xsl:sequence select="
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200119 $value,
120 map {
121 string(@xml:id): ($our_base,$our_base + string-length(tei:fs/tei:f[@name eq 'orth']/tei:string))
122 }"/>
123
Piotr Banski6a4a2522022-05-24 01:16:47 +0200124 </xsl:accumulator-rule>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200125 <!-- this is morpho-offsets -->
Piotr Banskifdc858a2022-05-25 02:40:32 +0200126 <xsl:accumulator-rule match="tei:s" phase="end">
127 <xsl:variable name="preceding_index" as="xs:integer">
128 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
129 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200130
Piotr Banskifdc858a2022-05-25 02:40:32 +0200131 </xsl:variable>
132 <xsl:variable name="our_base" as="xs:integer">
133 <xsl:variable name="incomplete" select="map:find($value,string(@xml:id))(1)" as="xs:integer+"/>
134 <xsl:sequence select="$incomplete[2]"/>
135 </xsl:variable>
Piotr Banski09096ee2022-05-25 13:41:03 +0200136
Piotr Banskifdc858a2022-05-25 02:40:32 +0200137 <xsl:sequence select="
138 $value,
139 map {
140 string(@xml:id): ($our_base,$preceding_index)
141 }"/>
142 </xsl:accumulator-rule>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200143 <!-- this is morpho-offsets -->
Piotr Banskifdc858a2022-05-25 02:40:32 +0200144 <xsl:accumulator-rule match="tei:body/tei:p" phase="end">
145 <xsl:variable name="preceding_index" as="xs:integer">
146 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
147 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
148
Piotr Banskifdc858a2022-05-25 02:40:32 +0200149 </xsl:variable>
150 <xsl:variable name="our_base" as="xs:integer">
151 <xsl:variable name="incomplete" select="map:find($value,string(@xml:id))(1)" as="xs:integer+"/>
152 <xsl:sequence select="$incomplete[2]"/>
153 </xsl:variable>
Piotr Banski09096ee2022-05-25 13:41:03 +0200154
Piotr Banskifdc858a2022-05-25 02:40:32 +0200155 <xsl:sequence select="
156 $value,
157 map {
158 string(@xml:id): ($our_base,$preceding_index)
159 }"/>
160 </xsl:accumulator-rule>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200161 </xsl:accumulator>
162
163
164
165 <xsl:accumulator name="segmentation-offsets" as="map(xs:string, item()+)+" initial-value="(map{'null':(0,0)})">
166
167 <xsl:accumulator-rule match="tei:body/tei:p" phase="start">
168 <xsl:variable name="preceding_index" as="xs:integer">
169 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
170 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
171 </xsl:variable>
172
173 <xsl:variable name="our_base" as="xs:integer" select="if($preceding_index eq 0) then $preceding_index else $preceding_index + 1"/>
174 <!-- for paragraphs, it's in either being initial or not -->
175
176 <xsl:sequence select="
177 $value,
178 map {
179 string(@xml:id): ($preceding_index,$our_base)
180 }"/>
181 </xsl:accumulator-rule>
182
183 <xsl:accumulator-rule match="tei:s" phase="start">
184 <xsl:variable name="preceding_index" as="xs:integer">
185 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
186 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
187 </xsl:variable>
188 <xsl:variable name="our_base" as="xs:integer" select="if($preceding_index eq 0) then $preceding_index else $preceding_index + xs:integer(f:is_preceded_by_ws(.,true()))"/>
189
190 <xsl:sequence select="
191 $value,
192 map {
193 string(@xml:id): ($preceding_index,$our_base)
194 }"/>
195 </xsl:accumulator-rule>
196
197 <xsl:accumulator-rule match="tei:w[parent::tei:seg[count(@nkjp:rejected) eq 0]]" phase="end">
198 <xsl:variable name="preceding_index" as="xs:integer">
199 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
200 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
201 </xsl:variable>
202 <xsl:variable name="our_base" as="xs:integer" select="$preceding_index + xs:integer(f:is_preceded_by_ws(parent::tei:seg,true()))"/>
203
204 <xsl:sequence select="
205 $value,
206 map {
207 string(parent::tei:seg/@xml:id): ($our_base,$our_base + string-length())
208 }"/>
209 </xsl:accumulator-rule>
210
211 <xsl:accumulator-rule match="tei:s" phase="end">
212 <xsl:variable name="preceding_index" as="xs:integer">
213 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
214 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
215
216 </xsl:variable>
217 <xsl:variable name="our_base" as="xs:integer">
218 <xsl:variable name="incomplete" select="map:find($value,string(@xml:id))(1)" as="xs:integer+"/>
219 <xsl:sequence select="$incomplete[2]"/>
220 </xsl:variable>
221
222 <xsl:sequence select="
223 $value,
224 map {
225 string(@xml:id): ($our_base,$preceding_index)
226 }"/>
227 </xsl:accumulator-rule>
228
229 <xsl:accumulator-rule match="tei:body/tei:p" phase="end">
230 <xsl:variable name="preceding_index" as="xs:integer">
231 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
232 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
233
234 </xsl:variable>
235 <xsl:variable name="our_base" as="xs:integer">
236 <xsl:variable name="incomplete" select="map:find($value,string(@xml:id))(1)" as="xs:integer+"/>
237 <xsl:sequence select="$incomplete[2]"/>
238 </xsl:variable>
239
240 <xsl:sequence select="
241 $value,
242 map {
243 string(@xml:id): ($our_base,$preceding_index)
244 }"/>
245 </xsl:accumulator-rule>
Piotr Banskifdc858a2022-05-25 02:40:32 +0200246
247 <xsl:accumulator-rule match="tei:body" phase="end">
248 <xsl:variable name="preceding_index" as="xs:integer">
249 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
250 <xsl:sequence select="map:get($the_tail, map:keys($the_tail)[1])[2]"/>
251 </xsl:variable>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200252
Piotr Banskifdc858a2022-05-25 02:40:32 +0200253 <xsl:sequence select="
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200254 $value,
255 map {
256 string(@xml:id): (0, $preceding_index)
257 }"/>
Piotr Banskifdc858a2022-05-25 02:40:32 +0200258 </xsl:accumulator-rule>
259
260 <xsl:accumulator-rule match="tei:text" phase="end">
261 <xsl:variable name="preceding_index" as="xs:integer">
262 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
263 <xsl:sequence select="map:get($the_tail, map:keys($the_tail)[1])[2]"/>
264 </xsl:variable>
265
266 <xsl:sequence select="
267 $value,
268 map {
269 string(@xml:id): (0, $preceding_index)
270 }"/>
271 </xsl:accumulator-rule>
Piotr Banski6a4a2522022-05-24 01:16:47 +0200272 </xsl:accumulator>
bansp5e2d1c02022-03-10 04:51:40 +0100273
banspe726b4a2022-03-28 05:47:45 +0200274 <!-- FUNCTIONS -->
275
bansp5f841732022-03-16 06:27:31 +0100276 <xsl:function name="f:compute_nesting" as="xs:integer">
banspd1bf1db2022-04-04 02:16:24 +0200277 <xsl:param name="node" as="element()"/>
bansp5f841732022-03-16 06:27:31 +0100278 <xsl:variable name="rel_depth"
279 select="count($node/ancestor-or-self::*[local-name(.) ne 'TEI'][local-name(.) ne 'teiCorpus'])"
280 as="xs:integer"/>
bansp5f841732022-03-16 06:27:31 +0100281 <xsl:sequence select="$rel_depth"/>
282 </xsl:function>
283
Piotr Banski92791a22022-05-26 01:41:10 +0200284 <xsl:function name="f:is_preceded_by_ws" as="xs:boolean">
bansp9dc10002022-05-17 22:33:34 +0200285 <xsl:param name="node" as="element()"/>
Piotr Banskifdc858a2022-05-25 02:40:32 +0200286 <xsl:param name="suppress_initial" as="xs:boolean"/>
Piotr Banski4f4c2d22022-05-19 01:44:32 +0200287
Piotr Banski92791a22022-05-26 01:41:10 +0200288 <xsl:choose>
289 <xsl:when test="local-name($node) eq 'seg'">
290 <xsl:choose>
291 <xsl:when test="$node/@nkjp:nps">
292 <xsl:sequence select="fn:false()"/>
293 </xsl:when>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200294 <xsl:when test="$node/tei:fs/tei:f[@name eq 'nps']">
295 <!--added for traversing ann_morphosyntax-->
296 <xsl:sequence select="fn:false()"/>
297 </xsl:when>
Piotr Banski92791a22022-05-26 01:41:10 +0200298 <xsl:when
299 test="$node/ancestor::tei:s[count(preceding-sibling::tei:s) eq 0] and $node/ancestor::tei:p[count(preceding-sibling::tei:p) eq 0] and not($node/preceding::tei:seg[count(@nkjp:rejected) eq 0])">
300 <xsl:sequence select="fn:false()"/>
301 <!-- the otherwise very costly check for preceding segs fires only if the first two are true, so it will have minimal search space -->
302 </xsl:when>
303 <xsl:when
304 test="$suppress_initial and $node/ancestor::tei:s/descendant::tei:seg[count(@nkjp:rejected) eq 0][1]/@xml:id eq $node/@xml:id">
305 <!-- I forget how node identity works now, so let me just compare the IDs -->
306 <xsl:sequence select="fn:false()"/>
307 </xsl:when>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200308 <xsl:when
309 test="$suppress_initial and $node/ancestor::tei:s/descendant::tei:seg[tei:fs/tei:f[@name eq 'disamb']][1]/@xml:id eq $node/@xml:id">
310 <!--added for traversing ann_morphosyntax-->
311 <xsl:sequence select="fn:false()"/>
312 </xsl:when>
Piotr Banski92791a22022-05-26 01:41:10 +0200313 <xsl:otherwise>
314 <xsl:sequence select="fn:true()"/>
315 </xsl:otherwise>
316 </xsl:choose>
317 </xsl:when>
318 <xsl:when test="local-name($node) eq 's'">
319 <xsl:choose>
320 <xsl:when test="exists($node/preceding-sibling::tei:s)">
321 <xsl:sequence select="fn:true()"/>
322 </xsl:when>
323 <xsl:otherwise>
324 <xsl:sequence
325 select="not($suppress_initial) and exists($node/ancestor::tei:p[1]/preceding-sibling::tei:p)"
326 />
327 </xsl:otherwise>
328 </xsl:choose>
329
330 </xsl:when>
331 <xsl:when test="local-name($node) eq 'p'">
332 <xsl:sequence select="exists($node/preceding-sibling::tei:p)"/>
333 </xsl:when>
334 <xsl:otherwise>
335 <xsl:message terminate="yes"
336 select="'Wrong argument passed to f:is_preceded_by_ws(): ' || local-name($node) || ' Only p, s, seg are allowed.'"
337 />
338 </xsl:otherwise>
339 </xsl:choose>
340 </xsl:function>
banspd1bf1db2022-04-04 02:16:24 +0200341
banspb5992532022-03-29 15:55:44 +0200342<!-- UTILITY TEMPLATES -->
343
bansp9103aab2022-03-19 05:10:21 +0100344 <xsl:template match="@default" mode="#all"/>
bansp97ba7ce2022-03-26 05:14:06 +0100345 <!-- this is to delete some auto-inserted attribute throughout -->
bansp9103aab2022-03-19 05:10:21 +0100346
Piotr Banski6a4a2522022-05-24 01:16:47 +0200347 <xsl:template match="tei:w" mode="#all"/>
banspe726b4a2022-03-28 05:47:45 +0200348<!-- NKJP-SGJP has apparently resigned from standoff representations by adding <w> everywhere;
Piotr Banskifdc858a2022-05-25 02:40:32 +0200349 we reach for them, but from the level of <seg>, so we don't need to process <w> separately -->
bansp8f6700b2022-03-27 05:27:09 +0200350
Piotr Banski09096ee2022-05-25 13:41:03 +0200351 <!-- fall-thru, skipping the potential <paren> element and filtering out the bad guys -->
Piotr Banski6a4a2522022-05-24 01:16:47 +0200352 <xsl:template match="tei:choice" mode="struct">
Piotr Banski09096ee2022-05-25 13:41:03 +0200353 <xsl:apply-templates select="descendant::tei:seg[count(@nkjp:rejected) eq 0]" mode="struct"/>
Piotr Banski6a4a2522022-05-24 01:16:47 +0200354 </xsl:template>
Piotr Banskia51907c2022-05-25 15:09:41 +0200355 <xsl:template match="tei:choice" mode="morpho">
356 <xsl:apply-templates select="descendant::tei:seg[count(@nkjp:rejected) eq 0]" mode="morpho"/>
357 </xsl:template>
banspb5992532022-03-29 15:55:44 +0200358
359 <!-- MAIN PROCESSING -->
360
bansp5e2d1c02022-03-10 04:51:40 +0100361 <xsl:template name="xsl:initial-template">
banspf2b24e62022-03-28 18:12:08 +0200362 <xsl:variable name="IDs_to_skip" select="tokenize($skip_docID,',')" as="xs:string*"/>
banspd1bf1db2022-04-04 02:16:24 +0200363
banspe726b4a2022-03-28 05:47:45 +0200364 <!-- we only want to call the template below once, and we process a random NKJP corpus file for that purpose,
bansp8f6700b2022-03-27 05:27:09 +0200365 because all we need is the main corpus header, and we can (should) get to that from any NKJP corpus document -->
366 <xsl:call-template name="create_corpus_header">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200367 <xsl:with-param name="text.doc" select="$collection_of_text[1]" as="document-node()"/>
bansp8f6700b2022-03-27 05:27:09 +0200368 <xsl:with-param name="target" select="$targetCorpusDir_slashed || 'header.xml'" as="xs:string"/>
369 </xsl:call-template>
370
banspe726b4a2022-03-28 05:47:45 +0200371 <xsl:for-each select="$collection_of_text">
372 <xsl:variable name="my_dir" as="xs:string" select="replace(base-uri(),'/text\.xml','')"/>
373 <xsl:variable name="my_textID" as="xs:string" select="tokenize($my_dir,'/')[last()]"/>
374 <xsl:variable name="ann_morphosyntax.uri" select="$my_dir || '/ann_morphosyntax.xml'" as="xs:string"/>
375 <xsl:variable name="ann_segmentation.uri" select="$my_dir || '/ann_segmentation.xml'" as="xs:string"/>
Piotr Banskic5950ce2022-05-27 15:07:08 +0200376 <xsl:variable name="ann_named.uri" select="$my_dir || '/ann_named.xml'" as="xs:string"/>
377 <xsl:variable name="ann_groups.uri" select="$my_dir || '/ann_groups.xml'" as="xs:string"/>
378 <xsl:variable name="ann_words.uri" select="$my_dir || '/ann_words.xml'" as="xs:string"/>
banspe726b4a2022-03-28 05:47:45 +0200379
banspf2b24e62022-03-28 18:12:08 +0200380 <xsl:choose>
381 <xsl:when test="$my_textID = $IDs_to_skip"/>
bansp9dc10002022-05-17 22:33:34 +0200382 <!-- this is a utility step, for when we want to ignore some texts for any reason (debugging, selective update) -->
banspf2b24e62022-03-28 18:12:08 +0200383 <xsl:otherwise>
banspd1bf1db2022-04-04 02:16:24 +0200384
bansp9dc10002022-05-17 22:33:34 +0200385 <xsl:call-template name="process_single_sample">
Piotr Banskif9590692022-06-02 15:39:48 +0200386 <xsl:with-param name="text.doc" as="document-node()" select="."/>
387 <xsl:with-param name="ann_morphosyntax.doc" as="document-node()"
banspf2b24e62022-03-28 18:12:08 +0200388 select="doc($ann_morphosyntax.uri)"/>
389 <xsl:with-param name="ann_segmentation.xml" as="document-node()"
390 select="doc($ann_segmentation.uri)"/>
391 <xsl:with-param name="my_textID" select="$my_textID" as="xs:string"/>
Piotr Banskic5950ce2022-05-27 15:07:08 +0200392 <!-- the following parameters may happen to be null -->
Piotr Banskif9590692022-06-02 15:39:48 +0200393 <xsl:with-param name="ann_named.doc" as="document-node()*"
Piotr Banskic5950ce2022-05-27 15:07:08 +0200394 select="if(fn:doc-available($ann_named.uri)) then doc($ann_named.uri) else ()"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200395 <xsl:with-param name="ann_groups.doc" as="document-node()*"
Piotr Banskic5950ce2022-05-27 15:07:08 +0200396 select="if(fn:doc-available($ann_groups.uri)) then doc($ann_groups.uri) else ()"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200397 <xsl:with-param name="ann_words.doc" as="document-node()*"
Piotr Banskic5950ce2022-05-27 15:07:08 +0200398 select="if(fn:doc-available($ann_words.uri)) then doc($ann_words.uri) else ()"/>
399
bansp9dc10002022-05-17 22:33:34 +0200400 </xsl:call-template>
banspf2b24e62022-03-28 18:12:08 +0200401 </xsl:otherwise>
402 </xsl:choose>
banspe726b4a2022-03-28 05:47:45 +0200403 </xsl:for-each>
bansp8f6700b2022-03-27 05:27:09 +0200404 </xsl:template>
405
406 <xsl:template name="process_single_sample">
Piotr Banskif9590692022-06-02 15:39:48 +0200407 <xsl:param name="text.doc" as="document-node()"/>
408 <xsl:param name="ann_morphosyntax.doc" as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200409 <xsl:param name="ann_segmentation.xml" as="document-node()"/>
banspd1bf1db2022-04-04 02:16:24 +0200410 <xsl:param name="my_textID" as="xs:string" select="'0-BAD_textID'"/>
bansp9dc10002022-05-17 22:33:34 +0200411 <!-- empty textID should never happen, but if it does, it will be signalled at the top of the output -->
Piotr Banskif9590692022-06-02 15:39:48 +0200412 <xsl:param name="ann_named.doc" as="document-node()*"/>
413 <xsl:param name="ann_groups.doc" as="document-node()*"/>
414 <xsl:param name="ann_words.doc" as="document-node()*"/>
banspe726b4a2022-03-28 05:47:45 +0200415
416 <xsl:variable name="targetBaseDir" as="xs:string" select="$targetCorpusDir_slashed || $docID || '/' || $my_textID"/>
417
418 <xsl:variable name="compoundID" as="xs:string"
419 select="$corpusID || '_' || $docID || '.' || $my_textID"/>
420 <!-- this is what occurs in the text and data layers as @docid -->
421
bansp5e2d1c02022-03-10 04:51:40 +0100422 <xsl:call-template name="create_data">
bansp9dc10002022-05-17 22:33:34 +0200423 <xsl:with-param name="ann_segmentation.xml" select="$ann_segmentation.xml" as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200424 <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/>
425 <xsl:with-param name="target" select="$targetBaseDir || '/data.xml'" as="xs:string"/>
bansp5f841732022-03-16 06:27:31 +0100426 </xsl:call-template>
427
Piotr Banski4f4c2d22022-05-19 01:44:32 +0200428 <xsl:call-template name="create_struct">
banspe726b4a2022-03-28 05:47:45 +0200429 <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/>
bansp5f841732022-03-16 06:27:31 +0100430 <xsl:with-param name="ann_segmentation.xml" select="$ann_segmentation.xml"
431 as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200432 <xsl:with-param name="target" select="$targetBaseDir || '/struct/structure.xml'" as="xs:string"
bansp5f841732022-03-16 06:27:31 +0100433 />
434 </xsl:call-template>
Piotr Banski92791a22022-05-26 01:41:10 +0200435
Piotr Banskia51907c2022-05-25 15:09:41 +0200436 <xsl:call-template name="create_morpho">
banspe726b4a2022-03-28 05:47:45 +0200437 <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/>
bansp3e5b20c2022-03-18 20:22:31 +0100438 <xsl:with-param name="ann_segmentation.xml" select="$ann_segmentation.xml"
439 as="document-node()"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200440 <xsl:with-param name="ann_morphosyntax.doc" select="$ann_morphosyntax.doc"
bansp5f841732022-03-16 06:27:31 +0100441 as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200442 <xsl:with-param name="target" select="$targetBaseDir || '/nkjp/morpho.xml'" as="xs:string"/>
bansp5e2d1c02022-03-10 04:51:40 +0100443 </xsl:call-template>
Piotr Banskia51907c2022-05-25 15:09:41 +0200444
Piotr Banski09096ee2022-05-25 13:41:03 +0200445 <xsl:call-template name="create_text_header">
Piotr Banskif9590692022-06-02 15:39:48 +0200446 <xsl:with-param name="text.doc" select="$text.doc" as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200447 <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/>
448 <xsl:with-param name="target" select="$targetBaseDir || '/header.xml'" as="xs:string"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200449 </xsl:call-template>
Piotr Banski6a4a2522022-05-24 01:16:47 +0200450
Piotr Banskif9590692022-06-02 15:39:48 +0200451 <xsl:if test="$ann_named.doc">
Piotr Banski763b41f2022-06-02 01:13:23 +0200452 <xsl:variable name="rev_lookup-seq" as="map(*)+">
453 <xsl:for-each
Piotr Banskif9590692022-06-02 15:39:48 +0200454 select="$ann_named.doc//tei:seg/tei:ptr">
Piotr Banski763b41f2022-06-02 01:13:23 +0200455 <xsl:variable name="trg" as="xs:string" select="fn:substring-before(@target, '#')"/>
456 <!-- caution: as of 01-June-2022, some of the pointers are malformed (missing '#' when referencing locally).
457 so we need to act around it but also sustainably - in case that error gets corrected -->
458
459 <xsl:if test="fn:string-length($trg) and $trg eq 'ann_morphosyntax.xml'">
460 <xsl:sequence>
461 <xsl:map-entry key="fn:substring-after(fn:string(@target), '#')" select="fn:current()"
462 />
463 </xsl:sequence>
464 </xsl:if>
465 </xsl:for-each>
466 </xsl:variable>
467 <xsl:variable name="rev_lookup" as="map(*)" select="map:merge($rev_lookup-seq,map{'duplicates':'combine'})"/>
468
Piotr Banskic5950ce2022-05-27 15:07:08 +0200469 <xsl:call-template name="create_named">
470 <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200471 <xsl:with-param name="ann_morphosyntax.doc" select="$ann_morphosyntax.doc"
Piotr Banskic5950ce2022-05-27 15:07:08 +0200472 as="document-node()"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200473 <xsl:with-param name="ann_named.doc" select="$ann_named.doc"
Piotr Banskic5950ce2022-05-27 15:07:08 +0200474 as="document-node()"/>
475 <xsl:with-param name="target" select="$targetBaseDir || '/nkjp/named.xml'" as="xs:string"/>
Piotr Banski763b41f2022-06-02 01:13:23 +0200476 <xsl:with-param name="rev_lookup" select="$rev_lookup" as="map(*)"/>
Piotr Banskic5950ce2022-05-27 15:07:08 +0200477 </xsl:call-template>
478 </xsl:if>
479
Piotr Banskif9590692022-06-02 15:39:48 +0200480 <xsl:if test="$ann_words.doc and $ann_groups.doc">
Piotr Banskic5950ce2022-05-27 15:07:08 +0200481 <xsl:call-template name="create_groups">
482 <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/>
483 <xsl:with-param name="ann_segmentation.xml" select="$ann_segmentation.xml"
484 as="document-node()"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200485 <xsl:with-param name="ann_morphosyntax.doc" select="$ann_morphosyntax.doc"
Piotr Banskic5950ce2022-05-27 15:07:08 +0200486 as="document-node()"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200487 <xsl:with-param name="ann_words.doc" select="$ann_words.doc"
Piotr Banskic5950ce2022-05-27 15:07:08 +0200488 as="document-node()"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200489 <xsl:with-param name="ann_groups.doc" select="$ann_groups.doc"
Piotr Banskic5950ce2022-05-27 15:07:08 +0200490 as="document-node()"/>
491 <xsl:with-param name="target" select="$targetBaseDir || '/nkjp/groups.xml'" as="xs:string"/>
492 </xsl:call-template>
493 </xsl:if>
494
bansp5e2d1c02022-03-10 04:51:40 +0100495 </xsl:template>
496
497 <!-- ************************** data.xml ******************* -->
498
499 <xsl:template name="create_data">
bansp9dc10002022-05-17 22:33:34 +0200500 <xsl:param name="ann_segmentation.xml" as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200501 <xsl:param name="compoundID" as="xs:string"/>
bansp5f841732022-03-16 06:27:31 +0100502 <xsl:param name="target" as="xs:string"/>
bansp5e2d1c02022-03-10 04:51:40 +0100503 <!-- create the data.xml file -->
504 <xsl:result-document encoding="UTF-8" method="xml" indent="yes"
bansp5f841732022-03-16 06:27:31 +0100505 xpath-default-namespace="{$KorAP_namespace}" href="{$target}">
bansp5e2d1c02022-03-10 04:51:40 +0100506
Akron9a8ee3e2022-01-31 13:51:49 +0100507 <xsl:processing-instruction name="xml-model">href=&quot;text.rng&quot; type=&quot;application/xml&quot; schematypens=&quot;http://relaxng.org/ns/structure/1.0&quot;</xsl:processing-instruction>
bansp5e2d1c02022-03-10 04:51:40 +0100508 <xsl:element name="raw_text" namespace="{$KorAP_namespace}">
bansp5f841732022-03-16 06:27:31 +0100509 <xsl:attribute name="docid" select="$compoundID"/>
bansp5e2d1c02022-03-10 04:51:40 +0100510 <xsl:element name="metadata" namespace="{$KorAP_namespace}">
511 <xsl:attribute name="file" select="'metadata.xml'"/>
512 </xsl:element>
513
514 <xsl:element name="text" namespace="{$KorAP_namespace}">
bansp9dc10002022-05-17 22:33:34 +0200515 <xsl:variable name="content" as="xs:string+">
Piotr Banski4f4c2d22022-05-19 01:44:32 +0200516 <xsl:for-each select="$ann_segmentation.xml/tei:teiCorpus/tei:TEI/tei:text/tei:body/tei:p/tei:s//tei:seg[count(@nkjp:rejected) eq 0]">
bansp9dc10002022-05-17 22:33:34 +0200517 <xsl:sequence select="
Piotr Banskifdc858a2022-05-25 02:40:32 +0200518 if (f:is_preceded_by_ws(.,false())) then
bansp9dc10002022-05-17 22:33:34 +0200519 ' '
520 else
521 '', ./tei:w"/>
522 </xsl:for-each>
523 </xsl:variable>
524 <xsl:value-of select="string-join($content)"/>
bansp5e2d1c02022-03-10 04:51:40 +0100525 </xsl:element>
Akron9a8ee3e2022-01-31 13:51:49 +0100526 </xsl:element>
banspf79443e2022-02-25 14:25:33 +0100527 </xsl:result-document>
Akron9a8ee3e2022-01-31 13:51:49 +0100528 </xsl:template>
529
bansp5f841732022-03-16 06:27:31 +0100530 <!-- ************************** struct ******************* -->
531
532 <xsl:template name="create_struct">
banspe726b4a2022-03-28 05:47:45 +0200533 <xsl:param name="compoundID" as="xs:string"/>
bansp5f841732022-03-16 06:27:31 +0100534 <xsl:param name="ann_segmentation.xml" as="document-node()"/>
535 <xsl:param name="target" as="xs:string"/>
Piotr Banski4f4c2d22022-05-19 01:44:32 +0200536
bansp5f841732022-03-16 06:27:31 +0100537 <xsl:result-document encoding="UTF-8" method="xml" indent="yes"
538 xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}">
539 <xsl:processing-instruction name="xml-model">href=&quot;span.rng&quot; type=&quot;application/xml&quot; schematypens=&quot;http://relaxng.org/ns/structure/1.0&quot;</xsl:processing-instruction>
540 <xsl:element name="layer" namespace="{$KorAP_namespace}">
541 <xsl:attribute name="docid" select="$compoundID"/>
542 <xsl:attribute name="version" select="$KorAP-XML_version"/>
543
544 <xsl:element name="spanList" namespace="{$KorAP_namespace}">
Piotr Banski09096ee2022-05-25 13:41:03 +0200545 <xsl:apply-templates select="$ann_segmentation.xml//tei:text" mode="struct"/>
bansp5f841732022-03-16 06:27:31 +0100546 </xsl:element>
547 </xsl:element>
548 </xsl:result-document>
549 </xsl:template>
550
551 <xsl:template match="tei:*" mode="struct">
Piotr Banski09096ee2022-05-25 13:41:03 +0200552 <xsl:variable name="offsets" as="xs:integer+">
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200553 <xsl:sequence select="map:get(fn:accumulator-after('segmentation-offsets')[last()], string(@xml:id))"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200554 </xsl:variable>
Piotr Banski6a4a2522022-05-24 01:16:47 +0200555
bansp5f841732022-03-16 06:27:31 +0100556 <xsl:variable name="my_name" select="local-name()" as="xs:string"/>
Piotr Banskie1ac5202022-05-30 21:25:21 +0200557 <xsl:variable name="my_index" select="fn:accumulator-before('element-index')" as="xs:integer"/>
bansp3e5b20c2022-03-18 20:22:31 +0100558
bansp5f841732022-03-16 06:27:31 +0100559 <xsl:element name="span" namespace="{$KorAP_namespace}">
560 <xsl:attribute name="id" select="'s' || $my_index"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200561 <xsl:attribute name="from" select="$offsets[1]"/>
562 <xsl:attribute name="to" select="$offsets[2]"/>
bansp5f841732022-03-16 06:27:31 +0100563 <xsl:attribute name="l" select="f:compute_nesting(.)"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200564 <xsl:if test="local-name() eq 'seg' and $SHOW_ORTH_IN_STRUCT">
565 <xsl:comment><xsl:value-of select="fn:normalize-space(.)"/></xsl:comment>
566 </xsl:if>
bansp5f841732022-03-16 06:27:31 +0100567 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
Piotr Banskifdc858a2022-05-25 02:40:32 +0200568 <xsl:attribute name="type" select="'struct'"></xsl:attribute> <!-- STRUCT vs. LEX for morpho -->
bansp5f841732022-03-16 06:27:31 +0100569 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
bansp3e5b20c2022-03-18 20:22:31 +0100570 <xsl:attribute name="name" select="'name'"/>
571 <xsl:value-of select="local-name()"/>
bansp5f841732022-03-16 06:27:31 +0100572 </xsl:element>
573 <xsl:if test="count(@*)">
574 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
575 <xsl:attribute name="name" select="'attr'"/>
576 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
577 <xsl:attribute name="type" select="'attr'"/>
578 <xsl:for-each select="@*">
579 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
580 <xsl:attribute name="name" select="local-name(.)"/>
581 <xsl:value-of select="."/>
582 </xsl:element>
583 </xsl:for-each>
584 </xsl:element>
585 </xsl:element>
586 </xsl:if>
587 </xsl:element>
588 </xsl:element>
Piotr Banskia51907c2022-05-25 15:09:41 +0200589 <xsl:apply-templates mode="struct"/>
bansp5f841732022-03-16 06:27:31 +0100590 </xsl:template>
591
592 <!-- ************************** morpho ******************* -->
593
594 <xsl:template name="create_morpho">
banspe726b4a2022-03-28 05:47:45 +0200595 <xsl:param name="compoundID" as="xs:string"/>
bansp3e5b20c2022-03-18 20:22:31 +0100596 <xsl:param name="ann_segmentation.xml" as="document-node()"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200597 <xsl:param name="ann_morphosyntax.doc" as="document-node()"/>
bansp5f841732022-03-16 06:27:31 +0100598 <xsl:param name="target" as="xs:string"/>
599
600 <xsl:result-document encoding="UTF-8" method="xml" indent="yes"
601 xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}">
602 <xsl:processing-instruction name="xml-model">href=&quot;span.rng&quot; type=&quot;application/xml&quot; schematypens=&quot;http://relaxng.org/ns/structure/1.0&quot;</xsl:processing-instruction>
bansp3e5b20c2022-03-18 20:22:31 +0100603 <xsl:element name="layer" namespace="{$KorAP_namespace}">
604 <xsl:attribute name="docid" select="$compoundID"/>
605 <xsl:attribute name="version" select="$KorAP-XML_version"/>
606
607 <xsl:element name="spanList" namespace="{$KorAP_namespace}">
608 <xsl:apply-templates select="$ann_segmentation.xml//tei:text" mode="morpho">
Piotr Banskif9590692022-06-02 15:39:48 +0200609 <xsl:with-param name="ann_morphosyntax.doc" select="$ann_morphosyntax.doc" as="document-node()" tunnel="yes"/>
bansp3e5b20c2022-03-18 20:22:31 +0100610 </xsl:apply-templates>
611 </xsl:element>
612 </xsl:element>
bansp5f841732022-03-16 06:27:31 +0100613 </xsl:result-document>
614 </xsl:template>
615
bansp3e5b20c2022-03-18 20:22:31 +0100616 <xsl:template match="tei:seg" mode="morpho">
Piotr Banskif9590692022-06-02 15:39:48 +0200617 <xsl:param name="ann_morphosyntax.doc" as="document-node()" tunnel="yes"/>
Piotr Banskia51907c2022-05-25 15:09:41 +0200618 <!-- it's so spread out because I wanted to make sure to be able to look up the individual
619 constituent values, should anything go wrong; it might get compacted at some point, but
620 the increase in efficiency will probably be minimal, compared to the decrease of readability -->
621 <xsl:variable name="offsets" as="xs:integer+">
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200622 <xsl:sequence select="map:get(fn:accumulator-after('segmentation-offsets')[last()], string(@xml:id))"/>
Piotr Banskia51907c2022-05-25 15:09:41 +0200623 </xsl:variable>
bansp3e5b20c2022-03-18 20:22:31 +0100624 <xsl:variable name="my_name" select="local-name()" as="xs:string"/>
625 <xsl:variable name="my_id" select="@xml:id" as="xs:string"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200626 <xsl:variable name="my_morph-seg" as="node()" select="$ann_morphosyntax.doc//tei:seg[substring-after(@corresp,'#') eq $my_id]"/>
bansp3e5b20c2022-03-18 20:22:31 +0100627 <xsl:variable name="my_disamb" select="$my_morph-seg//tei:fs/tei:f[@name eq 'disamb']" as="node()"/>
628 <xsl:variable name="my_choice-id" select="substring-after($my_disamb//tei:f[@name eq 'choice']/@fVal,'#')" as="xs:string"/>
629 <xsl:variable name="my_choice-lex" select="$my_morph-seg//tei:f[@name eq 'interps']/tei:fs[@type eq 'lex'][descendant::tei:symbol[@xml:id eq $my_choice-id]]" as="node()"/>
630 <xsl:variable name="chosen-msd" as="xs:string" select="$my_choice-lex/descendant::tei:symbol[@xml:id eq $my_choice-id]/@value"/>
Piotr Banskie1ac5202022-05-30 21:25:21 +0200631 <xsl:variable name="my_index" select="fn:accumulator-before('element-index')" as="xs:integer"/>
bansp3e5b20c2022-03-18 20:22:31 +0100632
bansp3e5b20c2022-03-18 20:22:31 +0100633 <xsl:element name="span" namespace="{$KorAP_namespace}">
Piotr Banskia51907c2022-05-25 15:09:41 +0200634 <xsl:attribute name="id" select="'m' || $my_index"/>
635 <xsl:attribute name="from" select="$offsets[1]"/>
636 <xsl:attribute name="to" select="$offsets[2]"/>
bansp3e5b20c2022-03-18 20:22:31 +0100637 <xsl:attribute name="l" select="f:compute_nesting(.)"/>
638 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
639 <xsl:attribute name="type" select="'lex'"/>
640 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
641 <xsl:attribute name="name" select="'lex'"/>
Piotr Banski763b41f2022-06-02 01:13:23 +0200642 <xsl:comment select="(if(@nkjp:nps) then ' ' else '_') || $my_morph-seg//tei:fs/tei:f[@name eq 'orth']/tei:string"/>
bansp3e5b20c2022-03-18 20:22:31 +0100643 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
bansp3e5b20c2022-03-18 20:22:31 +0100644 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
645 <xsl:attribute name="name" select="'lemma'"/>
646 <xsl:value-of select="$my_choice-lex/tei:f[@name eq 'base']/tei:string"/>
647 </xsl:element>
648 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
649 <xsl:attribute name="name" select="'pos'"/>
650 <xsl:value-of select="$my_choice-lex/tei:f[@name eq 'ctag']/tei:symbol/@value"/>
651 </xsl:element>
652 <xsl:if test="string-length($chosen-msd)">
653 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
654 <xsl:attribute name="name" select="'msd'"/>
655 <xsl:value-of select="$chosen-msd"/>
656 </xsl:element>
657 </xsl:if>
658 <xsl:if test="$my_morph-seg//tei:fs/tei:f[@name eq 'nps']">
659 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
660 <xsl:attribute name="name" select="'join'"/>
661 <xsl:value-of select="'left'"/>
662 </xsl:element>
663 </xsl:if>
664 </xsl:element>
665 </xsl:element>
666 </xsl:element>
667 </xsl:element>
bansp3e5b20c2022-03-18 20:22:31 +0100668 </xsl:template>
banspe726b4a2022-03-28 05:47:45 +0200669
Piotr Banskic5950ce2022-05-27 15:07:08 +0200670 <!-- ************************** named entities ******************* -->
671
672 <xsl:template name="create_named">
673 <xsl:param name="compoundID" as="xs:string"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200674 <xsl:param name="ann_morphosyntax.doc" as="document-node()"/>
675 <xsl:param name="ann_named.doc" as="document-node()"/>
Piotr Banskic5950ce2022-05-27 15:07:08 +0200676 <xsl:param name="target" as="xs:string"/>
Piotr Banski763b41f2022-06-02 01:13:23 +0200677 <xsl:param name="rev_lookup" as="map(*)"/>
678
Piotr Banskic5950ce2022-05-27 15:07:08 +0200679 <xsl:result-document encoding="UTF-8" method="xml" indent="yes"
680 xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}">
681 <xsl:processing-instruction name="xml-model">href=&quot;span.rng&quot; type=&quot;application/xml&quot; schematypens=&quot;http://relaxng.org/ns/structure/1.0&quot;</xsl:processing-instruction>
682 <xsl:element name="layer" namespace="{$KorAP_namespace}">
683 <xsl:attribute name="docid" select="$compoundID"/>
684 <xsl:attribute name="version" select="$KorAP-XML_version"/>
685
686 <xsl:element name="spanList" namespace="{$KorAP_namespace}">
Piotr Banskif9590692022-06-02 15:39:48 +0200687 <xsl:apply-templates select="$ann_morphosyntax.doc//tei:text" mode="named">
688 <xsl:with-param name="ann_named.doc" select="$ann_named.doc" as="document-node()" tunnel="yes"/>
Piotr Banski763b41f2022-06-02 01:13:23 +0200689 <xsl:with-param name="rev_lookup" select="$rev_lookup" as="map(*)" tunnel="yes"/>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200690 </xsl:apply-templates>
Piotr Banskic5950ce2022-05-27 15:07:08 +0200691 </xsl:element>
692 </xsl:element>
693 </xsl:result-document>
694 </xsl:template>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200695
696 <xsl:template match="tei:seg" mode="named"/>
697
698 <xsl:template match="tei:seg[tei:fs[tei:f[@name eq 'disamb']]]" mode="named">
Piotr Banskif9590692022-06-02 15:39:48 +0200699 <xsl:param name="ann_named.doc" as="document-node()" tunnel="yes"/>
Piotr Banski763b41f2022-06-02 01:13:23 +0200700 <xsl:param name="rev_lookup" as="map(*)" tunnel="yes"/>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200701
702 <xsl:variable name="offsets" as="xs:integer+">
703 <xsl:sequence select="map:get(fn:accumulator-after('morpho-offsets')[last()], string(@xml:id))"/>
704 </xsl:variable>
705
Piotr Banski763b41f2022-06-02 01:13:23 +0200706 <xsl:variable name="ptr" select="map:get($rev_lookup,fn:string(@xml:id))" as="element(tei:ptr)*"/>
707 <!-- it's an element, because we need to see where it stands in a sequence... -->
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200708
Piotr Banski763b41f2022-06-02 01:13:23 +0200709 <xsl:if test="$ptr">
710 <xsl:variable name="my_id" select="@xml:id" as="xs:string"/>
711 <xsl:variable name="my_index" select="fn:accumulator-before('element-index')" as="xs:integer"/>
712
713 <xsl:element name="span" namespace="{$KorAP_namespace}">
714 <xsl:attribute name="id" select="'n' || $my_index"/>
715 <xsl:attribute name="from" select="$offsets[1]"/>
716 <xsl:attribute name="to" select="$offsets[2]"/>
717 <xsl:attribute name="l" select="f:compute_nesting(.)"/>
718 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
719 <xsl:attribute name="type" select="'ne'"/>
720 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
721 <xsl:attribute name="name" select="'ne'"/>
722 <xsl:comment select="
723 (if (tei:fs/tei:f[@name eq 'nps']) then
724 ' '
725 else
726 '_') || tei:fs/tei:f[@name eq 'orth']/tei:string"/>
727 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
728 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
729 <xsl:attribute name="name" select="'complex-ent'"/>
730 <xsl:for-each select="$ptr">
731 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
732 <xsl:attribute name="type" select="'complex-ent'"/>
733 <xsl:for-each select="parent::tei:seg/tei:fs[1]/tei:f">
734 <xsl:if test="@name eq 'type' or @name eq 'subtype'">
735 <xsl:copy-of select="." copy-namespaces="no"/>
736 </xsl:if>
737 </xsl:for-each>
738 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
739 <xsl:attribute name="name" select="'nkjp-named'"/>
740 <xsl:copy-of select="parent::tei:seg/tei:fs[1]" copy-namespaces="no"/>
741 </xsl:element>
742 </xsl:element>
743 </xsl:for-each>
744
745 </xsl:element>
746
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200747 </xsl:element>
748 </xsl:element>
749 </xsl:element>
750 </xsl:element>
Piotr Banski763b41f2022-06-02 01:13:23 +0200751 </xsl:if>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200752 </xsl:template>
753
Piotr Banskic5950ce2022-05-27 15:07:08 +0200754
755 <!-- ************************** syntactic chunks ******************* -->
756
757 <xsl:template name="create_groups">
758 <xsl:param name="compoundID" as="xs:string"/>
759 <xsl:param name="ann_segmentation.xml" as="document-node()"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200760 <xsl:param name="ann_morphosyntax.doc" as="document-node()"/>
761 <xsl:param name="ann_words.doc" as="document-node()"/>
762 <xsl:param name="ann_groups.doc" as="document-node()"/>
Piotr Banskic5950ce2022-05-27 15:07:08 +0200763 <xsl:param name="target" as="xs:string"/>
764
765 <xsl:result-document encoding="UTF-8" method="xml" indent="yes"
766 xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}">
767 <xsl:processing-instruction name="xml-model">href=&quot;span.rng&quot; type=&quot;application/xml&quot; schematypens=&quot;http://relaxng.org/ns/structure/1.0&quot;</xsl:processing-instruction>
768 <xsl:element name="layer" namespace="{$KorAP_namespace}">
769 <xsl:attribute name="docid" select="$compoundID"/>
770 <xsl:attribute name="version" select="$KorAP-XML_version"/>
771
772 <xsl:element name="spanList" namespace="{$KorAP_namespace}">
773 <!--<xsl:apply-templates select="$ann_segmentation.xml//tei:text" mode="groups">
Piotr Banskif9590692022-06-02 15:39:48 +0200774 <xsl:with-param name="ann_morphosyntax.doc" select="$ann_morphosyntax.doc" as="document-node()" tunnel="yes"/>
775 <xsl:with-param name="ann_words.doc" select="$ann_words.doc" as="document-node()" tunnel="yes"/>
776 <xsl:with-param name="ann_groups.doc" select="$ann_groups.doc" as="document-node()" tunnel="yes"/>
Piotr Banskic5950ce2022-05-27 15:07:08 +0200777 </xsl:apply-templates>-->
778 </xsl:element>
779 </xsl:element>
780 </xsl:result-document>
781 </xsl:template>
782
bansp5f841732022-03-16 06:27:31 +0100783 <!-- ************************** TEXT header ******************* -->
784
785 <xsl:template name="create_text_header">
Piotr Banskif9590692022-06-02 15:39:48 +0200786 <xsl:param name="text.doc" as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200787 <xsl:param name="compoundID" as="xs:string"/>
bansp5f841732022-03-16 06:27:31 +0100788 <xsl:param name="target" as="xs:string"/>
789
790 <!-- create the local header.xml file -->
791 <xsl:result-document encoding="UTF-8" method="xml" indent="yes"
792 xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}">
793
794 <idsHeader type="document" pattern="text" status="new" version="1.1" TEIform="teiHeader">
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200795 <xsl:apply-templates select="$text.doc//tei:TEI/tei:teiHeader/tei:*" mode="text-header">
banspe726b4a2022-03-28 05:47:45 +0200796 <xsl:with-param name="compoundID" as="xs:string" select="$compoundID" tunnel="yes"/>
797 </xsl:apply-templates>
bansp5f841732022-03-16 06:27:31 +0100798 </idsHeader>
799 </xsl:result-document>
800 </xsl:template>
801
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200802 <xsl:template match="tei:fileDesc" mode="text-header">
bansp9103aab2022-03-19 05:10:21 +0100803 <xsl:element name="{local-name()}">
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200804 <xsl:apply-templates mode="text-header"/>
bansp9103aab2022-03-19 05:10:21 +0100805 </xsl:element>
bansp5f841732022-03-16 06:27:31 +0100806 </xsl:template>
807
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200808 <xsl:template match="tei:title" mode="text-header">
bansp5f841732022-03-16 06:27:31 +0100809 <t.title>
810 <xsl:apply-templates/>
811 </t.title>
812 </xsl:template>
813
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200814 <xsl:template match="tei:titleStmt" mode="text-header">
banspe726b4a2022-03-28 05:47:45 +0200815 <xsl:param name="compoundID" as="xs:string" tunnel="yes"/>
bansp5f841732022-03-16 06:27:31 +0100816 <titleStmt>
817 <textSigle>
banspe726b4a2022-03-28 05:47:45 +0200818 <xsl:value-of select="$compoundID"/>
bansp5f841732022-03-16 06:27:31 +0100819 </textSigle>
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200820 <xsl:apply-templates mode="text-header"/>
bansp5f841732022-03-16 06:27:31 +0100821 </titleStmt>
822 </xsl:template>
823
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200824 <xsl:template match="tei:publicationStmt" mode="text-header">
bansp9103aab2022-03-19 05:10:21 +0100825 <xsl:element name="{local-name()}">
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200826 <xsl:apply-templates mode="text-header"/>
bansp9103aab2022-03-19 05:10:21 +0100827 </xsl:element>
828 </xsl:template>
829
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200830 <xsl:template match="tei:availability" mode="text-header">
bansp9103aab2022-03-19 05:10:21 +0100831 <xsl:element name="{local-name()}">
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200832 <xsl:apply-templates mode="text-header" select="@* | *"/>
bansp9103aab2022-03-19 05:10:21 +0100833 </xsl:element>
834 </xsl:template>
835
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200836 <xsl:template match="tei:profileDesc" mode="text-header">
bansp9103aab2022-03-19 05:10:21 +0100837 <xsl:element name="{local-name()}">
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200838 <xsl:apply-templates mode="text-header"/>
bansp9103aab2022-03-19 05:10:21 +0100839 </xsl:element>
840 </xsl:template>
bansp5f841732022-03-16 06:27:31 +0100841
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200842 <xsl:template match="tei:textClass" mode="text-header">
bansp9103aab2022-03-19 05:10:21 +0100843 <xsl:element name="{local-name()}">
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200844 <xsl:apply-templates mode="text-header" select="@* | *"/>
bansp9103aab2022-03-19 05:10:21 +0100845 </xsl:element>
846 </xsl:template>
847
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200848 <xsl:template match="tei:catRef" mode="text-header corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100849 <xsl:element name="{local-name()}">
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200850 <xsl:apply-templates mode="text-header" select="@* | *"/>
bansp9103aab2022-03-19 05:10:21 +0100851 </xsl:element>
852 </xsl:template>
853
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200854 <xsl:template match="@status | @scheme | @target | @type | @xml:id[ancestor::tei:classDecl] | @xml:lang" mode="text-header corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100855 <xsl:copy-of select="."/>
856 </xsl:template>
857
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200858 <xsl:template match="tei:p" mode="text-header corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100859 <xsl:element name="{local-name()}">
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200860 <xsl:apply-templates mode="text_inside_header"/>
bansp9103aab2022-03-19 05:10:21 +0100861 </xsl:element>
862 </xsl:template>
863
864
865 <!-- OPTIMIZATION has to take modes into account -->
bansp5e2d1c02022-03-10 04:51:40 +0100866 <!-- ************************** CORPUS header ******************* -->
867 <xsl:template name="create_corpus_header">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200868 <xsl:param name="text.doc" as="document-node()"/>
bansp5f841732022-03-16 06:27:31 +0100869 <xsl:param name="target" as="xs:string"/>
bansp5e2d1c02022-03-10 04:51:40 +0100870
871 <!-- create the corpus-level header.xml file -->
bansp5f841732022-03-16 06:27:31 +0100872 <xsl:result-document encoding="UTF-8" method="xml" indent="yes" href="{$target}">
bansp5e2d1c02022-03-10 04:51:40 +0100873
874 <!--doctype-public="{$publicDoctypeI5}"
875 doctype-system="{$systemDoctypeI5}">
876 these are, sadly, useless
877 -->
878
879 <idsHeader type="corpus" pattern="text" status="new" version="1.1" TEIform="teiHeader">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200880 <xsl:apply-templates select="$text.doc/tei:teiCorpus/tei:teiHeader/tei:*" mode="corpus-header"/>
bansp5e2d1c02022-03-10 04:51:40 +0100881 </idsHeader>
882 </xsl:result-document>
883 </xsl:template>
884
Piotr Banskifaa910f2022-06-03 00:46:29 +0200885 <xsl:template match="tei:fileDesc" mode="corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100886 <xsl:element name="{local-name()}">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200887 <xsl:apply-templates mode="corpus-header"/>
bansp9103aab2022-03-19 05:10:21 +0100888 </xsl:element>
bansp5e2d1c02022-03-10 04:51:40 +0100889 </xsl:template>
bansp9103aab2022-03-19 05:10:21 +0100890
bansp5e2d1c02022-03-10 04:51:40 +0100891
Piotr Banskifaa910f2022-06-03 00:46:29 +0200892 <xsl:template match="tei:title" mode="corpus-header">
bansp5e2d1c02022-03-10 04:51:40 +0100893 <c.title>
Piotr Banskifaa910f2022-06-03 00:46:29 +0200894 <xsl:apply-templates mode="corpus-header" select="@*"/>
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200895 <xsl:apply-templates mode="text_inside_header"/>
bansp5e2d1c02022-03-10 04:51:40 +0100896 </c.title>
897 </xsl:template>
898
Piotr Banskifaa910f2022-06-03 00:46:29 +0200899 <xsl:template match="tei:titleStmt" mode="corpus-header">
bansp5e2d1c02022-03-10 04:51:40 +0100900 <titleStmt>
901 <korpusSigle>
902 <xsl:value-of select="$corpusID"/>
903 </korpusSigle>
Piotr Banskifaa910f2022-06-03 00:46:29 +0200904 <xsl:apply-templates mode="corpus-header"/>
bansp5e2d1c02022-03-10 04:51:40 +0100905 </titleStmt>
906 </xsl:template>
907
Piotr Banskifaa910f2022-06-03 00:46:29 +0200908 <xsl:template match="tei:publicationStmt" mode="corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100909 <xsl:element name="{local-name()}">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200910 <xsl:apply-templates mode="corpus-header"/>
bansp9103aab2022-03-19 05:10:21 +0100911 </xsl:element>
912 </xsl:template>
913
Piotr Banskifaa910f2022-06-03 00:46:29 +0200914 <xsl:template match="tei:availability" mode="corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100915 <xsl:element name="{local-name()}">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200916 <xsl:apply-templates mode="corpus-header" select="@* | *"/>
bansp9103aab2022-03-19 05:10:21 +0100917 </xsl:element>
918 </xsl:template>
919
Piotr Banskifaa910f2022-06-03 00:46:29 +0200920 <xsl:template match="tei:encodingDesc" mode="corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100921 <xsl:element name="{local-name()}">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200922 <xsl:apply-templates mode="corpus-header"/>
bansp9103aab2022-03-19 05:10:21 +0100923 </xsl:element>
924 </xsl:template>
925
Piotr Banskifaa910f2022-06-03 00:46:29 +0200926 <xsl:template match="tei:classDecl | tei:taxonomy | tei:category | tei:taxonomy/tei:bibl" mode="corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100927 <xsl:element name="{local-name()}">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200928 <xsl:apply-templates mode="corpus-header" select="@* | *"/>
bansp9103aab2022-03-19 05:10:21 +0100929 </xsl:element>
930 </xsl:template>
931
Piotr Banskifaa910f2022-06-03 00:46:29 +0200932 <xsl:template match="tei:bibl/tei:title | tei:edition | tei:desc" mode="corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100933 <xsl:element name="{local-name()}">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200934 <xsl:apply-templates mode="corpus-header" select="@*"/>
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200935 <xsl:apply-templates mode="text_inside_header"/>
bansp9103aab2022-03-19 05:10:21 +0100936 </xsl:element>
937 </xsl:template>
938<!--
Piotr Banskifaa910f2022-06-03 00:46:29 +0200939 <xsl:template match="tei:textClass" mode="corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100940 <xsl:element name="{local-name()}">
941 <xsl:apply-templates mode="corpus" select="@* | *"/>
942 </xsl:element>
943 </xsl:template>
944
Piotr Banskifaa910f2022-06-03 00:46:29 +0200945 <xsl:template match="tei:catRef" mode="corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100946 <xsl:element name="{local-name()}">
947 <xsl:apply-templates mode="corpus" select="@* | *"/>
948 </xsl:element>
949 </xsl:template>
950-->
bansp5e2d1c02022-03-10 04:51:40 +0100951
952
953
954 <!-- this template can be called by the XSPEC test; TODO: find a way to call the main() template directly -->
955 <!-- I have not fully handled the param transmission, which would have to be kludged in just for the sake of XSPec,
956 because I'm disabling this for now, due to XSpec design issues; relevant links, a.o.:
957
958 https://stackoverflow.com/questions/64933277/what-is-the-cause-of-error-cannot-execute-xslresult-document-while-evaluating
959 https://www.balisage.net/Proceedings/vol25/html/Galtman01/BalisageVol25-Galtman01.html
960
961 In short: the internal design of XSpec forces kludges when one wants to use xsl:result-document in their stylesheets. But I don't
962 want to be strangled by kludges at the beginning of work, I've already lost quite a bit of time on this investigation,
963 I will therefore "just code" and then can think of externalizing bits of templates if we want to play with tests. For now,
964 I don't want to have to handle context items is a special way inside variables, etc., because I'm not sure it's worth it.
965
966 -->
967 <!--<xsl:template name="test_full">
968 <xsl:param name="corpusID"/>
969 <xsl:param name="docID"/>
970 <xsl:param name="textID"/>
971 <xsl:call-template name="xsl:initial-template"/>
972 </xsl:template>-->
973
Akron9a8ee3e2022-01-31 13:51:49 +0100974</xsl:stylesheet>
Piotr Banski6a4a2522022-05-24 01:16:47 +0200975
Piotr Banskifdc858a2022-05-25 02:40:32 +0200976<!-- template for serializing maps in messages <xsl:message select="('map:',serialize($map, map{'method':'adaptive'}))"/> -->