blob: 820895c1c9072b1950b839d1cf2f44d33a80eb84 [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
Piotr Banskib28e5882022-06-08 20:41:20 +020013 <xsl:param name="sourceDir" select="'test/resources/nkjp2korap_sample3'" 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 Banski1be7b132022-09-10 21:52:32 +020021 <!--<xsl:value-of select="''"/>-->
22 <xsl:value-of select="'HellerPodgladanie,IsakowiczZaleskiMoje,KolakowskiOcoKOT,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 Banskid2b78b82022-06-03 17:05:59 +020030 <!-- for debugging structure.xml production; otherwise we don't see the referenced span -->
31
32 <xsl:param name="SHOW_REDUNDANT_ORTH" as="xs:boolean" select="true()"/>
33 <!-- in layers such as morpho or named, one can recover the orth, so this is a bit of
34 space-wasting luxury, useful at the early stages -->
Piotr Banski09096ee2022-05-25 13:41:03 +020035
bansp8f6700b2022-03-27 05:27:09 +020036
bansp9dc10002022-05-17 22:33:34 +020037<!-- VARIABLES (= constants...) -->
banspe726b4a2022-03-28 05:47:45 +020038
39 <xsl:variable name="corpusID" as="xs:string" select="'NKJP'" static="yes"/>
40 <xsl:variable name="docID" as="xs:string" select="'NKJP'" static="yes"/>
bansp8f6700b2022-03-27 05:27:09 +020041
42 <xsl:variable name="targetCorpusDir_slashed" select="$targetDir || '/' || $corpusID || '/'" as="xs:string"/>
bansp5e2d1c02022-03-10 04:51:40 +010043
banspd1bf1db2022-04-04 02:16:24 +020044 <xsl:variable name="systemDoctypeI5" as="xs:string"
45 select="'http://corpora.ids-mannheim.de/I5/DTD/i5.dtd'" static="true"/>
bansp5e2d1c02022-03-10 04:51:40 +010046
banspd1bf1db2022-04-04 02:16:24 +020047 <xsl:variable name="publicDoctypeI5" as="xs:string" static="true"
48 select="'-//IDS//DTD I5 1.0//EN'"/>
bansp5e2d1c02022-03-10 04:51:40 +010049
banspd1bf1db2022-04-04 02:16:24 +020050 <xsl:variable name="KorAP_namespace" static="true" as="xs:string"
51 select="'http://ids-mannheim.de/ns/KorAP'"/>
bansp5e2d1c02022-03-10 04:51:40 +010052
bansp5f841732022-03-16 06:27:31 +010053 <xsl:variable name="KorAP-XML_version" select="'KorAP-0.4'" as="xs:string" static="true"/>
54 <!-- this is only a bit funny -->
55
banspe726b4a2022-03-28 05:47:45 +020056 <xsl:variable name="collection_params" as="xs:string" static="yes"
57 select="'recurse=yes;validation=strip;select=text.xml;content-type=application/xml;on-error=warning;xinclude=yes'"
58 />
59 <!-- see https://www.saxonica.com/documentation11/index.html#!sourcedocs/collections/collection-directories -->
60
61 <xsl:variable name="collection_of_text" select="collection($sourceDir || '?' || $collection_params)" as="document-node()+"/>
banspd1bf1db2022-04-04 02:16:24 +020062
banspe726b4a2022-03-28 05:47:45 +020063<!-- MODES -->
bansp5e2d1c02022-03-10 04:51:40 +010064
Piotr Banski43b9db02022-06-03 02:38:42 +020065 <xsl:mode name="struct" on-no-match="deep-skip"/>
Piotr Banskid2b78b82022-06-03 17:05:59 +020066 <xsl:mode name="morpho" on-no-match="deep-skip"/>
Piotr Banskifaa910f2022-06-03 00:46:29 +020067 <xsl:mode name="corpus-header" on-no-match="deep-skip"/>
Piotr Banskia0a9fc02022-06-03 01:20:18 +020068 <xsl:mode name="text-header" on-no-match="deep-skip"/>
69 <xsl:mode name="text_inside_header" on-no-match="text-only-copy"/>
Piotr Banski763b41f2022-06-02 01:13:23 +020070 <xsl:mode name="copy" on-no-match="shallow-copy"/>
Piotr Banski6a4a2522022-05-24 01:16:47 +020071 <xsl:mode use-accumulators="#all"/>
Piotr Banski09096ee2022-05-25 13:41:03 +020072
Piotr Banskie1ac5202022-05-30 21:25:21 +020073 <xsl:accumulator name="element-index" as="xs:integer" initial-value="0">
Piotr Banskid2b78b82022-06-03 17:05:59 +020074 <!--<xsl:accumulator-rule match="tei:*[ancestor-or-self::tei:text]" select="$value + 1" phase="start"/>-->
75 <xsl:accumulator-rule
76 match="tei:teiCorpus/tei:TEI/(tei:text | tei:text/tei:body | tei:text/tei:body/tei:p | tei:text/tei:body/tei:p/tei:s | tei:text/tei:body/tei:p/tei:s/tei:seg)"
77 select="$value + 1" phase="start"/>
Piotr Banski09096ee2022-05-25 13:41:03 +020078 </xsl:accumulator>
Piotr Banskid2b78b82022-06-03 17:05:59 +020079
Piotr Banski65a6d0b2022-05-31 17:23:08 +020080 <xsl:accumulator name="morpho-offsets" as="map(xs:string, item()+)+" initial-value="(map{'null':(0,0)})">
Piotr Banskifdc858a2022-05-25 02:40:32 +020081
82 <xsl:accumulator-rule match="tei:body/tei:p" phase="start">
83 <xsl:variable name="preceding_index" as="xs:integer">
84 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
85 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
Piotr Banski6a4a2522022-05-24 01:16:47 +020086 </xsl:variable>
87
Piotr Banskifdc858a2022-05-25 02:40:32 +020088 <xsl:variable name="our_base" as="xs:integer" select="if($preceding_index eq 0) then $preceding_index else $preceding_index + 1"/>
89 <!-- for paragraphs, it's in either being initial or not -->
Piotr Banski09096ee2022-05-25 13:41:03 +020090
Piotr Banskifdc858a2022-05-25 02:40:32 +020091 <xsl:sequence select="
92 $value,
93 map {
94 string(@xml:id): ($preceding_index,$our_base)
95 }"/>
96 </xsl:accumulator-rule>
Piotr Banskid2b78b82022-06-03 17:05:59 +020097
Piotr Banskifdc858a2022-05-25 02:40:32 +020098 <xsl:accumulator-rule match="tei:s" phase="start">
99 <xsl:variable name="preceding_index" as="xs:integer">
100 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
101 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
Piotr Banskifdc858a2022-05-25 02:40:32 +0200102 </xsl:variable>
Piotr Banski92791a22022-05-26 01:41:10 +0200103 <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 +0200104
Piotr Banskifdc858a2022-05-25 02:40:32 +0200105 <xsl:sequence select="
106 $value,
107 map {
108 string(@xml:id): ($preceding_index,$our_base)
109 }"/>
110 </xsl:accumulator-rule>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200111
112<!-- I want something that won't be matched in other layers, for efficiency - that
113 may allow me to merge the accumulators, eventually;
114 but I also want to filter out the rejected tokenization alternatives already here -->
115 <xsl:accumulator-rule match="tei:seg[tei:fs[@type eq 'morph' and tei:f[@name eq 'disamb']]]" phase="end">
116
Piotr Banskifdc858a2022-05-25 02:40:32 +0200117 <xsl:variable name="preceding_index" as="xs:integer">
118 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
119 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
Piotr Banskifdc858a2022-05-25 02:40:32 +0200120 </xsl:variable>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200121 <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 +0200122
Piotr Banski6a4a2522022-05-24 01:16:47 +0200123 <xsl:sequence select="
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200124 $value,
125 map {
126 string(@xml:id): ($our_base,$our_base + string-length(tei:fs/tei:f[@name eq 'orth']/tei:string))
127 }"/>
128
Piotr Banski6a4a2522022-05-24 01:16:47 +0200129 </xsl:accumulator-rule>
Piotr Banskid2b78b82022-06-03 17:05:59 +0200130
Piotr Banskifdc858a2022-05-25 02:40:32 +0200131 <xsl:accumulator-rule match="tei:s" phase="end">
132 <xsl:variable name="preceding_index" as="xs:integer">
133 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
134 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200135
Piotr Banskifdc858a2022-05-25 02:40:32 +0200136 </xsl:variable>
137 <xsl:variable name="our_base" as="xs:integer">
138 <xsl:variable name="incomplete" select="map:find($value,string(@xml:id))(1)" as="xs:integer+"/>
139 <xsl:sequence select="$incomplete[2]"/>
140 </xsl:variable>
Piotr Banski09096ee2022-05-25 13:41:03 +0200141
Piotr Banskifdc858a2022-05-25 02:40:32 +0200142 <xsl:sequence select="
143 $value,
144 map {
145 string(@xml:id): ($our_base,$preceding_index)
146 }"/>
147 </xsl:accumulator-rule>
Piotr Banskid2b78b82022-06-03 17:05:59 +0200148
Piotr Banskifdc858a2022-05-25 02:40:32 +0200149 <xsl:accumulator-rule match="tei:body/tei:p" phase="end">
150 <xsl:variable name="preceding_index" as="xs:integer">
151 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
152 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
153
Piotr Banskifdc858a2022-05-25 02:40:32 +0200154 </xsl:variable>
155 <xsl:variable name="our_base" as="xs:integer">
156 <xsl:variable name="incomplete" select="map:find($value,string(@xml:id))(1)" as="xs:integer+"/>
157 <xsl:sequence select="$incomplete[2]"/>
158 </xsl:variable>
Piotr Banski09096ee2022-05-25 13:41:03 +0200159
Piotr Banskifdc858a2022-05-25 02:40:32 +0200160 <xsl:sequence select="
161 $value,
162 map {
163 string(@xml:id): ($our_base,$preceding_index)
164 }"/>
165 </xsl:accumulator-rule>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200166
Piotr Banskifdc858a2022-05-25 02:40:32 +0200167 <xsl:accumulator-rule match="tei:body" phase="end">
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>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200172
Piotr Banskifdc858a2022-05-25 02:40:32 +0200173 <xsl:sequence select="
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200174 $value,
175 map {
176 string(@xml:id): (0, $preceding_index)
177 }"/>
Piotr Banskifdc858a2022-05-25 02:40:32 +0200178 </xsl:accumulator-rule>
Piotr Banskid2b78b82022-06-03 17:05:59 +0200179
Piotr Banskifdc858a2022-05-25 02:40:32 +0200180 <xsl:accumulator-rule match="tei:text" phase="end">
181 <xsl:variable name="preceding_index" as="xs:integer">
182 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
183 <xsl:sequence select="map:get($the_tail, map:keys($the_tail)[1])[2]"/>
184 </xsl:variable>
185
186 <xsl:sequence select="
187 $value,
188 map {
189 string(@xml:id): (0, $preceding_index)
190 }"/>
191 </xsl:accumulator-rule>
Piotr Banskid2b78b82022-06-03 17:05:59 +0200192
Piotr Banski6a4a2522022-05-24 01:16:47 +0200193 </xsl:accumulator>
bansp5e2d1c02022-03-10 04:51:40 +0100194
banspe726b4a2022-03-28 05:47:45 +0200195 <!-- FUNCTIONS -->
196
bansp5f841732022-03-16 06:27:31 +0100197 <xsl:function name="f:compute_nesting" as="xs:integer">
banspd1bf1db2022-04-04 02:16:24 +0200198 <xsl:param name="node" as="element()"/>
bansp5f841732022-03-16 06:27:31 +0100199 <xsl:variable name="rel_depth"
200 select="count($node/ancestor-or-self::*[local-name(.) ne 'TEI'][local-name(.) ne 'teiCorpus'])"
201 as="xs:integer"/>
bansp5f841732022-03-16 06:27:31 +0100202 <xsl:sequence select="$rel_depth"/>
203 </xsl:function>
204
Piotr Banski92791a22022-05-26 01:41:10 +0200205 <xsl:function name="f:is_preceded_by_ws" as="xs:boolean">
bansp9dc10002022-05-17 22:33:34 +0200206 <xsl:param name="node" as="element()"/>
Piotr Banskifdc858a2022-05-25 02:40:32 +0200207 <xsl:param name="suppress_initial" as="xs:boolean"/>
Piotr Banski4f4c2d22022-05-19 01:44:32 +0200208
Piotr Banski92791a22022-05-26 01:41:10 +0200209 <xsl:choose>
210 <xsl:when test="local-name($node) eq 'seg'">
211 <xsl:choose>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200212 <xsl:when test="$node/tei:fs/tei:f[@name eq 'nps']">
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200213 <xsl:sequence select="fn:false()"/>
214 </xsl:when>
Piotr Banski92791a22022-05-26 01:41:10 +0200215 <xsl:when
216 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])">
217 <xsl:sequence select="fn:false()"/>
218 <!-- the otherwise very costly check for preceding segs fires only if the first two are true, so it will have minimal search space -->
219 </xsl:when>
220 <xsl:when
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200221 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">
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200222 <xsl:sequence select="fn:false()"/>
223 </xsl:when>
Piotr Banski92791a22022-05-26 01:41:10 +0200224 <xsl:otherwise>
225 <xsl:sequence select="fn:true()"/>
226 </xsl:otherwise>
227 </xsl:choose>
228 </xsl:when>
229 <xsl:when test="local-name($node) eq 's'">
230 <xsl:choose>
231 <xsl:when test="exists($node/preceding-sibling::tei:s)">
232 <xsl:sequence select="fn:true()"/>
233 </xsl:when>
234 <xsl:otherwise>
235 <xsl:sequence
236 select="not($suppress_initial) and exists($node/ancestor::tei:p[1]/preceding-sibling::tei:p)"
237 />
238 </xsl:otherwise>
239 </xsl:choose>
240
241 </xsl:when>
242 <xsl:when test="local-name($node) eq 'p'">
243 <xsl:sequence select="exists($node/preceding-sibling::tei:p)"/>
244 </xsl:when>
245 <xsl:otherwise>
246 <xsl:message terminate="yes"
247 select="'Wrong argument passed to f:is_preceded_by_ws(): ' || local-name($node) || ' Only p, s, seg are allowed.'"
248 />
249 </xsl:otherwise>
250 </xsl:choose>
251 </xsl:function>
banspd1bf1db2022-04-04 02:16:24 +0200252
banspb5992532022-03-29 15:55:44 +0200253<!-- UTILITY TEMPLATES -->
254
bansp9103aab2022-03-19 05:10:21 +0100255 <xsl:template match="@default" mode="#all"/>
bansp97ba7ce2022-03-26 05:14:06 +0100256 <!-- this is to delete some auto-inserted attribute throughout -->
bansp9103aab2022-03-19 05:10:21 +0100257
banspb5992532022-03-29 15:55:44 +0200258 <!-- MAIN PROCESSING -->
259
bansp5e2d1c02022-03-10 04:51:40 +0100260 <xsl:template name="xsl:initial-template">
banspf2b24e62022-03-28 18:12:08 +0200261 <xsl:variable name="IDs_to_skip" select="tokenize($skip_docID,',')" as="xs:string*"/>
banspd1bf1db2022-04-04 02:16:24 +0200262
banspe726b4a2022-03-28 05:47:45 +0200263 <!-- 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 +0200264 because all we need is the main corpus header, and we can (should) get to that from any NKJP corpus document -->
265 <xsl:call-template name="create_corpus_header">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200266 <xsl:with-param name="text.doc" select="$collection_of_text[1]" as="document-node()"/>
bansp8f6700b2022-03-27 05:27:09 +0200267 <xsl:with-param name="target" select="$targetCorpusDir_slashed || 'header.xml'" as="xs:string"/>
268 </xsl:call-template>
269
banspe726b4a2022-03-28 05:47:45 +0200270 <xsl:for-each select="$collection_of_text">
271 <xsl:variable name="my_dir" as="xs:string" select="replace(base-uri(),'/text\.xml','')"/>
272 <xsl:variable name="my_textID" as="xs:string" select="tokenize($my_dir,'/')[last()]"/>
273 <xsl:variable name="ann_morphosyntax.uri" select="$my_dir || '/ann_morphosyntax.xml'" as="xs:string"/>
Piotr Banskic5950ce2022-05-27 15:07:08 +0200274 <xsl:variable name="ann_named.uri" select="$my_dir || '/ann_named.xml'" as="xs:string"/>
275 <xsl:variable name="ann_groups.uri" select="$my_dir || '/ann_groups.xml'" as="xs:string"/>
276 <xsl:variable name="ann_words.uri" select="$my_dir || '/ann_words.xml'" as="xs:string"/>
banspe726b4a2022-03-28 05:47:45 +0200277
banspf2b24e62022-03-28 18:12:08 +0200278 <xsl:choose>
279 <xsl:when test="$my_textID = $IDs_to_skip"/>
bansp9dc10002022-05-17 22:33:34 +0200280 <!-- 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 +0200281 <xsl:otherwise>
Piotr Banski381e0c02022-06-09 02:39:40 +0200282
283 <xsl:message select="'Processing ' || $my_textID"/>
banspd1bf1db2022-04-04 02:16:24 +0200284
bansp9dc10002022-05-17 22:33:34 +0200285 <xsl:call-template name="process_single_sample">
Piotr Banskif9590692022-06-02 15:39:48 +0200286 <xsl:with-param name="text.doc" as="document-node()" select="."/>
287 <xsl:with-param name="ann_morphosyntax.doc" as="document-node()"
banspf2b24e62022-03-28 18:12:08 +0200288 select="doc($ann_morphosyntax.uri)"/>
Piotr Banski081c5de2022-06-03 01:57:13 +0200289<!-- <xsl:with-param name="ann_segmentation.xml" as="document-node()"
290 select="doc($ann_segmentation.uri)"/>-->
banspf2b24e62022-03-28 18:12:08 +0200291 <xsl:with-param name="my_textID" select="$my_textID" as="xs:string"/>
Piotr Banskic5950ce2022-05-27 15:07:08 +0200292 <!-- the following parameters may happen to be null -->
Piotr Banskif9590692022-06-02 15:39:48 +0200293 <xsl:with-param name="ann_named.doc" as="document-node()*"
Piotr Banskic5950ce2022-05-27 15:07:08 +0200294 select="if(fn:doc-available($ann_named.uri)) then doc($ann_named.uri) else ()"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200295 <xsl:with-param name="ann_groups.doc" as="document-node()*"
Piotr Banskic5950ce2022-05-27 15:07:08 +0200296 select="if(fn:doc-available($ann_groups.uri)) then doc($ann_groups.uri) else ()"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200297 <xsl:with-param name="ann_words.doc" as="document-node()*"
Piotr Banskic5950ce2022-05-27 15:07:08 +0200298 select="if(fn:doc-available($ann_words.uri)) then doc($ann_words.uri) else ()"/>
299
bansp9dc10002022-05-17 22:33:34 +0200300 </xsl:call-template>
banspf2b24e62022-03-28 18:12:08 +0200301 </xsl:otherwise>
302 </xsl:choose>
banspe726b4a2022-03-28 05:47:45 +0200303 </xsl:for-each>
bansp8f6700b2022-03-27 05:27:09 +0200304 </xsl:template>
305
306 <xsl:template name="process_single_sample">
Piotr Banskif9590692022-06-02 15:39:48 +0200307 <xsl:param name="text.doc" as="document-node()"/>
308 <xsl:param name="ann_morphosyntax.doc" as="document-node()"/>
banspd1bf1db2022-04-04 02:16:24 +0200309 <xsl:param name="my_textID" as="xs:string" select="'0-BAD_textID'"/>
bansp9dc10002022-05-17 22:33:34 +0200310 <!-- 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 +0200311 <xsl:param name="ann_named.doc" as="document-node()*"/>
312 <xsl:param name="ann_groups.doc" as="document-node()*"/>
313 <xsl:param name="ann_words.doc" as="document-node()*"/>
banspe726b4a2022-03-28 05:47:45 +0200314
315 <xsl:variable name="targetBaseDir" as="xs:string" select="$targetCorpusDir_slashed || $docID || '/' || $my_textID"/>
316
317 <xsl:variable name="compoundID" as="xs:string"
318 select="$corpusID || '_' || $docID || '.' || $my_textID"/>
319 <!-- this is what occurs in the text and data layers as @docid -->
320
bansp5e2d1c02022-03-10 04:51:40 +0100321 <xsl:call-template name="create_data">
Piotr Banski081c5de2022-06-03 01:57:13 +0200322 <xsl:with-param name="ann_morphosyntax.doc" select="$ann_morphosyntax.doc" as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200323 <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/>
324 <xsl:with-param name="target" select="$targetBaseDir || '/data.xml'" as="xs:string"/>
bansp5f841732022-03-16 06:27:31 +0100325 </xsl:call-template>
326
Piotr Banski43b9db02022-06-03 02:38:42 +0200327 <xsl:call-template name="create_struct">
banspe726b4a2022-03-28 05:47:45 +0200328 <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/>
Piotr Banski43b9db02022-06-03 02:38:42 +0200329 <xsl:with-param name="ann_morphosyntax.doc" select="$ann_morphosyntax.doc"
bansp5f841732022-03-16 06:27:31 +0100330 as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200331 <xsl:with-param name="target" select="$targetBaseDir || '/struct/structure.xml'" as="xs:string"
bansp5f841732022-03-16 06:27:31 +0100332 />
Piotr Banski43b9db02022-06-03 02:38:42 +0200333 </xsl:call-template>
Piotr Banski92791a22022-05-26 01:41:10 +0200334
Piotr Banskiba6cc632022-06-03 14:07:33 +0200335 <xsl:call-template name="create_morpho">
banspe726b4a2022-03-28 05:47:45 +0200336 <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200337 <xsl:with-param name="ann_morphosyntax.doc" select="$ann_morphosyntax.doc"
bansp5f841732022-03-16 06:27:31 +0100338 as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200339 <xsl:with-param name="target" select="$targetBaseDir || '/nkjp/morpho.xml'" as="xs:string"/>
Piotr Banskiba6cc632022-06-03 14:07:33 +0200340 </xsl:call-template>
Piotr Banskia51907c2022-05-25 15:09:41 +0200341
Piotr Banskid2b78b82022-06-03 17:05:59 +0200342 <xsl:call-template name="create_text_header">
Piotr Banskif9590692022-06-02 15:39:48 +0200343 <xsl:with-param name="text.doc" select="$text.doc" as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200344 <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/>
345 <xsl:with-param name="target" select="$targetBaseDir || '/header.xml'" as="xs:string"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200346 </xsl:call-template>
Piotr Banski6a4a2522022-05-24 01:16:47 +0200347
Piotr Banskif9590692022-06-02 15:39:48 +0200348 <xsl:if test="$ann_named.doc">
Piotr Banski381e0c02022-06-09 02:39:40 +0200349 <xsl:variable name="rev_lookup-seq" as="map(*)*">
Piotr Banskib28e5882022-06-08 20:41:20 +0200350 <xsl:for-each select="$ann_named.doc//tei:seg/tei:ptr">
351 <xsl:variable name="trg" as="xs:string" select="fn:substring-before(@target, '#')"/>
352 <!-- caution: as of 01-June-2022, some of the pointers are malformed (missing '#' when referencing locally).
Piotr Banskid2b78b82022-06-03 17:05:59 +0200353 so we need to act around it but also sustainably - in case that error gets corrected -->
Piotr Banski763b41f2022-06-02 01:13:23 +0200354
Piotr Banskib28e5882022-06-08 20:41:20 +0200355 <xsl:if test="fn:string-length($trg) and $trg eq 'ann_morphosyntax.xml'">
Piotr Banski763b41f2022-06-02 01:13:23 +0200356 <xsl:sequence>
357 <xsl:map-entry key="fn:substring-after(fn:string(@target), '#')" select="fn:current()"
358 />
359 </xsl:sequence>
Piotr Banskib28e5882022-06-08 20:41:20 +0200360 </xsl:if>
361 </xsl:for-each>
Piotr Banski763b41f2022-06-02 01:13:23 +0200362 </xsl:variable>
Piotr Banskib28e5882022-06-08 20:41:20 +0200363 <xsl:variable name="rev_lookup" as="map(*)"
Piotr Banski381e0c02022-06-09 02:39:40 +0200364 select="if(count($rev_lookup-seq)) then map:merge($rev_lookup-seq, map {'duplicates': 'combine'}) else map{}"/>
Piotr Banskib28e5882022-06-08 20:41:20 +0200365
Piotr Banski381e0c02022-06-09 02:39:40 +0200366 <xsl:if test="map:size($rev_lookup)">
367 <xsl:call-template name="create_named">
368 <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/>
369 <xsl:with-param name="ann_morphosyntax.doc" select="$ann_morphosyntax.doc"
370 as="document-node()"/>
371 <xsl:with-param name="ann_named.doc" select="$ann_named.doc" as="document-node()"/>
372 <xsl:with-param name="target" select="$targetBaseDir || '/nkjp/named.xml'" as="xs:string"/>
373 <xsl:with-param name="rev_lookup" select="$rev_lookup" as="map(*)"/>
374 </xsl:call-template>
375 </xsl:if>
Piotr Banskic5950ce2022-05-27 15:07:08 +0200376 </xsl:if>
Piotr Banskid2b78b82022-06-03 17:05:59 +0200377
Piotr Banskib28e5882022-06-08 20:41:20 +0200378<!-- <xsl:if test="$ann_words.doc and $ann_groups.doc">
Piotr Banskic5950ce2022-05-27 15:07:08 +0200379 <xsl:call-template name="create_groups">
380 <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200381 <xsl:with-param name="ann_morphosyntax.doc" select="$ann_morphosyntax.doc"
Piotr Banskic5950ce2022-05-27 15:07:08 +0200382 as="document-node()"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200383 <xsl:with-param name="ann_words.doc" select="$ann_words.doc"
Piotr Banskic5950ce2022-05-27 15:07:08 +0200384 as="document-node()"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200385 <xsl:with-param name="ann_groups.doc" select="$ann_groups.doc"
Piotr Banskic5950ce2022-05-27 15:07:08 +0200386 as="document-node()"/>
387 <xsl:with-param name="target" select="$targetBaseDir || '/nkjp/groups.xml'" as="xs:string"/>
388 </xsl:call-template>
Piotr Banskib28e5882022-06-08 20:41:20 +0200389 </xsl:if>-->
Piotr Banskic5950ce2022-05-27 15:07:08 +0200390
bansp5e2d1c02022-03-10 04:51:40 +0100391 </xsl:template>
392
393 <!-- ************************** data.xml ******************* -->
394
395 <xsl:template name="create_data">
Piotr Banski081c5de2022-06-03 01:57:13 +0200396 <xsl:param name="ann_morphosyntax.doc" as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200397 <xsl:param name="compoundID" as="xs:string"/>
bansp5f841732022-03-16 06:27:31 +0100398 <xsl:param name="target" as="xs:string"/>
bansp5e2d1c02022-03-10 04:51:40 +0100399 <!-- create the data.xml file -->
400 <xsl:result-document encoding="UTF-8" method="xml" indent="yes"
bansp5f841732022-03-16 06:27:31 +0100401 xpath-default-namespace="{$KorAP_namespace}" href="{$target}">
bansp5e2d1c02022-03-10 04:51:40 +0100402
Akron9a8ee3e2022-01-31 13:51:49 +0100403 <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 +0100404 <xsl:element name="raw_text" namespace="{$KorAP_namespace}">
bansp5f841732022-03-16 06:27:31 +0100405 <xsl:attribute name="docid" select="$compoundID"/>
bansp5e2d1c02022-03-10 04:51:40 +0100406 <xsl:element name="metadata" namespace="{$KorAP_namespace}">
407 <xsl:attribute name="file" select="'metadata.xml'"/>
408 </xsl:element>
409
410 <xsl:element name="text" namespace="{$KorAP_namespace}">
bansp9dc10002022-05-17 22:33:34 +0200411 <xsl:variable name="content" as="xs:string+">
Piotr Banski081c5de2022-06-03 01:57:13 +0200412 <xsl:for-each select="$ann_morphosyntax.doc/tei:teiCorpus/tei:TEI/tei:text/tei:body/tei:p/tei:s/tei:seg[tei:fs/tei:f[@name eq 'disamb']]">
bansp9dc10002022-05-17 22:33:34 +0200413 <xsl:sequence select="
Piotr Banskifdc858a2022-05-25 02:40:32 +0200414 if (f:is_preceded_by_ws(.,false())) then
bansp9dc10002022-05-17 22:33:34 +0200415 ' '
416 else
Piotr Banski081c5de2022-06-03 01:57:13 +0200417 '', ./tei:fs/tei:f[@name eq 'orth']/tei:string"/>
bansp9dc10002022-05-17 22:33:34 +0200418 </xsl:for-each>
419 </xsl:variable>
420 <xsl:value-of select="string-join($content)"/>
bansp5e2d1c02022-03-10 04:51:40 +0100421 </xsl:element>
Akron9a8ee3e2022-01-31 13:51:49 +0100422 </xsl:element>
banspf79443e2022-02-25 14:25:33 +0100423 </xsl:result-document>
Akron9a8ee3e2022-01-31 13:51:49 +0100424 </xsl:template>
425
bansp5f841732022-03-16 06:27:31 +0100426 <!-- ************************** struct ******************* -->
427
428 <xsl:template name="create_struct">
banspe726b4a2022-03-28 05:47:45 +0200429 <xsl:param name="compoundID" as="xs:string"/>
Piotr Banski43b9db02022-06-03 02:38:42 +0200430 <xsl:param name="ann_morphosyntax.doc" as="document-node()"/>
bansp5f841732022-03-16 06:27:31 +0100431 <xsl:param name="target" as="xs:string"/>
Piotr Banski4f4c2d22022-05-19 01:44:32 +0200432
bansp5f841732022-03-16 06:27:31 +0100433 <xsl:result-document encoding="UTF-8" method="xml" indent="yes"
434 xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}">
435 <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>
436 <xsl:element name="layer" namespace="{$KorAP_namespace}">
437 <xsl:attribute name="docid" select="$compoundID"/>
438 <xsl:attribute name="version" select="$KorAP-XML_version"/>
439
440 <xsl:element name="spanList" namespace="{$KorAP_namespace}">
Piotr Banski43b9db02022-06-03 02:38:42 +0200441 <xsl:apply-templates select="$ann_morphosyntax.doc/tei:teiCorpus/tei:TEI/tei:text" mode="struct"/>
bansp5f841732022-03-16 06:27:31 +0100442 </xsl:element>
443 </xsl:element>
444 </xsl:result-document>
445 </xsl:template>
446
Piotr Banski43b9db02022-06-03 02:38:42 +0200447 <xsl:template match="tei:text | tei:body | tei:p | tei:s | tei:seg[tei:fs/tei:f[@name eq 'disamb']]" mode="struct">
Piotr Banski09096ee2022-05-25 13:41:03 +0200448 <xsl:variable name="offsets" as="xs:integer+">
Piotr Banski43b9db02022-06-03 02:38:42 +0200449 <xsl:sequence select="map:get(fn:accumulator-after('morpho-offsets')[last()], string(@xml:id))"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200450 </xsl:variable>
Piotr Banski6a4a2522022-05-24 01:16:47 +0200451
bansp5f841732022-03-16 06:27:31 +0100452 <xsl:variable name="my_name" select="local-name()" as="xs:string"/>
Piotr Banskie1ac5202022-05-30 21:25:21 +0200453 <xsl:variable name="my_index" select="fn:accumulator-before('element-index')" as="xs:integer"/>
bansp3e5b20c2022-03-18 20:22:31 +0100454
bansp5f841732022-03-16 06:27:31 +0100455 <xsl:element name="span" namespace="{$KorAP_namespace}">
456 <xsl:attribute name="id" select="'s' || $my_index"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200457 <xsl:attribute name="from" select="$offsets[1]"/>
458 <xsl:attribute name="to" select="$offsets[2]"/>
bansp5f841732022-03-16 06:27:31 +0100459 <xsl:attribute name="l" select="f:compute_nesting(.)"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200460 <xsl:if test="local-name() eq 'seg' and $SHOW_ORTH_IN_STRUCT">
Piotr Banskid2b78b82022-06-03 17:05:59 +0200461 <xsl:comment select="
462 (if (tei:fs/tei:f[@name eq 'nps']) then
463 ' '
464 else
465 ' _') || tei:fs/tei:f[@name eq 'orth']/tei:string"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200466 </xsl:if>
bansp5f841732022-03-16 06:27:31 +0100467 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
Piotr Banskifdc858a2022-05-25 02:40:32 +0200468 <xsl:attribute name="type" select="'struct'"></xsl:attribute> <!-- STRUCT vs. LEX for morpho -->
bansp5f841732022-03-16 06:27:31 +0100469 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
bansp3e5b20c2022-03-18 20:22:31 +0100470 <xsl:attribute name="name" select="'name'"/>
471 <xsl:value-of select="local-name()"/>
bansp5f841732022-03-16 06:27:31 +0100472 </xsl:element>
473 <xsl:if test="count(@*)">
474 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
475 <xsl:attribute name="name" select="'attr'"/>
476 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
477 <xsl:attribute name="type" select="'attr'"/>
478 <xsl:for-each select="@*">
479 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
480 <xsl:attribute name="name" select="local-name(.)"/>
481 <xsl:value-of select="."/>
482 </xsl:element>
483 </xsl:for-each>
484 </xsl:element>
485 </xsl:element>
486 </xsl:if>
487 </xsl:element>
488 </xsl:element>
Piotr Banskia51907c2022-05-25 15:09:41 +0200489 <xsl:apply-templates mode="struct"/>
bansp5f841732022-03-16 06:27:31 +0100490 </xsl:template>
491
492 <!-- ************************** morpho ******************* -->
493
494 <xsl:template name="create_morpho">
banspe726b4a2022-03-28 05:47:45 +0200495 <xsl:param name="compoundID" as="xs:string"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200496 <xsl:param name="ann_morphosyntax.doc" as="document-node()"/>
bansp5f841732022-03-16 06:27:31 +0100497 <xsl:param name="target" as="xs:string"/>
498
499 <xsl:result-document encoding="UTF-8" method="xml" indent="yes"
500 xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}">
501 <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 +0100502 <xsl:element name="layer" namespace="{$KorAP_namespace}">
503 <xsl:attribute name="docid" select="$compoundID"/>
504 <xsl:attribute name="version" select="$KorAP-XML_version"/>
505
506 <xsl:element name="spanList" namespace="{$KorAP_namespace}">
Piotr Banskid2b78b82022-06-03 17:05:59 +0200507 <xsl:apply-templates select="$ann_morphosyntax.doc/tei:teiCorpus/tei:TEI/tei:text/tei:body/tei:p/tei:s/tei:seg" mode="morpho"/>
bansp3e5b20c2022-03-18 20:22:31 +0100508 </xsl:element>
509 </xsl:element>
bansp5f841732022-03-16 06:27:31 +0100510 </xsl:result-document>
511 </xsl:template>
512
Piotr Banskiba6cc632022-06-03 14:07:33 +0200513 <xsl:template match="tei:seg[tei:fs/tei:f[@name eq 'disamb']]" mode="morpho">
514
Piotr Banskia51907c2022-05-25 15:09:41 +0200515 <!-- it's so spread out because I wanted to make sure to be able to look up the individual
516 constituent values, should anything go wrong; it might get compacted at some point, but
517 the increase in efficiency will probably be minimal, compared to the decrease of readability -->
518 <xsl:variable name="offsets" as="xs:integer+">
Piotr Banskiba6cc632022-06-03 14:07:33 +0200519 <xsl:sequence select="map:get(fn:accumulator-after('morpho-offsets')[last()], string(@xml:id))"/>
Piotr Banskia51907c2022-05-25 15:09:41 +0200520 </xsl:variable>
Piotr Banskiba6cc632022-06-03 14:07:33 +0200521
Piotr Banskiba6cc632022-06-03 14:07:33 +0200522 <xsl:variable name="my_disamb" select="tei:fs/tei:f[@name eq 'disamb']" as="node()"/>
bansp3e5b20c2022-03-18 20:22:31 +0100523 <xsl:variable name="my_choice-id" select="substring-after($my_disamb//tei:f[@name eq 'choice']/@fVal,'#')" as="xs:string"/>
Piotr Banskiba6cc632022-06-03 14:07:33 +0200524 <xsl:variable name="my_choice-lex" select="tei:fs/tei:f[@name eq 'interps']/tei:fs[@type eq 'lex'][descendant::tei:symbol[@xml:id eq $my_choice-id]]" as="node()"/>
bansp3e5b20c2022-03-18 20:22:31 +0100525 <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 +0200526 <xsl:variable name="my_index" select="fn:accumulator-before('element-index')" as="xs:integer"/>
bansp3e5b20c2022-03-18 20:22:31 +0100527
bansp3e5b20c2022-03-18 20:22:31 +0100528 <xsl:element name="span" namespace="{$KorAP_namespace}">
Piotr Banskia51907c2022-05-25 15:09:41 +0200529 <xsl:attribute name="id" select="'m' || $my_index"/>
530 <xsl:attribute name="from" select="$offsets[1]"/>
531 <xsl:attribute name="to" select="$offsets[2]"/>
bansp3e5b20c2022-03-18 20:22:31 +0100532 <xsl:attribute name="l" select="f:compute_nesting(.)"/>
533 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
534 <xsl:attribute name="type" select="'lex'"/>
535 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
536 <xsl:attribute name="name" select="'lex'"/>
Piotr Banskid2b78b82022-06-03 17:05:59 +0200537 <xsl:if test="$SHOW_REDUNDANT_ORTH">
538 <xsl:comment select="
Piotr Banskiba6cc632022-06-03 14:07:33 +0200539 (if (tei:fs/tei:f[@name eq 'nps']) then
540 ' '
541 else
542 ' _') || tei:fs/tei:f[@name eq 'orth']/tei:string"/>
Piotr Banskid2b78b82022-06-03 17:05:59 +0200543 </xsl:if>
bansp3e5b20c2022-03-18 20:22:31 +0100544 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
bansp3e5b20c2022-03-18 20:22:31 +0100545 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
Piotr Banskia44cd7a2022-06-03 19:19:50 +0200546 <xsl:attribute name="name" select="'orig'"/>
547 <xsl:value-of select="tei:fs/tei:f[@name eq 'orth']/tei:string"/>
548 </xsl:element>
549 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
bansp3e5b20c2022-03-18 20:22:31 +0100550 <xsl:attribute name="name" select="'lemma'"/>
551 <xsl:value-of select="$my_choice-lex/tei:f[@name eq 'base']/tei:string"/>
552 </xsl:element>
553 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
554 <xsl:attribute name="name" select="'pos'"/>
555 <xsl:value-of select="$my_choice-lex/tei:f[@name eq 'ctag']/tei:symbol/@value"/>
556 </xsl:element>
557 <xsl:if test="string-length($chosen-msd)">
558 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
559 <xsl:attribute name="name" select="'msd'"/>
560 <xsl:value-of select="$chosen-msd"/>
561 </xsl:element>
562 </xsl:if>
Piotr Banskiba6cc632022-06-03 14:07:33 +0200563 <xsl:if test="tei:fs/tei:f[@name eq 'nps']">
bansp3e5b20c2022-03-18 20:22:31 +0100564 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
565 <xsl:attribute name="name" select="'join'"/>
566 <xsl:value-of select="'left'"/>
567 </xsl:element>
568 </xsl:if>
569 </xsl:element>
570 </xsl:element>
Piotr Banskia44cd7a2022-06-03 19:19:50 +0200571 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
572 <xsl:attribute name="name" select="'interps'"/>
573 <xsl:for-each select="tei:fs/tei:f[@name eq 'interps']/tei:fs">
574 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
575 <xsl:attribute name="type" select="'alt'"/>
576 <xsl:if test="tei:f[@name eq 'msd']//tei:symbol/@xml:id = $my_choice-id">
577 <xsl:attribute name="n" select="'choice'"/>
578 </xsl:if>
579 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
580 <xsl:attribute name="name" select="'lemma'"/>
581 <xsl:value-of select="tei:f[@name eq 'base']/tei:string"/>
582 </xsl:element>
583 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
584 <xsl:attribute name="name" select="'pos'"/>
585 <xsl:value-of select="tei:f[@name eq 'ctag']/tei:symbol/@value"/>
586 </xsl:element>
587 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
588 <xsl:attribute name="name" select="'msd'"/>
589 <xsl:apply-templates select="tei:f[@name eq 'msd']/*" mode="inside-interps">
590 <xsl:with-param name="choice" select="$my_choice-id" as="xs:string" tunnel="yes"/>
591 </xsl:apply-templates>
592 </xsl:element>
593 </xsl:element>
594 </xsl:for-each>
595 </xsl:element>
bansp3e5b20c2022-03-18 20:22:31 +0100596 </xsl:element>
597 </xsl:element>
bansp3e5b20c2022-03-18 20:22:31 +0100598 </xsl:template>
banspe726b4a2022-03-28 05:47:45 +0200599
Piotr Banskia44cd7a2022-06-03 19:19:50 +0200600 <xsl:template match="tei:vAlt" mode="inside-interps">
601 <xsl:copy select="." copy-namespaces="no">
602 <xsl:apply-templates mode="inside-interps" select="*"/>
603 </xsl:copy>
604 </xsl:template>
605
606 <xsl:template match="tei:symbol" mode="inside-interps">
607 <xsl:param name="choice" as="xs:string" tunnel="yes"/>
608 <xsl:copy select="." copy-namespaces="no">
609 <xsl:attribute name="value" select="
610 if (@value eq '') then
611 0
612 else
613 @value"/>
614<!-- the check above is to appease the validator, which won't allow for empty values of @value -->
615 <xsl:if test="@xml:id eq $choice">
616 <xsl:attribute name="n" select="'choice'"/>
617 </xsl:if>
618 </xsl:copy>
619 </xsl:template>
620
Piotr Banskic5950ce2022-05-27 15:07:08 +0200621 <!-- ************************** named entities ******************* -->
622
623 <xsl:template name="create_named">
624 <xsl:param name="compoundID" as="xs:string"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200625 <xsl:param name="ann_morphosyntax.doc" as="document-node()"/>
626 <xsl:param name="ann_named.doc" as="document-node()"/>
Piotr Banskic5950ce2022-05-27 15:07:08 +0200627 <xsl:param name="target" as="xs:string"/>
Piotr Banski763b41f2022-06-02 01:13:23 +0200628 <xsl:param name="rev_lookup" as="map(*)"/>
629
Piotr Banskic5950ce2022-05-27 15:07:08 +0200630 <xsl:result-document encoding="UTF-8" method="xml" indent="yes"
631 xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}">
632 <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>
633 <xsl:element name="layer" namespace="{$KorAP_namespace}">
634 <xsl:attribute name="docid" select="$compoundID"/>
635 <xsl:attribute name="version" select="$KorAP-XML_version"/>
636
637 <xsl:element name="spanList" namespace="{$KorAP_namespace}">
Piotr Banskif9590692022-06-02 15:39:48 +0200638 <xsl:apply-templates select="$ann_morphosyntax.doc//tei:text" mode="named">
639 <xsl:with-param name="ann_named.doc" select="$ann_named.doc" as="document-node()" tunnel="yes"/>
Piotr Banski763b41f2022-06-02 01:13:23 +0200640 <xsl:with-param name="rev_lookup" select="$rev_lookup" as="map(*)" tunnel="yes"/>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200641 </xsl:apply-templates>
Piotr Banskic5950ce2022-05-27 15:07:08 +0200642 </xsl:element>
643 </xsl:element>
644 </xsl:result-document>
645 </xsl:template>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200646
647 <xsl:template match="tei:seg" mode="named"/>
648
649 <xsl:template match="tei:seg[tei:fs[tei:f[@name eq 'disamb']]]" mode="named">
Piotr Banskif9590692022-06-02 15:39:48 +0200650 <xsl:param name="ann_named.doc" as="document-node()" tunnel="yes"/>
Piotr Banski763b41f2022-06-02 01:13:23 +0200651 <xsl:param name="rev_lookup" as="map(*)" tunnel="yes"/>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200652
653 <xsl:variable name="offsets" as="xs:integer+">
654 <xsl:sequence select="map:get(fn:accumulator-after('morpho-offsets')[last()], string(@xml:id))"/>
655 </xsl:variable>
656
Piotr Banski763b41f2022-06-02 01:13:23 +0200657 <xsl:variable name="ptr" select="map:get($rev_lookup,fn:string(@xml:id))" as="element(tei:ptr)*"/>
Piotr Banskiad4b7ce2022-06-28 17:03:12 +0200658 <!-- it's an element, because we may need to see where it stands in a sequence... -->
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200659
Piotr Banski763b41f2022-06-02 01:13:23 +0200660 <xsl:if test="$ptr">
661 <xsl:variable name="my_id" select="@xml:id" as="xs:string"/>
662 <xsl:variable name="my_index" select="fn:accumulator-before('element-index')" as="xs:integer"/>
663
664 <xsl:element name="span" namespace="{$KorAP_namespace}">
665 <xsl:attribute name="id" select="'n' || $my_index"/>
666 <xsl:attribute name="from" select="$offsets[1]"/>
667 <xsl:attribute name="to" select="$offsets[2]"/>
668 <xsl:attribute name="l" select="f:compute_nesting(.)"/>
669 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
670 <xsl:attribute name="type" select="'ne'"/>
671 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
672 <xsl:attribute name="name" select="'ne'"/>
Piotr Banskid2b78b82022-06-03 17:05:59 +0200673 <xsl:if test="$SHOW_REDUNDANT_ORTH">
674 <xsl:comment select="
675 (if (tei:fs/tei:f[@name eq 'nps']) then
676 ' '
677 else
678 ' _') || tei:fs/tei:f[@name eq 'orth']/tei:string"/>
679 </xsl:if>
Piotr Banskiad4b7ce2022-06-28 17:03:12 +0200680
Piotr Banski763b41f2022-06-02 01:13:23 +0200681 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
Piotr Banskiad4b7ce2022-06-28 17:03:12 +0200682 <!-- typeless in the Ginkgo example that I used as a template -->
Piotr Banski763b41f2022-06-02 01:13:23 +0200683
Piotr Banskiad4b7ce2022-06-28 17:03:12 +0200684 <!-- assumption, theoretically falsifiable: NKJP NEs are in these cases identical.
685 Therefore, we process only the first one. -->
686 <xsl:for-each select="$ptr[1]/parent::tei:seg/tei:fs[1]/tei:f">
687 <xsl:if test="@name eq 'type' or @name eq 'subtype'">
688 <xsl:copy-of select="." copy-namespaces="no"/>
689 </xsl:if>
690 </xsl:for-each>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200691 </xsl:element>
692 </xsl:element>
Piotr Banskiad4b7ce2022-06-28 17:03:12 +0200693
694 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
695 <xsl:attribute name="name" select="'nkjp'"/>
696 <xsl:value-of select="$ptr[1]/parent::tei:seg/tei:fs[1]/tei:f[@name eq 'type']"/>
697
698 <xsl:for-each select="$ptr">
699 <xsl:copy-of select="parent::tei:seg/tei:fs[1]" copy-namespaces="no"/>
700 </xsl:for-each>
701 </xsl:element>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200702 </xsl:element>
703 </xsl:element>
Piotr Banski763b41f2022-06-02 01:13:23 +0200704 </xsl:if>
Piotr Banski65a6d0b2022-05-31 17:23:08 +0200705 </xsl:template>
706
Piotr Banskic5950ce2022-05-27 15:07:08 +0200707
708 <!-- ************************** syntactic chunks ******************* -->
709
710 <xsl:template name="create_groups">
711 <xsl:param name="compoundID" as="xs:string"/>
Piotr Banskif9590692022-06-02 15:39:48 +0200712 <xsl:param name="ann_morphosyntax.doc" as="document-node()"/>
713 <xsl:param name="ann_words.doc" as="document-node()"/>
714 <xsl:param name="ann_groups.doc" as="document-node()"/>
Piotr Banskic5950ce2022-05-27 15:07:08 +0200715 <xsl:param name="target" as="xs:string"/>
716
717 <xsl:result-document encoding="UTF-8" method="xml" indent="yes"
718 xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}">
719 <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>
720 <xsl:element name="layer" namespace="{$KorAP_namespace}">
721 <xsl:attribute name="docid" select="$compoundID"/>
722 <xsl:attribute name="version" select="$KorAP-XML_version"/>
723
724 <xsl:element name="spanList" namespace="{$KorAP_namespace}">
Piotr Banskid2b78b82022-06-03 17:05:59 +0200725 <!--<xsl:apply-templates select="$ann_morphosyntax.doc//tei:text" mode="groups">
Piotr Banskif9590692022-06-02 15:39:48 +0200726 <xsl:with-param name="ann_words.doc" select="$ann_words.doc" as="document-node()" tunnel="yes"/>
727 <xsl:with-param name="ann_groups.doc" select="$ann_groups.doc" as="document-node()" tunnel="yes"/>
Piotr Banskic5950ce2022-05-27 15:07:08 +0200728 </xsl:apply-templates>-->
729 </xsl:element>
730 </xsl:element>
731 </xsl:result-document>
732 </xsl:template>
733
bansp5f841732022-03-16 06:27:31 +0100734 <!-- ************************** TEXT header ******************* -->
735
736 <xsl:template name="create_text_header">
Piotr Banskif9590692022-06-02 15:39:48 +0200737 <xsl:param name="text.doc" as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200738 <xsl:param name="compoundID" as="xs:string"/>
bansp5f841732022-03-16 06:27:31 +0100739 <xsl:param name="target" as="xs:string"/>
740
741 <!-- create the local header.xml file -->
742 <xsl:result-document encoding="UTF-8" method="xml" indent="yes"
743 xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}">
744
745 <idsHeader type="document" pattern="text" status="new" version="1.1" TEIform="teiHeader">
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200746 <xsl:apply-templates select="$text.doc//tei:TEI/tei:teiHeader/tei:*" mode="text-header">
banspe726b4a2022-03-28 05:47:45 +0200747 <xsl:with-param name="compoundID" as="xs:string" select="$compoundID" tunnel="yes"/>
748 </xsl:apply-templates>
bansp5f841732022-03-16 06:27:31 +0100749 </idsHeader>
750 </xsl:result-document>
751 </xsl:template>
752
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200753 <xsl:template match="tei:fileDesc" mode="text-header">
bansp9103aab2022-03-19 05:10:21 +0100754 <xsl:element name="{local-name()}">
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200755 <xsl:apply-templates mode="text-header"/>
bansp9103aab2022-03-19 05:10:21 +0100756 </xsl:element>
bansp5f841732022-03-16 06:27:31 +0100757 </xsl:template>
758
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200759 <xsl:template match="tei:title" mode="text-header">
bansp5f841732022-03-16 06:27:31 +0100760 <t.title>
761 <xsl:apply-templates/>
762 </t.title>
763 </xsl:template>
764
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200765 <xsl:template match="tei:titleStmt" mode="text-header">
banspe726b4a2022-03-28 05:47:45 +0200766 <xsl:param name="compoundID" as="xs:string" tunnel="yes"/>
bansp5f841732022-03-16 06:27:31 +0100767 <titleStmt>
768 <textSigle>
banspe726b4a2022-03-28 05:47:45 +0200769 <xsl:value-of select="$compoundID"/>
bansp5f841732022-03-16 06:27:31 +0100770 </textSigle>
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200771 <xsl:apply-templates mode="text-header"/>
bansp5f841732022-03-16 06:27:31 +0100772 </titleStmt>
773 </xsl:template>
774
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200775 <xsl:template match="tei:publicationStmt" mode="text-header">
bansp9103aab2022-03-19 05:10:21 +0100776 <xsl:element name="{local-name()}">
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200777 <xsl:apply-templates mode="text-header"/>
bansp9103aab2022-03-19 05:10:21 +0100778 </xsl:element>
779 </xsl:template>
780
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200781 <xsl:template match="tei:availability" mode="text-header">
bansp9103aab2022-03-19 05:10:21 +0100782 <xsl:element name="{local-name()}">
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200783 <xsl:apply-templates mode="text-header" select="@* | *"/>
bansp9103aab2022-03-19 05:10:21 +0100784 </xsl:element>
785 </xsl:template>
786
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200787 <xsl:template match="tei:profileDesc" mode="text-header">
bansp9103aab2022-03-19 05:10:21 +0100788 <xsl:element name="{local-name()}">
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200789 <xsl:apply-templates mode="text-header"/>
bansp9103aab2022-03-19 05:10:21 +0100790 </xsl:element>
791 </xsl:template>
bansp5f841732022-03-16 06:27:31 +0100792
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200793 <xsl:template match="tei:textClass" mode="text-header">
bansp9103aab2022-03-19 05:10:21 +0100794 <xsl:element name="{local-name()}">
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200795 <xsl:apply-templates mode="text-header" select="@* | *"/>
bansp9103aab2022-03-19 05:10:21 +0100796 </xsl:element>
797 </xsl:template>
798
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200799 <xsl:template match="tei:catRef" mode="text-header corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100800 <xsl:element name="{local-name()}">
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200801 <xsl:apply-templates mode="text-header" select="@* | *"/>
bansp9103aab2022-03-19 05:10:21 +0100802 </xsl:element>
803 </xsl:template>
804
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200805 <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 +0100806 <xsl:copy-of select="."/>
807 </xsl:template>
808
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200809 <xsl:template match="tei:p" mode="text-header corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100810 <xsl:element name="{local-name()}">
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200811 <xsl:apply-templates mode="text_inside_header"/>
bansp9103aab2022-03-19 05:10:21 +0100812 </xsl:element>
813 </xsl:template>
814
815
816 <!-- OPTIMIZATION has to take modes into account -->
bansp5e2d1c02022-03-10 04:51:40 +0100817 <!-- ************************** CORPUS header ******************* -->
818 <xsl:template name="create_corpus_header">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200819 <xsl:param name="text.doc" as="document-node()"/>
bansp5f841732022-03-16 06:27:31 +0100820 <xsl:param name="target" as="xs:string"/>
bansp5e2d1c02022-03-10 04:51:40 +0100821
822 <!-- create the corpus-level header.xml file -->
bansp5f841732022-03-16 06:27:31 +0100823 <xsl:result-document encoding="UTF-8" method="xml" indent="yes" href="{$target}">
bansp5e2d1c02022-03-10 04:51:40 +0100824
825 <!--doctype-public="{$publicDoctypeI5}"
826 doctype-system="{$systemDoctypeI5}">
827 these are, sadly, useless
828 -->
829
830 <idsHeader type="corpus" pattern="text" status="new" version="1.1" TEIform="teiHeader">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200831 <xsl:apply-templates select="$text.doc/tei:teiCorpus/tei:teiHeader/tei:*" mode="corpus-header"/>
bansp5e2d1c02022-03-10 04:51:40 +0100832 </idsHeader>
833 </xsl:result-document>
834 </xsl:template>
835
Piotr Banskifaa910f2022-06-03 00:46:29 +0200836 <xsl:template match="tei:fileDesc" mode="corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100837 <xsl:element name="{local-name()}">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200838 <xsl:apply-templates mode="corpus-header"/>
bansp9103aab2022-03-19 05:10:21 +0100839 </xsl:element>
bansp5e2d1c02022-03-10 04:51:40 +0100840 </xsl:template>
bansp9103aab2022-03-19 05:10:21 +0100841
bansp5e2d1c02022-03-10 04:51:40 +0100842
Piotr Banskifaa910f2022-06-03 00:46:29 +0200843 <xsl:template match="tei:title" mode="corpus-header">
bansp5e2d1c02022-03-10 04:51:40 +0100844 <c.title>
Piotr Banskifaa910f2022-06-03 00:46:29 +0200845 <xsl:apply-templates mode="corpus-header" select="@*"/>
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200846 <xsl:apply-templates mode="text_inside_header"/>
bansp5e2d1c02022-03-10 04:51:40 +0100847 </c.title>
848 </xsl:template>
849
Piotr Banskifaa910f2022-06-03 00:46:29 +0200850 <xsl:template match="tei:titleStmt" mode="corpus-header">
bansp5e2d1c02022-03-10 04:51:40 +0100851 <titleStmt>
852 <korpusSigle>
853 <xsl:value-of select="$corpusID"/>
854 </korpusSigle>
Piotr Banskifaa910f2022-06-03 00:46:29 +0200855 <xsl:apply-templates mode="corpus-header"/>
bansp5e2d1c02022-03-10 04:51:40 +0100856 </titleStmt>
857 </xsl:template>
858
Piotr Banskifaa910f2022-06-03 00:46:29 +0200859 <xsl:template match="tei:publicationStmt" mode="corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100860 <xsl:element name="{local-name()}">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200861 <xsl:apply-templates mode="corpus-header"/>
bansp9103aab2022-03-19 05:10:21 +0100862 </xsl:element>
863 </xsl:template>
864
Piotr Banskifaa910f2022-06-03 00:46:29 +0200865 <xsl:template match="tei:availability" mode="corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100866 <xsl:element name="{local-name()}">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200867 <xsl:apply-templates mode="corpus-header" select="@* | *"/>
bansp9103aab2022-03-19 05:10:21 +0100868 </xsl:element>
869 </xsl:template>
870
Piotr Banskifaa910f2022-06-03 00:46:29 +0200871 <xsl:template match="tei:encodingDesc" mode="corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100872 <xsl:element name="{local-name()}">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200873 <xsl:apply-templates mode="corpus-header"/>
bansp9103aab2022-03-19 05:10:21 +0100874 </xsl:element>
875 </xsl:template>
876
Piotr Banskifaa910f2022-06-03 00:46:29 +0200877 <xsl:template match="tei:classDecl | tei:taxonomy | tei:category | tei:taxonomy/tei:bibl" mode="corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100878 <xsl:element name="{local-name()}">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200879 <xsl:apply-templates mode="corpus-header" select="@* | *"/>
bansp9103aab2022-03-19 05:10:21 +0100880 </xsl:element>
881 </xsl:template>
882
Piotr Banskifaa910f2022-06-03 00:46:29 +0200883 <xsl:template match="tei:bibl/tei:title | tei:edition | tei:desc" mode="corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100884 <xsl:element name="{local-name()}">
Piotr Banskifaa910f2022-06-03 00:46:29 +0200885 <xsl:apply-templates mode="corpus-header" select="@*"/>
Piotr Banskia0a9fc02022-06-03 01:20:18 +0200886 <xsl:apply-templates mode="text_inside_header"/>
bansp9103aab2022-03-19 05:10:21 +0100887 </xsl:element>
888 </xsl:template>
889<!--
Piotr Banskifaa910f2022-06-03 00:46:29 +0200890 <xsl:template match="tei:textClass" mode="corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100891 <xsl:element name="{local-name()}">
892 <xsl:apply-templates mode="corpus" select="@* | *"/>
893 </xsl:element>
894 </xsl:template>
895
Piotr Banskifaa910f2022-06-03 00:46:29 +0200896 <xsl:template match="tei:catRef" mode="corpus-header">
bansp9103aab2022-03-19 05:10:21 +0100897 <xsl:element name="{local-name()}">
898 <xsl:apply-templates mode="corpus" select="@* | *"/>
899 </xsl:element>
900 </xsl:template>
901-->
bansp5e2d1c02022-03-10 04:51:40 +0100902
903
904
905 <!-- this template can be called by the XSPEC test; TODO: find a way to call the main() template directly -->
906 <!-- I have not fully handled the param transmission, which would have to be kludged in just for the sake of XSPec,
907 because I'm disabling this for now, due to XSpec design issues; relevant links, a.o.:
908
909 https://stackoverflow.com/questions/64933277/what-is-the-cause-of-error-cannot-execute-xslresult-document-while-evaluating
910 https://www.balisage.net/Proceedings/vol25/html/Galtman01/BalisageVol25-Galtman01.html
911
912 In short: the internal design of XSpec forces kludges when one wants to use xsl:result-document in their stylesheets. But I don't
913 want to be strangled by kludges at the beginning of work, I've already lost quite a bit of time on this investigation,
914 I will therefore "just code" and then can think of externalizing bits of templates if we want to play with tests. For now,
915 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.
916
917 -->
918 <!--<xsl:template name="test_full">
919 <xsl:param name="corpusID"/>
920 <xsl:param name="docID"/>
921 <xsl:param name="textID"/>
922 <xsl:call-template name="xsl:initial-template"/>
923 </xsl:template>-->
924
Akron9a8ee3e2022-01-31 13:51:49 +0100925</xsl:stylesheet>
Piotr Banski6a4a2522022-05-24 01:16:47 +0200926
Piotr Banskifdc858a2022-05-25 02:40:32 +0200927<!-- template for serializing maps in messages <xsl:message select="('map:',serialize($map, map{'method':'adaptive'}))"/> -->