blob: 19d23a1cee81582c5d719d2debdfea1b81065a83 [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 Banski6a4a2522022-05-24 01:16:47 +02006 xmlns:map="http://www.w3.org/2005/xpath-functions/map" exclude-result-prefixes="xs f fn map nkjp tei"
bansp5e2d1c02022-03-10 04:51:40 +01007 version="3.0" expand-text="yes">
Akron9a8ee3e2022-01-31 13:51:49 +01008
banspe726b4a2022-03-28 05:47:45 +02009
10<!-- PARAMETERS -->
bansp5e2d1c02022-03-10 04:51:40 +010011
bansp8f6700b2022-03-27 05:27:09 +020012 <xsl:param name="sourceDir" select="'test/resources/nkjp2korap_sample2'" as="xs:string"/>
banspd1bf1db2022-04-04 02:16:24 +020013 <!-- the directory containing NKJP files, in the form of a collection of text-level dirs
14 (that is how we know both the $corpusID and the $docID) -->
Akron9a8ee3e2022-01-31 13:51:49 +010015
bansp8f6700b2022-03-27 05:27:09 +020016 <xsl:param name="targetDir" select="'test/output'" as="xs:string"/>
banspd1bf1db2022-04-04 02:16:24 +020017 <!-- where the corpus/document/text/annotations hierarchy is going to be created -->
banspf2b24e62022-03-28 18:12:08 +020018
19 <xsl:param name="skip_docID" as="xs:string">
banspb5992532022-03-29 15:55:44 +020020 <xsl:value-of select="'HellerPodgladanie,IsakowiczZaleskiMoje,KolakowskiOco,MysliwskiKamien,WilkWilczy,ZycieWarszawy_Zycie'"/>
21 </xsl:param>
22 <!-- comma-separated list of document IDs to be skipped from processing
banspf2b24e62022-03-28 18:12:08 +020023 example: HellerPodgladanie,KOT
banspd1bf1db2022-04-04 02:16:24 +020024 no functionality beyond string identity is supported
25 (this is just for testing) -->
banspb5992532022-03-29 15:55:44 +020026
Piotr Banskia51907c2022-05-25 15:09:41 +020027 <xsl:param name="SHOW_ORTH_IN_STRUCT" as="xs:boolean" select="false()"/>
Piotr Banski09096ee2022-05-25 13:41:03 +020028 <!-- for debugging structure.xml production -->
29
bansp8f6700b2022-03-27 05:27:09 +020030
bansp9dc10002022-05-17 22:33:34 +020031<!-- VARIABLES (= constants...) -->
banspe726b4a2022-03-28 05:47:45 +020032
33 <xsl:variable name="corpusID" as="xs:string" select="'NKJP'" static="yes"/>
34 <xsl:variable name="docID" as="xs:string" select="'NKJP'" static="yes"/>
bansp8f6700b2022-03-27 05:27:09 +020035
36 <xsl:variable name="targetCorpusDir_slashed" select="$targetDir || '/' || $corpusID || '/'" as="xs:string"/>
bansp5e2d1c02022-03-10 04:51:40 +010037
banspd1bf1db2022-04-04 02:16:24 +020038 <xsl:variable name="systemDoctypeI5" as="xs:string"
39 select="'http://corpora.ids-mannheim.de/I5/DTD/i5.dtd'" static="true"/>
bansp5e2d1c02022-03-10 04:51:40 +010040
banspd1bf1db2022-04-04 02:16:24 +020041 <xsl:variable name="publicDoctypeI5" as="xs:string" static="true"
42 select="'-//IDS//DTD I5 1.0//EN'"/>
bansp5e2d1c02022-03-10 04:51:40 +010043
banspd1bf1db2022-04-04 02:16:24 +020044 <xsl:variable name="KorAP_namespace" static="true" as="xs:string"
45 select="'http://ids-mannheim.de/ns/KorAP'"/>
bansp5e2d1c02022-03-10 04:51:40 +010046
bansp5f841732022-03-16 06:27:31 +010047 <xsl:variable name="KorAP-XML_version" select="'KorAP-0.4'" as="xs:string" static="true"/>
48 <!-- this is only a bit funny -->
49
banspe726b4a2022-03-28 05:47:45 +020050 <xsl:variable name="collection_params" as="xs:string" static="yes"
51 select="'recurse=yes;validation=strip;select=text.xml;content-type=application/xml;on-error=warning;xinclude=yes'"
52 />
53 <!-- see https://www.saxonica.com/documentation11/index.html#!sourcedocs/collections/collection-directories -->
54
55 <xsl:variable name="collection_of_text" select="collection($sourceDir || '?' || $collection_params)" as="document-node()+"/>
banspd1bf1db2022-04-04 02:16:24 +020056
banspe726b4a2022-03-28 05:47:45 +020057<!-- MODES -->
bansp5e2d1c02022-03-10 04:51:40 +010058
59 <xsl:mode name="corpus" on-no-match="deep-skip"/>
60 <xsl:mode name="text" on-no-match="deep-skip"/>
bansp9103aab2022-03-19 05:10:21 +010061 <xsl:mode name="header-text" on-no-match="text-only-copy"/>
Piotr Banski6a4a2522022-05-24 01:16:47 +020062 <xsl:mode use-accumulators="#all"/>
Piotr Banski09096ee2022-05-25 13:41:03 +020063
64 <xsl:accumulator name="element-index" as="xs:integer" initial-value="0">
65 <xsl:accumulator-rule match="tei:*[ancestor-or-self::tei:text]" select="$value + 1" phase="start"/>
66 </xsl:accumulator>
Piotr Banskifdc858a2022-05-25 02:40:32 +020067
68 <xsl:accumulator name="elem-offset-seq" as="map(xs:string, item()+)+" initial-value="(map{'null':(0,0)})">
69
70 <xsl:accumulator-rule match="tei:body/tei:p" phase="start">
71 <xsl:variable name="preceding_index" as="xs:integer">
72 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
73 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
Piotr Banski6a4a2522022-05-24 01:16:47 +020074 </xsl:variable>
75
Piotr Banskifdc858a2022-05-25 02:40:32 +020076 <xsl:variable name="our_base" as="xs:integer" select="if($preceding_index eq 0) then $preceding_index else $preceding_index + 1"/>
77 <!-- for paragraphs, it's in either being initial or not -->
Piotr Banski09096ee2022-05-25 13:41:03 +020078
Piotr Banskifdc858a2022-05-25 02:40:32 +020079 <xsl:sequence select="
80 $value,
81 map {
82 string(@xml:id): ($preceding_index,$our_base)
83 }"/>
84 </xsl:accumulator-rule>
85
86 <xsl:accumulator-rule match="tei:s" phase="start">
87 <xsl:variable name="preceding_index" as="xs:integer">
88 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
89 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
Piotr Banskifdc858a2022-05-25 02:40:32 +020090 </xsl:variable>
Piotr Banskifdc858a2022-05-25 02:40:32 +020091 <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 +020092
Piotr Banskifdc858a2022-05-25 02:40:32 +020093 <xsl:sequence select="
94 $value,
95 map {
96 string(@xml:id): ($preceding_index,$our_base)
97 }"/>
98 </xsl:accumulator-rule>
99
100 <xsl:accumulator-rule match="tei:w[parent::tei:seg[count(@nkjp:rejected) eq 0]]" phase="end">
101 <xsl:variable name="preceding_index" as="xs:integer">
102 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
103 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
Piotr Banskifdc858a2022-05-25 02:40:32 +0200104 </xsl:variable>
105 <xsl:variable name="our_base" as="xs:integer" select="$preceding_index + xs:integer(f:is_preceded_by_ws(parent::tei:seg,true()))"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200106
Piotr Banski6a4a2522022-05-24 01:16:47 +0200107 <xsl:sequence select="
108 $value,
109 map {
Piotr Banski69f3c5f2022-05-24 10:52:09 +0200110 string(parent::tei:seg/@xml:id): ($our_base,$our_base + string-length())
Piotr Banski6a4a2522022-05-24 01:16:47 +0200111 }"/>
112 </xsl:accumulator-rule>
Piotr Banskifdc858a2022-05-25 02:40:32 +0200113
114 <xsl:accumulator-rule match="tei:s" phase="end">
115 <xsl:variable name="preceding_index" as="xs:integer">
116 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
117 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200118
Piotr Banskifdc858a2022-05-25 02:40:32 +0200119 </xsl:variable>
120 <xsl:variable name="our_base" as="xs:integer">
121 <xsl:variable name="incomplete" select="map:find($value,string(@xml:id))(1)" as="xs:integer+"/>
122 <xsl:sequence select="$incomplete[2]"/>
123 </xsl:variable>
Piotr Banski09096ee2022-05-25 13:41:03 +0200124
Piotr Banskifdc858a2022-05-25 02:40:32 +0200125 <xsl:sequence select="
126 $value,
127 map {
128 string(@xml:id): ($our_base,$preceding_index)
129 }"/>
130 </xsl:accumulator-rule>
131
132 <xsl:accumulator-rule match="tei:body/tei:p" phase="end">
133 <xsl:variable name="preceding_index" as="xs:integer">
134 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
135 <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/>
136
Piotr Banskifdc858a2022-05-25 02:40:32 +0200137 </xsl:variable>
138 <xsl:variable name="our_base" as="xs:integer">
139 <xsl:variable name="incomplete" select="map:find($value,string(@xml:id))(1)" as="xs:integer+"/>
140 <xsl:sequence select="$incomplete[2]"/>
141 </xsl:variable>
Piotr Banski09096ee2022-05-25 13:41:03 +0200142
Piotr Banskifdc858a2022-05-25 02:40:32 +0200143 <xsl:sequence select="
144 $value,
145 map {
146 string(@xml:id): ($our_base,$preceding_index)
147 }"/>
148 </xsl:accumulator-rule>
149
150 <xsl:accumulator-rule match="tei:body" phase="end">
151 <xsl:variable name="preceding_index" as="xs:integer">
152 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
153 <xsl:sequence select="map:get($the_tail, map:keys($the_tail)[1])[2]"/>
154 </xsl:variable>
155
156 <xsl:sequence select="
157 $value,
158 map {
159 string(@xml:id): (0, $preceding_index)
160 }"/>
161 </xsl:accumulator-rule>
162
163 <xsl:accumulator-rule match="tei:text" phase="end">
164 <xsl:variable name="preceding_index" as="xs:integer">
165 <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/>
166 <xsl:sequence select="map:get($the_tail, map:keys($the_tail)[1])[2]"/>
167 </xsl:variable>
168
169 <xsl:sequence select="
170 $value,
171 map {
172 string(@xml:id): (0, $preceding_index)
173 }"/>
174 </xsl:accumulator-rule>
Piotr Banski6a4a2522022-05-24 01:16:47 +0200175 </xsl:accumulator>
bansp5e2d1c02022-03-10 04:51:40 +0100176
banspe726b4a2022-03-28 05:47:45 +0200177 <!-- FUNCTIONS -->
178
bansp5f841732022-03-16 06:27:31 +0100179 <xsl:function name="f:compute_nesting" as="xs:integer">
banspd1bf1db2022-04-04 02:16:24 +0200180 <xsl:param name="node" as="element()"/>
bansp5f841732022-03-16 06:27:31 +0100181 <xsl:variable name="rel_depth"
182 select="count($node/ancestor-or-self::*[local-name(.) ne 'TEI'][local-name(.) ne 'teiCorpus'])"
183 as="xs:integer"/>
bansp5f841732022-03-16 06:27:31 +0100184 <xsl:sequence select="$rel_depth"/>
185 </xsl:function>
186
bansp9dc10002022-05-17 22:33:34 +0200187<xsl:function name="f:is_preceded_by_ws" as="xs:boolean">
188 <xsl:param name="node" as="element()"/>
Piotr Banskifdc858a2022-05-25 02:40:32 +0200189 <xsl:param name="suppress_initial" as="xs:boolean"/>
bansp9dc10002022-05-17 22:33:34 +0200190 <xsl:choose>
Piotr Banskifdc858a2022-05-25 02:40:32 +0200191 <xsl:when test="local-name($node) eq 'seg'">
192 <xsl:choose>
193 <xsl:when test="$node/@nkjp:nps"><xsl:sequence select="fn:false()"/></xsl:when>
Piotr Banski09096ee2022-05-25 13:41:03 +0200194 <xsl:when test="$node/preceding::tei:seg[count(@nkjp:rejected) eq 0][ancestor::tei:s[descendant::tei:seg = $node]]"><xsl:sequence select="fn:true()"/></xsl:when>
195 <!-- this is checking if we're preceding by a seg under the same tei:s, modulo choice/paren -->
196 <!-- THIS CHECK should be streamlined for efficiency, maybe try comparing positions in the descendant axis -->
Piotr Banskifdc858a2022-05-25 02:40:32 +0200197 <xsl:otherwise>
198 <xsl:sequence
199 select="not($suppress_initial) and not($node[count(preceding-sibling::tei:seg) eq 0]/ancestor::tei:s[count(preceding-sibling::tei:s) eq 0]/ancestor::tei:p[count(preceding-sibling::tei:p) eq 0])"
200 />
201 </xsl:otherwise>
202 </xsl:choose>
Piotr Banski4f4c2d22022-05-19 01:44:32 +0200203
bansp9dc10002022-05-17 22:33:34 +0200204 </xsl:when>
205 <xsl:when test="local-name($node) eq 's'">
Piotr Banskifdc858a2022-05-25 02:40:32 +0200206 <xsl:choose>
207 <xsl:when test="exists($node/preceding-sibling::tei:s)"><xsl:sequence select="fn:true()"/></xsl:when>
208 <xsl:otherwise>
Piotr Banskifdc858a2022-05-25 02:40:32 +0200209 <xsl:sequence select="not($suppress_initial) and exists($node/ancestor::tei:p[1]/preceding-sibling::tei:p)"/>
210 </xsl:otherwise>
211 </xsl:choose>
bansp9dc10002022-05-17 22:33:34 +0200212
bansp9dc10002022-05-17 22:33:34 +0200213 </xsl:when>
214 <xsl:when test="local-name($node) eq 'p'">
bansp9dc10002022-05-17 22:33:34 +0200215 <xsl:sequence select="exists($node/preceding-sibling::tei:p)"/>
216 </xsl:when>
217 <xsl:otherwise>
218 <xsl:message terminate="yes" select="'Wrong argument passed to f:is_preceded_by_ws(): ' || local-name($node) || ' Only p, s, seg are allowed.'"></xsl:message>
219 </xsl:otherwise>
220 </xsl:choose>
221</xsl:function>
banspd1bf1db2022-04-04 02:16:24 +0200222
banspb5992532022-03-29 15:55:44 +0200223<!-- UTILITY TEMPLATES -->
224
bansp9103aab2022-03-19 05:10:21 +0100225 <xsl:template match="@default" mode="#all"/>
bansp97ba7ce2022-03-26 05:14:06 +0100226 <!-- this is to delete some auto-inserted attribute throughout -->
bansp9103aab2022-03-19 05:10:21 +0100227
Piotr Banski6a4a2522022-05-24 01:16:47 +0200228 <xsl:template match="tei:w" mode="#all"/>
banspe726b4a2022-03-28 05:47:45 +0200229<!-- NKJP-SGJP has apparently resigned from standoff representations by adding <w> everywhere;
Piotr Banskifdc858a2022-05-25 02:40:32 +0200230 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 +0200231
Piotr Banski09096ee2022-05-25 13:41:03 +0200232 <!-- fall-thru, skipping the potential <paren> element and filtering out the bad guys -->
Piotr Banski6a4a2522022-05-24 01:16:47 +0200233 <xsl:template match="tei:choice" mode="struct">
Piotr Banski09096ee2022-05-25 13:41:03 +0200234 <xsl:apply-templates select="descendant::tei:seg[count(@nkjp:rejected) eq 0]" mode="struct"/>
Piotr Banski6a4a2522022-05-24 01:16:47 +0200235 </xsl:template>
Piotr Banskia51907c2022-05-25 15:09:41 +0200236 <xsl:template match="tei:choice" mode="morpho">
237 <xsl:apply-templates select="descendant::tei:seg[count(@nkjp:rejected) eq 0]" mode="morpho"/>
238 </xsl:template>
banspb5992532022-03-29 15:55:44 +0200239
240 <!-- MAIN PROCESSING -->
241
bansp5e2d1c02022-03-10 04:51:40 +0100242 <xsl:template name="xsl:initial-template">
banspf2b24e62022-03-28 18:12:08 +0200243 <xsl:variable name="IDs_to_skip" select="tokenize($skip_docID,',')" as="xs:string*"/>
banspd1bf1db2022-04-04 02:16:24 +0200244
banspe726b4a2022-03-28 05:47:45 +0200245 <!-- 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 +0200246 because all we need is the main corpus header, and we can (should) get to that from any NKJP corpus document -->
247 <xsl:call-template name="create_corpus_header">
banspe726b4a2022-03-28 05:47:45 +0200248 <xsl:with-param name="text.xml" select="$collection_of_text[1]" as="document-node()"/>
bansp8f6700b2022-03-27 05:27:09 +0200249 <xsl:with-param name="target" select="$targetCorpusDir_slashed || 'header.xml'" as="xs:string"/>
250 </xsl:call-template>
251
banspe726b4a2022-03-28 05:47:45 +0200252 <xsl:for-each select="$collection_of_text">
253 <xsl:variable name="my_dir" as="xs:string" select="replace(base-uri(),'/text\.xml','')"/>
254 <xsl:variable name="my_textID" as="xs:string" select="tokenize($my_dir,'/')[last()]"/>
255 <xsl:variable name="ann_morphosyntax.uri" select="$my_dir || '/ann_morphosyntax.xml'" as="xs:string"/>
256 <xsl:variable name="ann_segmentation.uri" select="$my_dir || '/ann_segmentation.xml'" as="xs:string"/>
257
banspf2b24e62022-03-28 18:12:08 +0200258 <xsl:choose>
259 <xsl:when test="$my_textID = $IDs_to_skip"/>
bansp9dc10002022-05-17 22:33:34 +0200260 <!-- 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 +0200261 <xsl:otherwise>
banspd1bf1db2022-04-04 02:16:24 +0200262
bansp9dc10002022-05-17 22:33:34 +0200263 <xsl:call-template name="process_single_sample">
banspf2b24e62022-03-28 18:12:08 +0200264 <xsl:with-param name="text.xml" as="document-node()" select="."/>
265 <xsl:with-param name="ann_morphosyntax.xml" as="document-node()"
266 select="doc($ann_morphosyntax.uri)"/>
267 <xsl:with-param name="ann_segmentation.xml" as="document-node()"
268 select="doc($ann_segmentation.uri)"/>
269 <xsl:with-param name="my_textID" select="$my_textID" as="xs:string"/>
bansp9dc10002022-05-17 22:33:34 +0200270 </xsl:call-template>
banspf2b24e62022-03-28 18:12:08 +0200271 </xsl:otherwise>
272 </xsl:choose>
banspe726b4a2022-03-28 05:47:45 +0200273 </xsl:for-each>
bansp8f6700b2022-03-27 05:27:09 +0200274 </xsl:template>
275
276 <xsl:template name="process_single_sample">
banspe726b4a2022-03-28 05:47:45 +0200277 <xsl:param name="text.xml" as="document-node()"/>
278 <xsl:param name="ann_morphosyntax.xml" as="document-node()"/>
279 <xsl:param name="ann_segmentation.xml" as="document-node()"/>
banspd1bf1db2022-04-04 02:16:24 +0200280 <xsl:param name="my_textID" as="xs:string" select="'0-BAD_textID'"/>
bansp9dc10002022-05-17 22:33:34 +0200281 <!-- empty textID should never happen, but if it does, it will be signalled at the top of the output -->
banspe726b4a2022-03-28 05:47:45 +0200282
283 <xsl:variable name="targetBaseDir" as="xs:string" select="$targetCorpusDir_slashed || $docID || '/' || $my_textID"/>
284
285 <xsl:variable name="compoundID" as="xs:string"
286 select="$corpusID || '_' || $docID || '.' || $my_textID"/>
287 <!-- this is what occurs in the text and data layers as @docid -->
288
bansp5e2d1c02022-03-10 04:51:40 +0100289 <xsl:call-template name="create_data">
bansp9dc10002022-05-17 22:33:34 +0200290 <xsl:with-param name="ann_segmentation.xml" select="$ann_segmentation.xml" as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200291 <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/>
292 <xsl:with-param name="target" select="$targetBaseDir || '/data.xml'" as="xs:string"/>
bansp5f841732022-03-16 06:27:31 +0100293 </xsl:call-template>
294
Piotr Banski4f4c2d22022-05-19 01:44:32 +0200295 <xsl:call-template name="create_struct">
banspe726b4a2022-03-28 05:47:45 +0200296 <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/>
bansp5f841732022-03-16 06:27:31 +0100297 <xsl:with-param name="ann_segmentation.xml" select="$ann_segmentation.xml"
298 as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200299 <xsl:with-param name="target" select="$targetBaseDir || '/struct/structure.xml'" as="xs:string"
bansp5f841732022-03-16 06:27:31 +0100300 />
301 </xsl:call-template>
Piotr Banski4f4c2d22022-05-19 01:44:32 +0200302
Piotr Banskia51907c2022-05-25 15:09:41 +0200303 <xsl:call-template name="create_morpho">
banspe726b4a2022-03-28 05:47:45 +0200304 <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/>
bansp3e5b20c2022-03-18 20:22:31 +0100305 <xsl:with-param name="ann_segmentation.xml" select="$ann_segmentation.xml"
306 as="document-node()"/>
bansp5f841732022-03-16 06:27:31 +0100307 <xsl:with-param name="ann_morphosyntax.xml" select="$ann_morphosyntax.xml"
308 as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200309 <xsl:with-param name="target" select="$targetBaseDir || '/nkjp/morpho.xml'" as="xs:string"/>
bansp5e2d1c02022-03-10 04:51:40 +0100310 </xsl:call-template>
Piotr Banskia51907c2022-05-25 15:09:41 +0200311
Piotr Banski09096ee2022-05-25 13:41:03 +0200312 <xsl:call-template name="create_text_header">
bansp5e2d1c02022-03-10 04:51:40 +0100313 <xsl:with-param name="text.xml" select="$text.xml" as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200314 <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/>
315 <xsl:with-param name="target" select="$targetBaseDir || '/header.xml'" as="xs:string"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200316 </xsl:call-template>
Piotr Banski6a4a2522022-05-24 01:16:47 +0200317
bansp5e2d1c02022-03-10 04:51:40 +0100318 </xsl:template>
319
320 <!-- ************************** data.xml ******************* -->
321
322 <xsl:template name="create_data">
bansp9dc10002022-05-17 22:33:34 +0200323 <xsl:param name="ann_segmentation.xml" as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200324 <xsl:param name="compoundID" as="xs:string"/>
bansp5f841732022-03-16 06:27:31 +0100325 <xsl:param name="target" as="xs:string"/>
bansp5e2d1c02022-03-10 04:51:40 +0100326 <!-- create the data.xml file -->
327 <xsl:result-document encoding="UTF-8" method="xml" indent="yes"
bansp5f841732022-03-16 06:27:31 +0100328 xpath-default-namespace="{$KorAP_namespace}" href="{$target}">
bansp5e2d1c02022-03-10 04:51:40 +0100329
Akron9a8ee3e2022-01-31 13:51:49 +0100330 <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 +0100331 <xsl:element name="raw_text" namespace="{$KorAP_namespace}">
bansp5f841732022-03-16 06:27:31 +0100332 <xsl:attribute name="docid" select="$compoundID"/>
bansp5e2d1c02022-03-10 04:51:40 +0100333 <xsl:element name="metadata" namespace="{$KorAP_namespace}">
334 <xsl:attribute name="file" select="'metadata.xml'"/>
335 </xsl:element>
336
337 <xsl:element name="text" namespace="{$KorAP_namespace}">
bansp9dc10002022-05-17 22:33:34 +0200338 <xsl:variable name="content" as="xs:string+">
Piotr Banski4f4c2d22022-05-19 01:44:32 +0200339 <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 +0200340 <xsl:sequence select="
Piotr Banskifdc858a2022-05-25 02:40:32 +0200341 if (f:is_preceded_by_ws(.,false())) then
bansp9dc10002022-05-17 22:33:34 +0200342 ' '
343 else
344 '', ./tei:w"/>
345 </xsl:for-each>
346 </xsl:variable>
347 <xsl:value-of select="string-join($content)"/>
bansp5e2d1c02022-03-10 04:51:40 +0100348 </xsl:element>
Akron9a8ee3e2022-01-31 13:51:49 +0100349 </xsl:element>
banspf79443e2022-02-25 14:25:33 +0100350 </xsl:result-document>
Akron9a8ee3e2022-01-31 13:51:49 +0100351 </xsl:template>
352
bansp5f841732022-03-16 06:27:31 +0100353 <!-- ************************** struct ******************* -->
354
355 <xsl:template name="create_struct">
banspe726b4a2022-03-28 05:47:45 +0200356 <xsl:param name="compoundID" as="xs:string"/>
bansp5f841732022-03-16 06:27:31 +0100357 <xsl:param name="ann_segmentation.xml" as="document-node()"/>
358 <xsl:param name="target" as="xs:string"/>
Piotr Banski4f4c2d22022-05-19 01:44:32 +0200359
bansp5f841732022-03-16 06:27:31 +0100360 <xsl:result-document encoding="UTF-8" method="xml" indent="yes"
361 xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}">
362 <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>
363 <xsl:element name="layer" namespace="{$KorAP_namespace}">
364 <xsl:attribute name="docid" select="$compoundID"/>
365 <xsl:attribute name="version" select="$KorAP-XML_version"/>
366
367 <xsl:element name="spanList" namespace="{$KorAP_namespace}">
Piotr Banski09096ee2022-05-25 13:41:03 +0200368 <xsl:apply-templates select="$ann_segmentation.xml//tei:text" mode="struct"/>
bansp5f841732022-03-16 06:27:31 +0100369 </xsl:element>
370 </xsl:element>
371 </xsl:result-document>
372 </xsl:template>
373
374 <xsl:template match="tei:*" mode="struct">
Piotr Banski09096ee2022-05-25 13:41:03 +0200375 <xsl:variable name="offsets" as="xs:integer+">
376 <xsl:variable name="akku"
377 select="map:merge(tail(fn:accumulator-after('elem-offset-seq')), map {'duplicates': 'use-last'})"
378 as="map(xs:string,xs:integer+)"/> <!--test later if the merger is really needed here, given how accus work-->
379 <xsl:sequence select="map:get($akku, string(@xml:id))"/>
380 </xsl:variable>
Piotr Banski6a4a2522022-05-24 01:16:47 +0200381
bansp5f841732022-03-16 06:27:31 +0100382 <xsl:variable name="my_name" select="local-name()" as="xs:string"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200383 <xsl:variable name="my_index" select="fn:accumulator-before('element-index')" as="xs:integer"/>
bansp3e5b20c2022-03-18 20:22:31 +0100384
bansp5f841732022-03-16 06:27:31 +0100385 <xsl:element name="span" namespace="{$KorAP_namespace}">
386 <xsl:attribute name="id" select="'s' || $my_index"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200387 <xsl:attribute name="from" select="$offsets[1]"/>
388 <xsl:attribute name="to" select="$offsets[2]"/>
bansp5f841732022-03-16 06:27:31 +0100389 <xsl:attribute name="l" select="f:compute_nesting(.)"/>
Piotr Banski09096ee2022-05-25 13:41:03 +0200390 <xsl:if test="local-name() eq 'seg' and $SHOW_ORTH_IN_STRUCT">
391 <xsl:comment><xsl:value-of select="fn:normalize-space(.)"/></xsl:comment>
392 </xsl:if>
bansp5f841732022-03-16 06:27:31 +0100393 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
Piotr Banskifdc858a2022-05-25 02:40:32 +0200394 <xsl:attribute name="type" select="'struct'"></xsl:attribute> <!-- STRUCT vs. LEX for morpho -->
bansp5f841732022-03-16 06:27:31 +0100395 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
bansp3e5b20c2022-03-18 20:22:31 +0100396 <xsl:attribute name="name" select="'name'"/>
397 <xsl:value-of select="local-name()"/>
bansp5f841732022-03-16 06:27:31 +0100398 </xsl:element>
399 <xsl:if test="count(@*)">
400 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
401 <xsl:attribute name="name" select="'attr'"/>
402 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
403 <xsl:attribute name="type" select="'attr'"/>
404 <xsl:for-each select="@*">
405 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
406 <xsl:attribute name="name" select="local-name(.)"/>
407 <xsl:value-of select="."/>
408 </xsl:element>
409 </xsl:for-each>
410 </xsl:element>
411 </xsl:element>
412 </xsl:if>
413 </xsl:element>
414 </xsl:element>
Piotr Banskia51907c2022-05-25 15:09:41 +0200415 <xsl:apply-templates mode="struct"/>
bansp5f841732022-03-16 06:27:31 +0100416 </xsl:template>
417
418 <!-- ************************** morpho ******************* -->
419
420 <xsl:template name="create_morpho">
banspe726b4a2022-03-28 05:47:45 +0200421 <xsl:param name="compoundID" as="xs:string"/>
bansp3e5b20c2022-03-18 20:22:31 +0100422 <xsl:param name="ann_segmentation.xml" as="document-node()"/>
bansp5f841732022-03-16 06:27:31 +0100423 <xsl:param name="ann_morphosyntax.xml" as="document-node()"/>
424 <xsl:param name="target" as="xs:string"/>
425
426 <xsl:result-document encoding="UTF-8" method="xml" indent="yes"
427 xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}">
428 <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 +0100429 <xsl:element name="layer" namespace="{$KorAP_namespace}">
430 <xsl:attribute name="docid" select="$compoundID"/>
431 <xsl:attribute name="version" select="$KorAP-XML_version"/>
432
433 <xsl:element name="spanList" namespace="{$KorAP_namespace}">
434 <xsl:apply-templates select="$ann_segmentation.xml//tei:text" mode="morpho">
Piotr Banskia51907c2022-05-25 15:09:41 +0200435 <xsl:with-param name="ann_morphosyntax.xml" select="$ann_morphosyntax.xml" as="document-node()" tunnel="yes"/>
bansp3e5b20c2022-03-18 20:22:31 +0100436 </xsl:apply-templates>
437 </xsl:element>
438 </xsl:element>
bansp5f841732022-03-16 06:27:31 +0100439 </xsl:result-document>
440 </xsl:template>
441
bansp3e5b20c2022-03-18 20:22:31 +0100442 <xsl:template match="tei:seg" mode="morpho">
Piotr Banskia51907c2022-05-25 15:09:41 +0200443 <xsl:param name="ann_morphosyntax.xml" as="document-node()" tunnel="yes"/>
444 <!-- it's so spread out because I wanted to make sure to be able to look up the individual
445 constituent values, should anything go wrong; it might get compacted at some point, but
446 the increase in efficiency will probably be minimal, compared to the decrease of readability -->
447 <xsl:variable name="offsets" as="xs:integer+">
448 <xsl:variable name="akku"
449 select="map:merge(tail(fn:accumulator-after('elem-offset-seq')), map {'duplicates': 'use-last'})"
450 as="map(xs:string,xs:integer+)"/> <!--test later if the merger is really needed here, given how accus work-->
451 <xsl:sequence select="map:get($akku, string(@xml:id))"/>
452 </xsl:variable>
bansp3e5b20c2022-03-18 20:22:31 +0100453 <xsl:variable name="my_name" select="local-name()" as="xs:string"/>
454 <xsl:variable name="my_id" select="@xml:id" as="xs:string"/>
455 <xsl:variable name="my_morph-seg" as="node()" select="$ann_morphosyntax.xml//tei:seg[substring-after(@corresp,'#') eq $my_id]"/>
456 <xsl:variable name="my_disamb" select="$my_morph-seg//tei:fs/tei:f[@name eq 'disamb']" as="node()"/>
457 <xsl:variable name="my_choice-id" select="substring-after($my_disamb//tei:f[@name eq 'choice']/@fVal,'#')" as="xs:string"/>
458 <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()"/>
459 <xsl:variable name="chosen-msd" as="xs:string" select="$my_choice-lex/descendant::tei:symbol[@xml:id eq $my_choice-id]/@value"/>
Piotr Banskia51907c2022-05-25 15:09:41 +0200460 <xsl:variable name="my_index" select="fn:accumulator-before('element-index')" as="xs:integer"/>
bansp3e5b20c2022-03-18 20:22:31 +0100461
bansp3e5b20c2022-03-18 20:22:31 +0100462 <xsl:element name="span" namespace="{$KorAP_namespace}">
Piotr Banskia51907c2022-05-25 15:09:41 +0200463 <xsl:attribute name="id" select="'m' || $my_index"/>
464 <xsl:attribute name="from" select="$offsets[1]"/>
465 <xsl:attribute name="to" select="$offsets[2]"/>
bansp3e5b20c2022-03-18 20:22:31 +0100466 <xsl:attribute name="l" select="f:compute_nesting(.)"/>
467 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
468 <xsl:attribute name="type" select="'lex'"/>
469 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
470 <xsl:attribute name="name" select="'lex'"/>
471 <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
472 <xsl:comment select="$my_morph-seg//tei:fs/tei:f[@name eq 'orth']/tei:string"/>
Piotr Banskia51907c2022-05-25 15:09:41 +0200473
bansp3e5b20c2022-03-18 20:22:31 +0100474 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
475 <xsl:attribute name="name" select="'lemma'"/>
476 <xsl:value-of select="$my_choice-lex/tei:f[@name eq 'base']/tei:string"/>
477 </xsl:element>
478 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
479 <xsl:attribute name="name" select="'pos'"/>
480 <xsl:value-of select="$my_choice-lex/tei:f[@name eq 'ctag']/tei:symbol/@value"/>
481 </xsl:element>
482 <xsl:if test="string-length($chosen-msd)">
483 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
484 <xsl:attribute name="name" select="'msd'"/>
485 <xsl:value-of select="$chosen-msd"/>
486 </xsl:element>
487 </xsl:if>
488 <xsl:if test="$my_morph-seg//tei:fs/tei:f[@name eq 'nps']">
489 <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
490 <xsl:attribute name="name" select="'join'"/>
491 <xsl:value-of select="'left'"/>
492 </xsl:element>
493 </xsl:if>
494 </xsl:element>
495 </xsl:element>
496 </xsl:element>
497 </xsl:element>
Piotr Banskia51907c2022-05-25 15:09:41 +0200498 <!--<xsl:apply-templates mode="morpho">
bansp3e5b20c2022-03-18 20:22:31 +0100499 <xsl:with-param name="ann_morphosyntax.xml" select="$ann_morphosyntax.xml" as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200500 </xsl:apply-templates>-->
bansp3e5b20c2022-03-18 20:22:31 +0100501 </xsl:template>
banspe726b4a2022-03-28 05:47:45 +0200502
bansp5f841732022-03-16 06:27:31 +0100503 <!-- ************************** TEXT header ******************* -->
504
505 <xsl:template name="create_text_header">
506 <xsl:param name="text.xml" as="document-node()"/>
banspe726b4a2022-03-28 05:47:45 +0200507 <xsl:param name="compoundID" as="xs:string"/>
bansp5f841732022-03-16 06:27:31 +0100508 <xsl:param name="target" as="xs:string"/>
509
510 <!-- create the local header.xml file -->
511 <xsl:result-document encoding="UTF-8" method="xml" indent="yes"
512 xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}">
513
514 <idsHeader type="document" pattern="text" status="new" version="1.1" TEIform="teiHeader">
banspe726b4a2022-03-28 05:47:45 +0200515 <xsl:apply-templates select="$text.xml//tei:TEI/tei:teiHeader/tei:*" mode="text">
516 <xsl:with-param name="compoundID" as="xs:string" select="$compoundID" tunnel="yes"/>
517 </xsl:apply-templates>
bansp5f841732022-03-16 06:27:31 +0100518 </idsHeader>
519 </xsl:result-document>
520 </xsl:template>
521
522 <xsl:template match="tei:fileDesc" mode="text">
bansp9103aab2022-03-19 05:10:21 +0100523 <xsl:element name="{local-name()}">
bansp5f841732022-03-16 06:27:31 +0100524 <xsl:apply-templates mode="text"/>
bansp9103aab2022-03-19 05:10:21 +0100525 </xsl:element>
bansp5f841732022-03-16 06:27:31 +0100526 </xsl:template>
527
528 <xsl:template match="tei:title" mode="text">
529 <t.title>
530 <xsl:apply-templates/>
531 </t.title>
532 </xsl:template>
533
534 <xsl:template match="tei:titleStmt" mode="text">
banspe726b4a2022-03-28 05:47:45 +0200535 <xsl:param name="compoundID" as="xs:string" tunnel="yes"/>
bansp5f841732022-03-16 06:27:31 +0100536 <titleStmt>
537 <textSigle>
banspe726b4a2022-03-28 05:47:45 +0200538 <xsl:value-of select="$compoundID"/>
bansp5f841732022-03-16 06:27:31 +0100539 </textSigle>
540 <xsl:apply-templates mode="text"/>
541 </titleStmt>
542 </xsl:template>
543
bansp9103aab2022-03-19 05:10:21 +0100544 <xsl:template match="tei:publicationStmt" mode="text">
545 <xsl:element name="{local-name()}">
546 <xsl:apply-templates mode="text"/>
547 </xsl:element>
548 </xsl:template>
549
550 <xsl:template match="tei:availability" mode="text">
551 <xsl:element name="{local-name()}">
552 <xsl:apply-templates mode="text" select="@* | *"/>
553 </xsl:element>
554 </xsl:template>
555
556 <xsl:template match="tei:profileDesc" mode="text">
557 <xsl:element name="{local-name()}">
558 <xsl:apply-templates mode="text"/>
559 </xsl:element>
560 </xsl:template>
bansp5f841732022-03-16 06:27:31 +0100561
bansp9103aab2022-03-19 05:10:21 +0100562 <xsl:template match="tei:textClass" mode="text">
563 <xsl:element name="{local-name()}">
564 <xsl:apply-templates mode="text" select="@* | *"/>
565 </xsl:element>
566 </xsl:template>
567
568 <xsl:template match="tei:catRef" mode="text corpus">
569 <xsl:element name="{local-name()}">
570 <xsl:apply-templates mode="text" select="@* | *"/>
571 </xsl:element>
572 </xsl:template>
573
574 <xsl:template match="@status | @scheme | @target | @type | @xml:id[ancestor::tei:classDecl] | @xml:lang" mode="text corpus">
575 <xsl:copy-of select="."/>
576 </xsl:template>
577
578 <xsl:template match="tei:p" mode="text corpus">
579 <xsl:element name="{local-name()}">
580 <xsl:apply-templates mode="header-text"/>
581 </xsl:element>
582 </xsl:template>
583
584
585 <!-- OPTIMIZATION has to take modes into account -->
bansp5e2d1c02022-03-10 04:51:40 +0100586 <!-- ************************** CORPUS header ******************* -->
587 <xsl:template name="create_corpus_header">
588 <xsl:param name="text.xml" as="document-node()"/>
bansp5f841732022-03-16 06:27:31 +0100589 <xsl:param name="target" as="xs:string"/>
bansp5e2d1c02022-03-10 04:51:40 +0100590
591 <!-- create the corpus-level header.xml file -->
bansp5f841732022-03-16 06:27:31 +0100592 <xsl:result-document encoding="UTF-8" method="xml" indent="yes" href="{$target}">
bansp5e2d1c02022-03-10 04:51:40 +0100593
594 <!--doctype-public="{$publicDoctypeI5}"
595 doctype-system="{$systemDoctypeI5}">
596 these are, sadly, useless
597 -->
598
599 <idsHeader type="corpus" pattern="text" status="new" version="1.1" TEIform="teiHeader">
bansp9103aab2022-03-19 05:10:21 +0100600 <xsl:apply-templates select="$text.xml/tei:teiCorpus/tei:teiHeader/tei:*" mode="corpus"/>
bansp5e2d1c02022-03-10 04:51:40 +0100601 </idsHeader>
602 </xsl:result-document>
603 </xsl:template>
604
605 <xsl:template match="tei:fileDesc" mode="corpus">
bansp9103aab2022-03-19 05:10:21 +0100606 <xsl:element name="{local-name()}">
bansp5e2d1c02022-03-10 04:51:40 +0100607 <xsl:apply-templates mode="corpus"/>
bansp9103aab2022-03-19 05:10:21 +0100608 </xsl:element>
bansp5e2d1c02022-03-10 04:51:40 +0100609 </xsl:template>
bansp9103aab2022-03-19 05:10:21 +0100610
bansp5e2d1c02022-03-10 04:51:40 +0100611
612 <xsl:template match="tei:title" mode="corpus">
613 <c.title>
bansp9103aab2022-03-19 05:10:21 +0100614 <xsl:apply-templates mode="corpus" select="@*"/>
615 <xsl:apply-templates mode="header-text"/>
bansp5e2d1c02022-03-10 04:51:40 +0100616 </c.title>
617 </xsl:template>
618
619 <xsl:template match="tei:titleStmt" mode="corpus">
620 <titleStmt>
621 <korpusSigle>
622 <xsl:value-of select="$corpusID"/>
623 </korpusSigle>
624 <xsl:apply-templates mode="corpus"/>
625 </titleStmt>
626 </xsl:template>
627
bansp9103aab2022-03-19 05:10:21 +0100628 <xsl:template match="tei:publicationStmt" mode="corpus">
629 <xsl:element name="{local-name()}">
630 <xsl:apply-templates mode="corpus"/>
631 </xsl:element>
632 </xsl:template>
633
634 <xsl:template match="tei:availability" mode="corpus">
635 <xsl:element name="{local-name()}">
636 <xsl:apply-templates mode="corpus" select="@* | *"/>
637 </xsl:element>
638 </xsl:template>
639
640 <xsl:template match="tei:encodingDesc" mode="corpus">
641 <xsl:element name="{local-name()}">
642 <xsl:apply-templates mode="corpus"/>
643 </xsl:element>
644 </xsl:template>
645
646 <xsl:template match="tei:classDecl | tei:taxonomy | tei:category | tei:taxonomy/tei:bibl" mode="corpus">
647 <xsl:element name="{local-name()}">
648 <xsl:apply-templates mode="corpus" select="@* | *"/>
649 </xsl:element>
650 </xsl:template>
651
652 <xsl:template match="tei:bibl/tei:title | tei:edition | tei:desc" mode="corpus">
653 <xsl:element name="{local-name()}">
654 <xsl:apply-templates mode="corpus" select="@*"/>
655 <xsl:apply-templates mode="header-text"/>
656 </xsl:element>
657 </xsl:template>
658<!--
659 <xsl:template match="tei:textClass" mode="corpus">
660 <xsl:element name="{local-name()}">
661 <xsl:apply-templates mode="corpus" select="@* | *"/>
662 </xsl:element>
663 </xsl:template>
664
665 <xsl:template match="tei:catRef" mode="corpus">
666 <xsl:element name="{local-name()}">
667 <xsl:apply-templates mode="corpus" select="@* | *"/>
668 </xsl:element>
669 </xsl:template>
670-->
bansp5e2d1c02022-03-10 04:51:40 +0100671
672
673
674 <!-- this template can be called by the XSPEC test; TODO: find a way to call the main() template directly -->
675 <!-- I have not fully handled the param transmission, which would have to be kludged in just for the sake of XSPec,
676 because I'm disabling this for now, due to XSpec design issues; relevant links, a.o.:
677
678 https://stackoverflow.com/questions/64933277/what-is-the-cause-of-error-cannot-execute-xslresult-document-while-evaluating
679 https://www.balisage.net/Proceedings/vol25/html/Galtman01/BalisageVol25-Galtman01.html
680
681 In short: the internal design of XSpec forces kludges when one wants to use xsl:result-document in their stylesheets. But I don't
682 want to be strangled by kludges at the beginning of work, I've already lost quite a bit of time on this investigation,
683 I will therefore "just code" and then can think of externalizing bits of templates if we want to play with tests. For now,
684 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.
685
686 -->
687 <!--<xsl:template name="test_full">
688 <xsl:param name="corpusID"/>
689 <xsl:param name="docID"/>
690 <xsl:param name="textID"/>
691 <xsl:call-template name="xsl:initial-template"/>
692 </xsl:template>-->
693
Akron9a8ee3e2022-01-31 13:51:49 +0100694</xsl:stylesheet>
Piotr Banski6a4a2522022-05-24 01:16:47 +0200695
Piotr Banskifdc858a2022-05-25 02:40:32 +0200696<!-- template for serializing maps in messages <xsl:message select="('map:',serialize($map, map{'method':'adaptive'}))"/> -->