Akron | 9a8ee3e | 2022-01-31 13:51:49 +0100 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 3 | 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 Banski | f8af3a9 | 2022-05-23 03:20:10 +0200 | [diff] [blame] | 5 | xmlns:fn="http://www.w3.org/2005/xpath-functions" |
Piotr Banski | 763b41f | 2022-06-02 01:13:23 +0200 | [diff] [blame] | 6 | 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" |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 8 | version="3.0" expand-text="yes"> |
Akron | 9a8ee3e | 2022-01-31 13:51:49 +0100 | [diff] [blame] | 9 | |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 10 | |
| 11 | <!-- PARAMETERS --> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 12 | |
bansp | 8f6700b | 2022-03-27 05:27:09 +0200 | [diff] [blame] | 13 | <xsl:param name="sourceDir" select="'test/resources/nkjp2korap_sample2'" as="xs:string"/> |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 14 | <!-- 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) --> |
Akron | 9a8ee3e | 2022-01-31 13:51:49 +0100 | [diff] [blame] | 16 | |
bansp | 8f6700b | 2022-03-27 05:27:09 +0200 | [diff] [blame] | 17 | <xsl:param name="targetDir" select="'test/output'" as="xs:string"/> |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 18 | <!-- where the corpus/document/text/annotations hierarchy is going to be created --> |
bansp | f2b24e6 | 2022-03-28 18:12:08 +0200 | [diff] [blame] | 19 | |
| 20 | <xsl:param name="skip_docID" as="xs:string"> |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 21 | <!--<xsl:value-of select="''"/>--> |
| 22 | <xsl:value-of select="'HellerPodgladanie,IsakowiczZaleskiMoje,KolakowskiOco,MysliwskiKamien,WilkWilczy,ZycieWarszawy_Zycie'"/> |
bansp | b599253 | 2022-03-29 15:55:44 +0200 | [diff] [blame] | 23 | </xsl:param> |
| 24 | <!-- comma-separated list of document IDs to be skipped from processing |
bansp | f2b24e6 | 2022-03-28 18:12:08 +0200 | [diff] [blame] | 25 | example: HellerPodgladanie,KOT |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 26 | no functionality beyond string identity is supported |
| 27 | (this is just for testing) --> |
bansp | b599253 | 2022-03-29 15:55:44 +0200 | [diff] [blame] | 28 | |
Piotr Banski | 1ae16bd | 2022-05-25 15:59:40 +0200 | [diff] [blame] | 29 | <xsl:param name="SHOW_ORTH_IN_STRUCT" as="xs:boolean" select="true()"/> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame] | 30 | <!-- for debugging structure.xml production --> |
| 31 | |
bansp | 8f6700b | 2022-03-27 05:27:09 +0200 | [diff] [blame] | 32 | |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 33 | <!-- VARIABLES (= constants...) --> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 34 | |
| 35 | <xsl:variable name="corpusID" as="xs:string" select="'NKJP'" static="yes"/> |
| 36 | <xsl:variable name="docID" as="xs:string" select="'NKJP'" static="yes"/> |
bansp | 8f6700b | 2022-03-27 05:27:09 +0200 | [diff] [blame] | 37 | |
| 38 | <xsl:variable name="targetCorpusDir_slashed" select="$targetDir || '/' || $corpusID || '/'" as="xs:string"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 39 | |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 40 | <xsl:variable name="systemDoctypeI5" as="xs:string" |
| 41 | select="'http://corpora.ids-mannheim.de/I5/DTD/i5.dtd'" static="true"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 42 | |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 43 | <xsl:variable name="publicDoctypeI5" as="xs:string" static="true" |
| 44 | select="'-//IDS//DTD I5 1.0//EN'"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 45 | |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 46 | <xsl:variable name="KorAP_namespace" static="true" as="xs:string" |
| 47 | select="'http://ids-mannheim.de/ns/KorAP'"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 48 | |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 49 | <xsl:variable name="KorAP-XML_version" select="'KorAP-0.4'" as="xs:string" static="true"/> |
| 50 | <!-- this is only a bit funny --> |
| 51 | |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 52 | <xsl:variable name="collection_params" as="xs:string" static="yes" |
| 53 | select="'recurse=yes;validation=strip;select=text.xml;content-type=application/xml;on-error=warning;xinclude=yes'" |
| 54 | /> |
| 55 | <!-- see https://www.saxonica.com/documentation11/index.html#!sourcedocs/collections/collection-directories --> |
| 56 | |
| 57 | <xsl:variable name="collection_of_text" select="collection($sourceDir || '?' || $collection_params)" as="document-node()+"/> |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 58 | |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 59 | <!-- MODES --> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 60 | |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 61 | <xsl:mode name="corpus-header" on-no-match="deep-skip"/> |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 62 | <xsl:mode name="text-header" on-no-match="deep-skip"/> |
| 63 | <xsl:mode name="text_inside_header" on-no-match="text-only-copy"/> |
Piotr Banski | 763b41f | 2022-06-02 01:13:23 +0200 | [diff] [blame] | 64 | <xsl:mode name="copy" on-no-match="shallow-copy"/> |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 65 | <xsl:mode use-accumulators="#all"/> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame] | 66 | |
Piotr Banski | e1ac520 | 2022-05-30 21:25:21 +0200 | [diff] [blame] | 67 | <xsl:accumulator name="element-index" as="xs:integer" initial-value="0"> |
| 68 | <xsl:accumulator-rule match="tei:*[ancestor-or-self::tei:text]" select="$value + 1" phase="start"/> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame] | 69 | </xsl:accumulator> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 70 | |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 71 | |
| 72 | |
| 73 | <!--I think I may be able to actually merge the two accumulators, but let's see--> |
| 74 | <xsl:accumulator name="morpho-offsets" as="map(xs:string, item()+)+" initial-value="(map{'null':(0,0)})"> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 75 | |
| 76 | <xsl:accumulator-rule match="tei:body/tei:p" phase="start"> |
| 77 | <xsl:variable name="preceding_index" as="xs:integer"> |
| 78 | <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/> |
| 79 | <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/> |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 80 | </xsl:variable> |
| 81 | |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 82 | <xsl:variable name="our_base" as="xs:integer" select="if($preceding_index eq 0) then $preceding_index else $preceding_index + 1"/> |
| 83 | <!-- for paragraphs, it's in either being initial or not --> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame] | 84 | |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 85 | <xsl:sequence select=" |
| 86 | $value, |
| 87 | map { |
| 88 | string(@xml:id): ($preceding_index,$our_base) |
| 89 | }"/> |
| 90 | </xsl:accumulator-rule> |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 91 | <!-- this is morpho-offsets --> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 92 | <xsl:accumulator-rule match="tei:s" phase="start"> |
| 93 | <xsl:variable name="preceding_index" as="xs:integer"> |
| 94 | <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/> |
| 95 | <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 96 | </xsl:variable> |
Piotr Banski | 92791a2 | 2022-05-26 01:41:10 +0200 | [diff] [blame] | 97 | <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 Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame] | 98 | |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 99 | <xsl:sequence select=" |
| 100 | $value, |
| 101 | map { |
| 102 | string(@xml:id): ($preceding_index,$our_base) |
| 103 | }"/> |
| 104 | </xsl:accumulator-rule> |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 105 | <!-- this is morpho-offsets --> |
| 106 | |
| 107 | <!-- I want something that won't be matched in other layers, for efficiency - that |
| 108 | may allow me to merge the accumulators, eventually; |
| 109 | but I also want to filter out the rejected tokenization alternatives already here --> |
| 110 | <xsl:accumulator-rule match="tei:seg[tei:fs[@type eq 'morph' and tei:f[@name eq 'disamb']]]" phase="end"> |
| 111 | |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 112 | <xsl:variable name="preceding_index" as="xs:integer"> |
| 113 | <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/> |
| 114 | <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 115 | </xsl:variable> |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 116 | <xsl:variable name="our_base" as="xs:integer" select="$preceding_index + xs:integer(f:is_preceded_by_ws(.,true()))"/> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame] | 117 | |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 118 | <xsl:sequence select=" |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 119 | $value, |
| 120 | map { |
| 121 | string(@xml:id): ($our_base,$our_base + string-length(tei:fs/tei:f[@name eq 'orth']/tei:string)) |
| 122 | }"/> |
| 123 | |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 124 | </xsl:accumulator-rule> |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 125 | <!-- this is morpho-offsets --> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 126 | <xsl:accumulator-rule match="tei:s" phase="end"> |
| 127 | <xsl:variable name="preceding_index" as="xs:integer"> |
| 128 | <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/> |
| 129 | <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame] | 130 | |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 131 | </xsl:variable> |
| 132 | <xsl:variable name="our_base" as="xs:integer"> |
| 133 | <xsl:variable name="incomplete" select="map:find($value,string(@xml:id))(1)" as="xs:integer+"/> |
| 134 | <xsl:sequence select="$incomplete[2]"/> |
| 135 | </xsl:variable> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame] | 136 | |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 137 | <xsl:sequence select=" |
| 138 | $value, |
| 139 | map { |
| 140 | string(@xml:id): ($our_base,$preceding_index) |
| 141 | }"/> |
| 142 | </xsl:accumulator-rule> |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 143 | <!-- this is morpho-offsets --> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 144 | <xsl:accumulator-rule match="tei:body/tei:p" phase="end"> |
| 145 | <xsl:variable name="preceding_index" as="xs:integer"> |
| 146 | <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/> |
| 147 | <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/> |
| 148 | |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 149 | </xsl:variable> |
| 150 | <xsl:variable name="our_base" as="xs:integer"> |
| 151 | <xsl:variable name="incomplete" select="map:find($value,string(@xml:id))(1)" as="xs:integer+"/> |
| 152 | <xsl:sequence select="$incomplete[2]"/> |
| 153 | </xsl:variable> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame] | 154 | |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 155 | <xsl:sequence select=" |
| 156 | $value, |
| 157 | map { |
| 158 | string(@xml:id): ($our_base,$preceding_index) |
| 159 | }"/> |
| 160 | </xsl:accumulator-rule> |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 161 | </xsl:accumulator> |
| 162 | |
| 163 | |
| 164 | |
| 165 | <xsl:accumulator name="segmentation-offsets" as="map(xs:string, item()+)+" initial-value="(map{'null':(0,0)})"> |
| 166 | |
| 167 | <xsl:accumulator-rule match="tei:body/tei:p" phase="start"> |
| 168 | <xsl:variable name="preceding_index" as="xs:integer"> |
| 169 | <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/> |
| 170 | <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/> |
| 171 | </xsl:variable> |
| 172 | |
| 173 | <xsl:variable name="our_base" as="xs:integer" select="if($preceding_index eq 0) then $preceding_index else $preceding_index + 1"/> |
| 174 | <!-- for paragraphs, it's in either being initial or not --> |
| 175 | |
| 176 | <xsl:sequence select=" |
| 177 | $value, |
| 178 | map { |
| 179 | string(@xml:id): ($preceding_index,$our_base) |
| 180 | }"/> |
| 181 | </xsl:accumulator-rule> |
| 182 | |
| 183 | <xsl:accumulator-rule match="tei:s" phase="start"> |
| 184 | <xsl:variable name="preceding_index" as="xs:integer"> |
| 185 | <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/> |
| 186 | <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/> |
| 187 | </xsl:variable> |
| 188 | <xsl:variable name="our_base" as="xs:integer" select="if($preceding_index eq 0) then $preceding_index else $preceding_index + xs:integer(f:is_preceded_by_ws(.,true()))"/> |
| 189 | |
| 190 | <xsl:sequence select=" |
| 191 | $value, |
| 192 | map { |
| 193 | string(@xml:id): ($preceding_index,$our_base) |
| 194 | }"/> |
| 195 | </xsl:accumulator-rule> |
| 196 | |
| 197 | <xsl:accumulator-rule match="tei:w[parent::tei:seg[count(@nkjp:rejected) eq 0]]" phase="end"> |
| 198 | <xsl:variable name="preceding_index" as="xs:integer"> |
| 199 | <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/> |
| 200 | <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/> |
| 201 | </xsl:variable> |
| 202 | <xsl:variable name="our_base" as="xs:integer" select="$preceding_index + xs:integer(f:is_preceded_by_ws(parent::tei:seg,true()))"/> |
| 203 | |
| 204 | <xsl:sequence select=" |
| 205 | $value, |
| 206 | map { |
| 207 | string(parent::tei:seg/@xml:id): ($our_base,$our_base + string-length()) |
| 208 | }"/> |
| 209 | </xsl:accumulator-rule> |
| 210 | |
| 211 | <xsl:accumulator-rule match="tei:s" phase="end"> |
| 212 | <xsl:variable name="preceding_index" as="xs:integer"> |
| 213 | <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/> |
| 214 | <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/> |
| 215 | |
| 216 | </xsl:variable> |
| 217 | <xsl:variable name="our_base" as="xs:integer"> |
| 218 | <xsl:variable name="incomplete" select="map:find($value,string(@xml:id))(1)" as="xs:integer+"/> |
| 219 | <xsl:sequence select="$incomplete[2]"/> |
| 220 | </xsl:variable> |
| 221 | |
| 222 | <xsl:sequence select=" |
| 223 | $value, |
| 224 | map { |
| 225 | string(@xml:id): ($our_base,$preceding_index) |
| 226 | }"/> |
| 227 | </xsl:accumulator-rule> |
| 228 | |
| 229 | <xsl:accumulator-rule match="tei:body/tei:p" phase="end"> |
| 230 | <xsl:variable name="preceding_index" as="xs:integer"> |
| 231 | <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/> |
| 232 | <xsl:sequence select="map:get($the_tail,map:keys($the_tail)[1])[2]"/> |
| 233 | |
| 234 | </xsl:variable> |
| 235 | <xsl:variable name="our_base" as="xs:integer"> |
| 236 | <xsl:variable name="incomplete" select="map:find($value,string(@xml:id))(1)" as="xs:integer+"/> |
| 237 | <xsl:sequence select="$incomplete[2]"/> |
| 238 | </xsl:variable> |
| 239 | |
| 240 | <xsl:sequence select=" |
| 241 | $value, |
| 242 | map { |
| 243 | string(@xml:id): ($our_base,$preceding_index) |
| 244 | }"/> |
| 245 | </xsl:accumulator-rule> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 246 | |
| 247 | <xsl:accumulator-rule match="tei:body" phase="end"> |
| 248 | <xsl:variable name="preceding_index" as="xs:integer"> |
| 249 | <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/> |
| 250 | <xsl:sequence select="map:get($the_tail, map:keys($the_tail)[1])[2]"/> |
| 251 | </xsl:variable> |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 252 | |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 253 | <xsl:sequence select=" |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 254 | $value, |
| 255 | map { |
| 256 | string(@xml:id): (0, $preceding_index) |
| 257 | }"/> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 258 | </xsl:accumulator-rule> |
| 259 | |
| 260 | <xsl:accumulator-rule match="tei:text" phase="end"> |
| 261 | <xsl:variable name="preceding_index" as="xs:integer"> |
| 262 | <xsl:variable name="the_tail" as="map(*)" select="head(reverse($value))"/> |
| 263 | <xsl:sequence select="map:get($the_tail, map:keys($the_tail)[1])[2]"/> |
| 264 | </xsl:variable> |
| 265 | |
| 266 | <xsl:sequence select=" |
| 267 | $value, |
| 268 | map { |
| 269 | string(@xml:id): (0, $preceding_index) |
| 270 | }"/> |
| 271 | </xsl:accumulator-rule> |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 272 | </xsl:accumulator> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 273 | |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 274 | <!-- FUNCTIONS --> |
| 275 | |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 276 | <xsl:function name="f:compute_nesting" as="xs:integer"> |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 277 | <xsl:param name="node" as="element()"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 278 | <xsl:variable name="rel_depth" |
| 279 | select="count($node/ancestor-or-self::*[local-name(.) ne 'TEI'][local-name(.) ne 'teiCorpus'])" |
| 280 | as="xs:integer"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 281 | <xsl:sequence select="$rel_depth"/> |
| 282 | </xsl:function> |
| 283 | |
Piotr Banski | 92791a2 | 2022-05-26 01:41:10 +0200 | [diff] [blame] | 284 | <xsl:function name="f:is_preceded_by_ws" as="xs:boolean"> |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 285 | <xsl:param name="node" as="element()"/> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 286 | <xsl:param name="suppress_initial" as="xs:boolean"/> |
Piotr Banski | 4f4c2d2 | 2022-05-19 01:44:32 +0200 | [diff] [blame] | 287 | |
Piotr Banski | 92791a2 | 2022-05-26 01:41:10 +0200 | [diff] [blame] | 288 | <xsl:choose> |
| 289 | <xsl:when test="local-name($node) eq 'seg'"> |
| 290 | <xsl:choose> |
| 291 | <xsl:when test="$node/@nkjp:nps"> |
| 292 | <xsl:sequence select="fn:false()"/> |
| 293 | </xsl:when> |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 294 | <xsl:when test="$node/tei:fs/tei:f[@name eq 'nps']"> |
| 295 | <!--added for traversing ann_morphosyntax--> |
| 296 | <xsl:sequence select="fn:false()"/> |
| 297 | </xsl:when> |
Piotr Banski | 92791a2 | 2022-05-26 01:41:10 +0200 | [diff] [blame] | 298 | <xsl:when |
| 299 | test="$node/ancestor::tei:s[count(preceding-sibling::tei:s) eq 0] and $node/ancestor::tei:p[count(preceding-sibling::tei:p) eq 0] and not($node/preceding::tei:seg[count(@nkjp:rejected) eq 0])"> |
| 300 | <xsl:sequence select="fn:false()"/> |
| 301 | <!-- the otherwise very costly check for preceding segs fires only if the first two are true, so it will have minimal search space --> |
| 302 | </xsl:when> |
| 303 | <xsl:when |
| 304 | test="$suppress_initial and $node/ancestor::tei:s/descendant::tei:seg[count(@nkjp:rejected) eq 0][1]/@xml:id eq $node/@xml:id"> |
| 305 | <!-- I forget how node identity works now, so let me just compare the IDs --> |
| 306 | <xsl:sequence select="fn:false()"/> |
| 307 | </xsl:when> |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 308 | <xsl:when |
| 309 | test="$suppress_initial and $node/ancestor::tei:s/descendant::tei:seg[tei:fs/tei:f[@name eq 'disamb']][1]/@xml:id eq $node/@xml:id"> |
| 310 | <!--added for traversing ann_morphosyntax--> |
| 311 | <xsl:sequence select="fn:false()"/> |
| 312 | </xsl:when> |
Piotr Banski | 92791a2 | 2022-05-26 01:41:10 +0200 | [diff] [blame] | 313 | <xsl:otherwise> |
| 314 | <xsl:sequence select="fn:true()"/> |
| 315 | </xsl:otherwise> |
| 316 | </xsl:choose> |
| 317 | </xsl:when> |
| 318 | <xsl:when test="local-name($node) eq 's'"> |
| 319 | <xsl:choose> |
| 320 | <xsl:when test="exists($node/preceding-sibling::tei:s)"> |
| 321 | <xsl:sequence select="fn:true()"/> |
| 322 | </xsl:when> |
| 323 | <xsl:otherwise> |
| 324 | <xsl:sequence |
| 325 | select="not($suppress_initial) and exists($node/ancestor::tei:p[1]/preceding-sibling::tei:p)" |
| 326 | /> |
| 327 | </xsl:otherwise> |
| 328 | </xsl:choose> |
| 329 | |
| 330 | </xsl:when> |
| 331 | <xsl:when test="local-name($node) eq 'p'"> |
| 332 | <xsl:sequence select="exists($node/preceding-sibling::tei:p)"/> |
| 333 | </xsl:when> |
| 334 | <xsl:otherwise> |
| 335 | <xsl:message terminate="yes" |
| 336 | select="'Wrong argument passed to f:is_preceded_by_ws(): ' || local-name($node) || ' Only p, s, seg are allowed.'" |
| 337 | /> |
| 338 | </xsl:otherwise> |
| 339 | </xsl:choose> |
| 340 | </xsl:function> |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 341 | |
bansp | b599253 | 2022-03-29 15:55:44 +0200 | [diff] [blame] | 342 | <!-- UTILITY TEMPLATES --> |
| 343 | |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 344 | <xsl:template match="@default" mode="#all"/> |
bansp | 97ba7ce | 2022-03-26 05:14:06 +0100 | [diff] [blame] | 345 | <!-- this is to delete some auto-inserted attribute throughout --> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 346 | |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 347 | <xsl:template match="tei:w" mode="#all"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 348 | <!-- NKJP-SGJP has apparently resigned from standoff representations by adding <w> everywhere; |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 349 | we reach for them, but from the level of <seg>, so we don't need to process <w> separately --> |
bansp | 8f6700b | 2022-03-27 05:27:09 +0200 | [diff] [blame] | 350 | |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame] | 351 | <!-- fall-thru, skipping the potential <paren> element and filtering out the bad guys --> |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 352 | <xsl:template match="tei:choice" mode="struct"> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame] | 353 | <xsl:apply-templates select="descendant::tei:seg[count(@nkjp:rejected) eq 0]" mode="struct"/> |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 354 | </xsl:template> |
Piotr Banski | a51907c | 2022-05-25 15:09:41 +0200 | [diff] [blame] | 355 | <xsl:template match="tei:choice" mode="morpho"> |
| 356 | <xsl:apply-templates select="descendant::tei:seg[count(@nkjp:rejected) eq 0]" mode="morpho"/> |
| 357 | </xsl:template> |
bansp | b599253 | 2022-03-29 15:55:44 +0200 | [diff] [blame] | 358 | |
| 359 | <!-- MAIN PROCESSING --> |
| 360 | |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 361 | <xsl:template name="xsl:initial-template"> |
bansp | f2b24e6 | 2022-03-28 18:12:08 +0200 | [diff] [blame] | 362 | <xsl:variable name="IDs_to_skip" select="tokenize($skip_docID,',')" as="xs:string*"/> |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 363 | |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 364 | <!-- we only want to call the template below once, and we process a random NKJP corpus file for that purpose, |
bansp | 8f6700b | 2022-03-27 05:27:09 +0200 | [diff] [blame] | 365 | because all we need is the main corpus header, and we can (should) get to that from any NKJP corpus document --> |
| 366 | <xsl:call-template name="create_corpus_header"> |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 367 | <xsl:with-param name="text.doc" select="$collection_of_text[1]" as="document-node()"/> |
bansp | 8f6700b | 2022-03-27 05:27:09 +0200 | [diff] [blame] | 368 | <xsl:with-param name="target" select="$targetCorpusDir_slashed || 'header.xml'" as="xs:string"/> |
| 369 | </xsl:call-template> |
| 370 | |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 371 | <xsl:for-each select="$collection_of_text"> |
| 372 | <xsl:variable name="my_dir" as="xs:string" select="replace(base-uri(),'/text\.xml','')"/> |
| 373 | <xsl:variable name="my_textID" as="xs:string" select="tokenize($my_dir,'/')[last()]"/> |
| 374 | <xsl:variable name="ann_morphosyntax.uri" select="$my_dir || '/ann_morphosyntax.xml'" as="xs:string"/> |
Piotr Banski | 081c5de | 2022-06-03 01:57:13 +0200 | [diff] [blame^] | 375 | <!--<xsl:variable name="ann_segmentation.uri" select="$my_dir || '/ann_segmentation.xml'" as="xs:string"/>--> |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 376 | <xsl:variable name="ann_named.uri" select="$my_dir || '/ann_named.xml'" as="xs:string"/> |
| 377 | <xsl:variable name="ann_groups.uri" select="$my_dir || '/ann_groups.xml'" as="xs:string"/> |
| 378 | <xsl:variable name="ann_words.uri" select="$my_dir || '/ann_words.xml'" as="xs:string"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 379 | |
bansp | f2b24e6 | 2022-03-28 18:12:08 +0200 | [diff] [blame] | 380 | <xsl:choose> |
| 381 | <xsl:when test="$my_textID = $IDs_to_skip"/> |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 382 | <!-- this is a utility step, for when we want to ignore some texts for any reason (debugging, selective update) --> |
bansp | f2b24e6 | 2022-03-28 18:12:08 +0200 | [diff] [blame] | 383 | <xsl:otherwise> |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 384 | |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 385 | <xsl:call-template name="process_single_sample"> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 386 | <xsl:with-param name="text.doc" as="document-node()" select="."/> |
| 387 | <xsl:with-param name="ann_morphosyntax.doc" as="document-node()" |
bansp | f2b24e6 | 2022-03-28 18:12:08 +0200 | [diff] [blame] | 388 | select="doc($ann_morphosyntax.uri)"/> |
Piotr Banski | 081c5de | 2022-06-03 01:57:13 +0200 | [diff] [blame^] | 389 | <!-- <xsl:with-param name="ann_segmentation.xml" as="document-node()" |
| 390 | select="doc($ann_segmentation.uri)"/>--> |
bansp | f2b24e6 | 2022-03-28 18:12:08 +0200 | [diff] [blame] | 391 | <xsl:with-param name="my_textID" select="$my_textID" as="xs:string"/> |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 392 | <!-- the following parameters may happen to be null --> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 393 | <xsl:with-param name="ann_named.doc" as="document-node()*" |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 394 | select="if(fn:doc-available($ann_named.uri)) then doc($ann_named.uri) else ()"/> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 395 | <xsl:with-param name="ann_groups.doc" as="document-node()*" |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 396 | select="if(fn:doc-available($ann_groups.uri)) then doc($ann_groups.uri) else ()"/> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 397 | <xsl:with-param name="ann_words.doc" as="document-node()*" |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 398 | select="if(fn:doc-available($ann_words.uri)) then doc($ann_words.uri) else ()"/> |
| 399 | |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 400 | </xsl:call-template> |
bansp | f2b24e6 | 2022-03-28 18:12:08 +0200 | [diff] [blame] | 401 | </xsl:otherwise> |
| 402 | </xsl:choose> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 403 | </xsl:for-each> |
bansp | 8f6700b | 2022-03-27 05:27:09 +0200 | [diff] [blame] | 404 | </xsl:template> |
| 405 | |
| 406 | <xsl:template name="process_single_sample"> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 407 | <xsl:param name="text.doc" as="document-node()"/> |
| 408 | <xsl:param name="ann_morphosyntax.doc" as="document-node()"/> |
Piotr Banski | 081c5de | 2022-06-03 01:57:13 +0200 | [diff] [blame^] | 409 | <!-- <xsl:param name="ann_segmentation.xml" as="document-node()"/>--> |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 410 | <xsl:param name="my_textID" as="xs:string" select="'0-BAD_textID'"/> |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 411 | <!-- empty textID should never happen, but if it does, it will be signalled at the top of the output --> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 412 | <xsl:param name="ann_named.doc" as="document-node()*"/> |
| 413 | <xsl:param name="ann_groups.doc" as="document-node()*"/> |
| 414 | <xsl:param name="ann_words.doc" as="document-node()*"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 415 | |
| 416 | <xsl:variable name="targetBaseDir" as="xs:string" select="$targetCorpusDir_slashed || $docID || '/' || $my_textID"/> |
| 417 | |
| 418 | <xsl:variable name="compoundID" as="xs:string" |
| 419 | select="$corpusID || '_' || $docID || '.' || $my_textID"/> |
| 420 | <!-- this is what occurs in the text and data layers as @docid --> |
| 421 | |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 422 | <xsl:call-template name="create_data"> |
Piotr Banski | 081c5de | 2022-06-03 01:57:13 +0200 | [diff] [blame^] | 423 | <xsl:with-param name="ann_morphosyntax.doc" select="$ann_morphosyntax.doc" as="document-node()"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 424 | <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/> |
| 425 | <xsl:with-param name="target" select="$targetBaseDir || '/data.xml'" as="xs:string"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 426 | </xsl:call-template> |
| 427 | |
Piotr Banski | 081c5de | 2022-06-03 01:57:13 +0200 | [diff] [blame^] | 428 | <!-- <xsl:call-template name="create_struct"> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 429 | <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 430 | <xsl:with-param name="ann_segmentation.xml" select="$ann_segmentation.xml" |
| 431 | as="document-node()"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 432 | <xsl:with-param name="target" select="$targetBaseDir || '/struct/structure.xml'" as="xs:string" |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 433 | /> |
Piotr Banski | 081c5de | 2022-06-03 01:57:13 +0200 | [diff] [blame^] | 434 | </xsl:call-template>--> |
Piotr Banski | 92791a2 | 2022-05-26 01:41:10 +0200 | [diff] [blame] | 435 | |
Piotr Banski | 081c5de | 2022-06-03 01:57:13 +0200 | [diff] [blame^] | 436 | <!-- <xsl:call-template name="create_morpho"> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 437 | <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 438 | <xsl:with-param name="ann_segmentation.xml" select="$ann_segmentation.xml" |
| 439 | as="document-node()"/> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 440 | <xsl:with-param name="ann_morphosyntax.doc" select="$ann_morphosyntax.doc" |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 441 | as="document-node()"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 442 | <xsl:with-param name="target" select="$targetBaseDir || '/nkjp/morpho.xml'" as="xs:string"/> |
Piotr Banski | 081c5de | 2022-06-03 01:57:13 +0200 | [diff] [blame^] | 443 | </xsl:call-template>--> |
Piotr Banski | a51907c | 2022-05-25 15:09:41 +0200 | [diff] [blame] | 444 | |
Piotr Banski | 081c5de | 2022-06-03 01:57:13 +0200 | [diff] [blame^] | 445 | <!-- |
| 446 | |
| 447 | THESE ARE SAFE |
| 448 | |
| 449 | |
| 450 | <xsl:call-template name="create_text_header"> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 451 | <xsl:with-param name="text.doc" select="$text.doc" as="document-node()"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 452 | <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/> |
| 453 | <xsl:with-param name="target" select="$targetBaseDir || '/header.xml'" as="xs:string"/> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame] | 454 | </xsl:call-template> |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 455 | |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 456 | <xsl:if test="$ann_named.doc"> |
Piotr Banski | 763b41f | 2022-06-02 01:13:23 +0200 | [diff] [blame] | 457 | <xsl:variable name="rev_lookup-seq" as="map(*)+"> |
| 458 | <xsl:for-each |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 459 | select="$ann_named.doc//tei:seg/tei:ptr"> |
Piotr Banski | 763b41f | 2022-06-02 01:13:23 +0200 | [diff] [blame] | 460 | <xsl:variable name="trg" as="xs:string" select="fn:substring-before(@target, '#')"/> |
Piotr Banski | 081c5de | 2022-06-03 01:57:13 +0200 | [diff] [blame^] | 461 | <!-\- caution: as of 01-June-2022, some of the pointers are malformed (missing '#' when referencing locally). |
| 462 | so we need to act around it but also sustainably - in case that error gets corrected -\-> |
Piotr Banski | 763b41f | 2022-06-02 01:13:23 +0200 | [diff] [blame] | 463 | |
| 464 | <xsl:if test="fn:string-length($trg) and $trg eq 'ann_morphosyntax.xml'"> |
| 465 | <xsl:sequence> |
| 466 | <xsl:map-entry key="fn:substring-after(fn:string(@target), '#')" select="fn:current()" |
| 467 | /> |
| 468 | </xsl:sequence> |
| 469 | </xsl:if> |
| 470 | </xsl:for-each> |
| 471 | </xsl:variable> |
| 472 | <xsl:variable name="rev_lookup" as="map(*)" select="map:merge($rev_lookup-seq,map{'duplicates':'combine'})"/> |
| 473 | |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 474 | <xsl:call-template name="create_named"> |
| 475 | <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 476 | <xsl:with-param name="ann_morphosyntax.doc" select="$ann_morphosyntax.doc" |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 477 | as="document-node()"/> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 478 | <xsl:with-param name="ann_named.doc" select="$ann_named.doc" |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 479 | as="document-node()"/> |
| 480 | <xsl:with-param name="target" select="$targetBaseDir || '/nkjp/named.xml'" as="xs:string"/> |
Piotr Banski | 763b41f | 2022-06-02 01:13:23 +0200 | [diff] [blame] | 481 | <xsl:with-param name="rev_lookup" select="$rev_lookup" as="map(*)"/> |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 482 | </xsl:call-template> |
| 483 | </xsl:if> |
Piotr Banski | 081c5de | 2022-06-03 01:57:13 +0200 | [diff] [blame^] | 484 | --> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 485 | <xsl:if test="$ann_words.doc and $ann_groups.doc"> |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 486 | <xsl:call-template name="create_groups"> |
| 487 | <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 488 | <xsl:with-param name="ann_morphosyntax.doc" select="$ann_morphosyntax.doc" |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 489 | as="document-node()"/> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 490 | <xsl:with-param name="ann_words.doc" select="$ann_words.doc" |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 491 | as="document-node()"/> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 492 | <xsl:with-param name="ann_groups.doc" select="$ann_groups.doc" |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 493 | as="document-node()"/> |
| 494 | <xsl:with-param name="target" select="$targetBaseDir || '/nkjp/groups.xml'" as="xs:string"/> |
| 495 | </xsl:call-template> |
| 496 | </xsl:if> |
| 497 | |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 498 | </xsl:template> |
| 499 | |
| 500 | <!-- ************************** data.xml ******************* --> |
| 501 | |
| 502 | <xsl:template name="create_data"> |
Piotr Banski | 081c5de | 2022-06-03 01:57:13 +0200 | [diff] [blame^] | 503 | <xsl:param name="ann_morphosyntax.doc" as="document-node()"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 504 | <xsl:param name="compoundID" as="xs:string"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 505 | <xsl:param name="target" as="xs:string"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 506 | <!-- create the data.xml file --> |
| 507 | <xsl:result-document encoding="UTF-8" method="xml" indent="yes" |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 508 | xpath-default-namespace="{$KorAP_namespace}" href="{$target}"> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 509 | |
Akron | 9a8ee3e | 2022-01-31 13:51:49 +0100 | [diff] [blame] | 510 | <xsl:processing-instruction name="xml-model">href="text.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"</xsl:processing-instruction> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 511 | <xsl:element name="raw_text" namespace="{$KorAP_namespace}"> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 512 | <xsl:attribute name="docid" select="$compoundID"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 513 | <xsl:element name="metadata" namespace="{$KorAP_namespace}"> |
| 514 | <xsl:attribute name="file" select="'metadata.xml'"/> |
| 515 | </xsl:element> |
| 516 | |
| 517 | <xsl:element name="text" namespace="{$KorAP_namespace}"> |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 518 | <xsl:variable name="content" as="xs:string+"> |
Piotr Banski | 081c5de | 2022-06-03 01:57:13 +0200 | [diff] [blame^] | 519 | <!--<xsl:for-each select="$ann_morphosyntax.doc/tei:teiCorpus/tei:TEI/tei:text/tei:body/tei:p/tei:s//tei:seg[count(@nkjp:rejected) eq 0]">--> |
| 520 | <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']]"> |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 521 | <xsl:sequence select=" |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 522 | if (f:is_preceded_by_ws(.,false())) then |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 523 | ' ' |
| 524 | else |
Piotr Banski | 081c5de | 2022-06-03 01:57:13 +0200 | [diff] [blame^] | 525 | '', ./tei:fs/tei:f[@name eq 'orth']/tei:string"/> |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 526 | </xsl:for-each> |
| 527 | </xsl:variable> |
| 528 | <xsl:value-of select="string-join($content)"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 529 | </xsl:element> |
Akron | 9a8ee3e | 2022-01-31 13:51:49 +0100 | [diff] [blame] | 530 | </xsl:element> |
bansp | f79443e | 2022-02-25 14:25:33 +0100 | [diff] [blame] | 531 | </xsl:result-document> |
Akron | 9a8ee3e | 2022-01-31 13:51:49 +0100 | [diff] [blame] | 532 | </xsl:template> |
| 533 | |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 534 | <!-- ************************** struct ******************* --> |
| 535 | |
| 536 | <xsl:template name="create_struct"> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 537 | <xsl:param name="compoundID" as="xs:string"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 538 | <xsl:param name="ann_segmentation.xml" as="document-node()"/> |
| 539 | <xsl:param name="target" as="xs:string"/> |
Piotr Banski | 4f4c2d2 | 2022-05-19 01:44:32 +0200 | [diff] [blame] | 540 | |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 541 | <xsl:result-document encoding="UTF-8" method="xml" indent="yes" |
| 542 | xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}"> |
| 543 | <xsl:processing-instruction name="xml-model">href="span.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"</xsl:processing-instruction> |
| 544 | <xsl:element name="layer" namespace="{$KorAP_namespace}"> |
| 545 | <xsl:attribute name="docid" select="$compoundID"/> |
| 546 | <xsl:attribute name="version" select="$KorAP-XML_version"/> |
| 547 | |
| 548 | <xsl:element name="spanList" namespace="{$KorAP_namespace}"> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame] | 549 | <xsl:apply-templates select="$ann_segmentation.xml//tei:text" mode="struct"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 550 | </xsl:element> |
| 551 | </xsl:element> |
| 552 | </xsl:result-document> |
| 553 | </xsl:template> |
| 554 | |
| 555 | <xsl:template match="tei:*" mode="struct"> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame] | 556 | <xsl:variable name="offsets" as="xs:integer+"> |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 557 | <xsl:sequence select="map:get(fn:accumulator-after('segmentation-offsets')[last()], string(@xml:id))"/> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame] | 558 | </xsl:variable> |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 559 | |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 560 | <xsl:variable name="my_name" select="local-name()" as="xs:string"/> |
Piotr Banski | e1ac520 | 2022-05-30 21:25:21 +0200 | [diff] [blame] | 561 | <xsl:variable name="my_index" select="fn:accumulator-before('element-index')" as="xs:integer"/> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 562 | |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 563 | <xsl:element name="span" namespace="{$KorAP_namespace}"> |
| 564 | <xsl:attribute name="id" select="'s' || $my_index"/> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame] | 565 | <xsl:attribute name="from" select="$offsets[1]"/> |
| 566 | <xsl:attribute name="to" select="$offsets[2]"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 567 | <xsl:attribute name="l" select="f:compute_nesting(.)"/> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame] | 568 | <xsl:if test="local-name() eq 'seg' and $SHOW_ORTH_IN_STRUCT"> |
| 569 | <xsl:comment><xsl:value-of select="fn:normalize-space(.)"/></xsl:comment> |
| 570 | </xsl:if> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 571 | <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0"> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 572 | <xsl:attribute name="type" select="'struct'"></xsl:attribute> <!-- STRUCT vs. LEX for morpho --> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 573 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 574 | <xsl:attribute name="name" select="'name'"/> |
| 575 | <xsl:value-of select="local-name()"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 576 | </xsl:element> |
| 577 | <xsl:if test="count(@*)"> |
| 578 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
| 579 | <xsl:attribute name="name" select="'attr'"/> |
| 580 | <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0"> |
| 581 | <xsl:attribute name="type" select="'attr'"/> |
| 582 | <xsl:for-each select="@*"> |
| 583 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
| 584 | <xsl:attribute name="name" select="local-name(.)"/> |
| 585 | <xsl:value-of select="."/> |
| 586 | </xsl:element> |
| 587 | </xsl:for-each> |
| 588 | </xsl:element> |
| 589 | </xsl:element> |
| 590 | </xsl:if> |
| 591 | </xsl:element> |
| 592 | </xsl:element> |
Piotr Banski | a51907c | 2022-05-25 15:09:41 +0200 | [diff] [blame] | 593 | <xsl:apply-templates mode="struct"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 594 | </xsl:template> |
| 595 | |
| 596 | <!-- ************************** morpho ******************* --> |
| 597 | |
| 598 | <xsl:template name="create_morpho"> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 599 | <xsl:param name="compoundID" as="xs:string"/> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 600 | <xsl:param name="ann_segmentation.xml" as="document-node()"/> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 601 | <xsl:param name="ann_morphosyntax.doc" as="document-node()"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 602 | <xsl:param name="target" as="xs:string"/> |
| 603 | |
| 604 | <xsl:result-document encoding="UTF-8" method="xml" indent="yes" |
| 605 | xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}"> |
| 606 | <xsl:processing-instruction name="xml-model">href="span.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"</xsl:processing-instruction> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 607 | <xsl:element name="layer" namespace="{$KorAP_namespace}"> |
| 608 | <xsl:attribute name="docid" select="$compoundID"/> |
| 609 | <xsl:attribute name="version" select="$KorAP-XML_version"/> |
| 610 | |
| 611 | <xsl:element name="spanList" namespace="{$KorAP_namespace}"> |
| 612 | <xsl:apply-templates select="$ann_segmentation.xml//tei:text" mode="morpho"> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 613 | <xsl:with-param name="ann_morphosyntax.doc" select="$ann_morphosyntax.doc" as="document-node()" tunnel="yes"/> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 614 | </xsl:apply-templates> |
| 615 | </xsl:element> |
| 616 | </xsl:element> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 617 | </xsl:result-document> |
| 618 | </xsl:template> |
| 619 | |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 620 | <xsl:template match="tei:seg" mode="morpho"> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 621 | <xsl:param name="ann_morphosyntax.doc" as="document-node()" tunnel="yes"/> |
Piotr Banski | a51907c | 2022-05-25 15:09:41 +0200 | [diff] [blame] | 622 | <!-- it's so spread out because I wanted to make sure to be able to look up the individual |
| 623 | constituent values, should anything go wrong; it might get compacted at some point, but |
| 624 | the increase in efficiency will probably be minimal, compared to the decrease of readability --> |
| 625 | <xsl:variable name="offsets" as="xs:integer+"> |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 626 | <xsl:sequence select="map:get(fn:accumulator-after('segmentation-offsets')[last()], string(@xml:id))"/> |
Piotr Banski | a51907c | 2022-05-25 15:09:41 +0200 | [diff] [blame] | 627 | </xsl:variable> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 628 | <xsl:variable name="my_name" select="local-name()" as="xs:string"/> |
| 629 | <xsl:variable name="my_id" select="@xml:id" as="xs:string"/> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 630 | <xsl:variable name="my_morph-seg" as="node()" select="$ann_morphosyntax.doc//tei:seg[substring-after(@corresp,'#') eq $my_id]"/> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 631 | <xsl:variable name="my_disamb" select="$my_morph-seg//tei:fs/tei:f[@name eq 'disamb']" as="node()"/> |
| 632 | <xsl:variable name="my_choice-id" select="substring-after($my_disamb//tei:f[@name eq 'choice']/@fVal,'#')" as="xs:string"/> |
| 633 | <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()"/> |
| 634 | <xsl:variable name="chosen-msd" as="xs:string" select="$my_choice-lex/descendant::tei:symbol[@xml:id eq $my_choice-id]/@value"/> |
Piotr Banski | e1ac520 | 2022-05-30 21:25:21 +0200 | [diff] [blame] | 635 | <xsl:variable name="my_index" select="fn:accumulator-before('element-index')" as="xs:integer"/> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 636 | |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 637 | <xsl:element name="span" namespace="{$KorAP_namespace}"> |
Piotr Banski | a51907c | 2022-05-25 15:09:41 +0200 | [diff] [blame] | 638 | <xsl:attribute name="id" select="'m' || $my_index"/> |
| 639 | <xsl:attribute name="from" select="$offsets[1]"/> |
| 640 | <xsl:attribute name="to" select="$offsets[2]"/> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 641 | <xsl:attribute name="l" select="f:compute_nesting(.)"/> |
| 642 | <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0"> |
| 643 | <xsl:attribute name="type" select="'lex'"/> |
| 644 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
| 645 | <xsl:attribute name="name" select="'lex'"/> |
Piotr Banski | 763b41f | 2022-06-02 01:13:23 +0200 | [diff] [blame] | 646 | <xsl:comment select="(if(@nkjp:nps) then ' ' else '_') || $my_morph-seg//tei:fs/tei:f[@name eq 'orth']/tei:string"/> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 647 | <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0"> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 648 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
| 649 | <xsl:attribute name="name" select="'lemma'"/> |
| 650 | <xsl:value-of select="$my_choice-lex/tei:f[@name eq 'base']/tei:string"/> |
| 651 | </xsl:element> |
| 652 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
| 653 | <xsl:attribute name="name" select="'pos'"/> |
| 654 | <xsl:value-of select="$my_choice-lex/tei:f[@name eq 'ctag']/tei:symbol/@value"/> |
| 655 | </xsl:element> |
| 656 | <xsl:if test="string-length($chosen-msd)"> |
| 657 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
| 658 | <xsl:attribute name="name" select="'msd'"/> |
| 659 | <xsl:value-of select="$chosen-msd"/> |
| 660 | </xsl:element> |
| 661 | </xsl:if> |
| 662 | <xsl:if test="$my_morph-seg//tei:fs/tei:f[@name eq 'nps']"> |
| 663 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
| 664 | <xsl:attribute name="name" select="'join'"/> |
| 665 | <xsl:value-of select="'left'"/> |
| 666 | </xsl:element> |
| 667 | </xsl:if> |
| 668 | </xsl:element> |
| 669 | </xsl:element> |
| 670 | </xsl:element> |
| 671 | </xsl:element> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 672 | </xsl:template> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 673 | |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 674 | <!-- ************************** named entities ******************* --> |
| 675 | |
| 676 | <xsl:template name="create_named"> |
| 677 | <xsl:param name="compoundID" as="xs:string"/> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 678 | <xsl:param name="ann_morphosyntax.doc" as="document-node()"/> |
| 679 | <xsl:param name="ann_named.doc" as="document-node()"/> |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 680 | <xsl:param name="target" as="xs:string"/> |
Piotr Banski | 763b41f | 2022-06-02 01:13:23 +0200 | [diff] [blame] | 681 | <xsl:param name="rev_lookup" as="map(*)"/> |
| 682 | |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 683 | <xsl:result-document encoding="UTF-8" method="xml" indent="yes" |
| 684 | xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}"> |
| 685 | <xsl:processing-instruction name="xml-model">href="span.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"</xsl:processing-instruction> |
| 686 | <xsl:element name="layer" namespace="{$KorAP_namespace}"> |
| 687 | <xsl:attribute name="docid" select="$compoundID"/> |
| 688 | <xsl:attribute name="version" select="$KorAP-XML_version"/> |
| 689 | |
| 690 | <xsl:element name="spanList" namespace="{$KorAP_namespace}"> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 691 | <xsl:apply-templates select="$ann_morphosyntax.doc//tei:text" mode="named"> |
| 692 | <xsl:with-param name="ann_named.doc" select="$ann_named.doc" as="document-node()" tunnel="yes"/> |
Piotr Banski | 763b41f | 2022-06-02 01:13:23 +0200 | [diff] [blame] | 693 | <xsl:with-param name="rev_lookup" select="$rev_lookup" as="map(*)" tunnel="yes"/> |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 694 | </xsl:apply-templates> |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 695 | </xsl:element> |
| 696 | </xsl:element> |
| 697 | </xsl:result-document> |
| 698 | </xsl:template> |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 699 | |
| 700 | <xsl:template match="tei:seg" mode="named"/> |
| 701 | |
| 702 | <xsl:template match="tei:seg[tei:fs[tei:f[@name eq 'disamb']]]" mode="named"> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 703 | <xsl:param name="ann_named.doc" as="document-node()" tunnel="yes"/> |
Piotr Banski | 763b41f | 2022-06-02 01:13:23 +0200 | [diff] [blame] | 704 | <xsl:param name="rev_lookup" as="map(*)" tunnel="yes"/> |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 705 | |
| 706 | <xsl:variable name="offsets" as="xs:integer+"> |
| 707 | <xsl:sequence select="map:get(fn:accumulator-after('morpho-offsets')[last()], string(@xml:id))"/> |
| 708 | </xsl:variable> |
| 709 | |
Piotr Banski | 763b41f | 2022-06-02 01:13:23 +0200 | [diff] [blame] | 710 | <xsl:variable name="ptr" select="map:get($rev_lookup,fn:string(@xml:id))" as="element(tei:ptr)*"/> |
| 711 | <!-- it's an element, because we need to see where it stands in a sequence... --> |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 712 | |
Piotr Banski | 763b41f | 2022-06-02 01:13:23 +0200 | [diff] [blame] | 713 | <xsl:if test="$ptr"> |
| 714 | <xsl:variable name="my_id" select="@xml:id" as="xs:string"/> |
| 715 | <xsl:variable name="my_index" select="fn:accumulator-before('element-index')" as="xs:integer"/> |
| 716 | |
| 717 | <xsl:element name="span" namespace="{$KorAP_namespace}"> |
| 718 | <xsl:attribute name="id" select="'n' || $my_index"/> |
| 719 | <xsl:attribute name="from" select="$offsets[1]"/> |
| 720 | <xsl:attribute name="to" select="$offsets[2]"/> |
| 721 | <xsl:attribute name="l" select="f:compute_nesting(.)"/> |
| 722 | <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0"> |
| 723 | <xsl:attribute name="type" select="'ne'"/> |
| 724 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
| 725 | <xsl:attribute name="name" select="'ne'"/> |
| 726 | <xsl:comment select=" |
| 727 | (if (tei:fs/tei:f[@name eq 'nps']) then |
| 728 | ' ' |
| 729 | else |
| 730 | '_') || tei:fs/tei:f[@name eq 'orth']/tei:string"/> |
| 731 | <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0"> |
| 732 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
| 733 | <xsl:attribute name="name" select="'complex-ent'"/> |
| 734 | <xsl:for-each select="$ptr"> |
| 735 | <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0"> |
| 736 | <xsl:attribute name="type" select="'complex-ent'"/> |
| 737 | <xsl:for-each select="parent::tei:seg/tei:fs[1]/tei:f"> |
| 738 | <xsl:if test="@name eq 'type' or @name eq 'subtype'"> |
| 739 | <xsl:copy-of select="." copy-namespaces="no"/> |
| 740 | </xsl:if> |
| 741 | </xsl:for-each> |
| 742 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
| 743 | <xsl:attribute name="name" select="'nkjp-named'"/> |
| 744 | <xsl:copy-of select="parent::tei:seg/tei:fs[1]" copy-namespaces="no"/> |
| 745 | </xsl:element> |
| 746 | </xsl:element> |
| 747 | </xsl:for-each> |
| 748 | |
| 749 | </xsl:element> |
| 750 | |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 751 | </xsl:element> |
| 752 | </xsl:element> |
| 753 | </xsl:element> |
| 754 | </xsl:element> |
Piotr Banski | 763b41f | 2022-06-02 01:13:23 +0200 | [diff] [blame] | 755 | </xsl:if> |
Piotr Banski | 65a6d0b | 2022-05-31 17:23:08 +0200 | [diff] [blame] | 756 | </xsl:template> |
| 757 | |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 758 | |
| 759 | <!-- ************************** syntactic chunks ******************* --> |
| 760 | |
| 761 | <xsl:template name="create_groups"> |
| 762 | <xsl:param name="compoundID" as="xs:string"/> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 763 | <xsl:param name="ann_morphosyntax.doc" as="document-node()"/> |
| 764 | <xsl:param name="ann_words.doc" as="document-node()"/> |
| 765 | <xsl:param name="ann_groups.doc" as="document-node()"/> |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 766 | <xsl:param name="target" as="xs:string"/> |
| 767 | |
| 768 | <xsl:result-document encoding="UTF-8" method="xml" indent="yes" |
| 769 | xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}"> |
| 770 | <xsl:processing-instruction name="xml-model">href="span.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"</xsl:processing-instruction> |
| 771 | <xsl:element name="layer" namespace="{$KorAP_namespace}"> |
| 772 | <xsl:attribute name="docid" select="$compoundID"/> |
| 773 | <xsl:attribute name="version" select="$KorAP-XML_version"/> |
| 774 | |
| 775 | <xsl:element name="spanList" namespace="{$KorAP_namespace}"> |
| 776 | <!--<xsl:apply-templates select="$ann_segmentation.xml//tei:text" mode="groups"> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 777 | <xsl:with-param name="ann_morphosyntax.doc" select="$ann_morphosyntax.doc" as="document-node()" tunnel="yes"/> |
| 778 | <xsl:with-param name="ann_words.doc" select="$ann_words.doc" as="document-node()" tunnel="yes"/> |
| 779 | <xsl:with-param name="ann_groups.doc" select="$ann_groups.doc" as="document-node()" tunnel="yes"/> |
Piotr Banski | c5950ce | 2022-05-27 15:07:08 +0200 | [diff] [blame] | 780 | </xsl:apply-templates>--> |
| 781 | </xsl:element> |
| 782 | </xsl:element> |
| 783 | </xsl:result-document> |
| 784 | </xsl:template> |
| 785 | |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 786 | <!-- ************************** TEXT header ******************* --> |
| 787 | |
| 788 | <xsl:template name="create_text_header"> |
Piotr Banski | f959069 | 2022-06-02 15:39:48 +0200 | [diff] [blame] | 789 | <xsl:param name="text.doc" as="document-node()"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 790 | <xsl:param name="compoundID" as="xs:string"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 791 | <xsl:param name="target" as="xs:string"/> |
| 792 | |
| 793 | <!-- create the local header.xml file --> |
| 794 | <xsl:result-document encoding="UTF-8" method="xml" indent="yes" |
| 795 | xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}"> |
| 796 | |
| 797 | <idsHeader type="document" pattern="text" status="new" version="1.1" TEIform="teiHeader"> |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 798 | <xsl:apply-templates select="$text.doc//tei:TEI/tei:teiHeader/tei:*" mode="text-header"> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 799 | <xsl:with-param name="compoundID" as="xs:string" select="$compoundID" tunnel="yes"/> |
| 800 | </xsl:apply-templates> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 801 | </idsHeader> |
| 802 | </xsl:result-document> |
| 803 | </xsl:template> |
| 804 | |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 805 | <xsl:template match="tei:fileDesc" mode="text-header"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 806 | <xsl:element name="{local-name()}"> |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 807 | <xsl:apply-templates mode="text-header"/> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 808 | </xsl:element> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 809 | </xsl:template> |
| 810 | |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 811 | <xsl:template match="tei:title" mode="text-header"> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 812 | <t.title> |
| 813 | <xsl:apply-templates/> |
| 814 | </t.title> |
| 815 | </xsl:template> |
| 816 | |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 817 | <xsl:template match="tei:titleStmt" mode="text-header"> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 818 | <xsl:param name="compoundID" as="xs:string" tunnel="yes"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 819 | <titleStmt> |
| 820 | <textSigle> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 821 | <xsl:value-of select="$compoundID"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 822 | </textSigle> |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 823 | <xsl:apply-templates mode="text-header"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 824 | </titleStmt> |
| 825 | </xsl:template> |
| 826 | |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 827 | <xsl:template match="tei:publicationStmt" mode="text-header"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 828 | <xsl:element name="{local-name()}"> |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 829 | <xsl:apply-templates mode="text-header"/> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 830 | </xsl:element> |
| 831 | </xsl:template> |
| 832 | |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 833 | <xsl:template match="tei:availability" mode="text-header"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 834 | <xsl:element name="{local-name()}"> |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 835 | <xsl:apply-templates mode="text-header" select="@* | *"/> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 836 | </xsl:element> |
| 837 | </xsl:template> |
| 838 | |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 839 | <xsl:template match="tei:profileDesc" mode="text-header"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 840 | <xsl:element name="{local-name()}"> |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 841 | <xsl:apply-templates mode="text-header"/> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 842 | </xsl:element> |
| 843 | </xsl:template> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 844 | |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 845 | <xsl:template match="tei:textClass" mode="text-header"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 846 | <xsl:element name="{local-name()}"> |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 847 | <xsl:apply-templates mode="text-header" select="@* | *"/> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 848 | </xsl:element> |
| 849 | </xsl:template> |
| 850 | |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 851 | <xsl:template match="tei:catRef" mode="text-header corpus-header"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 852 | <xsl:element name="{local-name()}"> |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 853 | <xsl:apply-templates mode="text-header" select="@* | *"/> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 854 | </xsl:element> |
| 855 | </xsl:template> |
| 856 | |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 857 | <xsl:template match="@status | @scheme | @target | @type | @xml:id[ancestor::tei:classDecl] | @xml:lang" mode="text-header corpus-header"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 858 | <xsl:copy-of select="."/> |
| 859 | </xsl:template> |
| 860 | |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 861 | <xsl:template match="tei:p" mode="text-header corpus-header"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 862 | <xsl:element name="{local-name()}"> |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 863 | <xsl:apply-templates mode="text_inside_header"/> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 864 | </xsl:element> |
| 865 | </xsl:template> |
| 866 | |
| 867 | |
| 868 | <!-- OPTIMIZATION has to take modes into account --> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 869 | <!-- ************************** CORPUS header ******************* --> |
| 870 | <xsl:template name="create_corpus_header"> |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 871 | <xsl:param name="text.doc" as="document-node()"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 872 | <xsl:param name="target" as="xs:string"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 873 | |
| 874 | <!-- create the corpus-level header.xml file --> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 875 | <xsl:result-document encoding="UTF-8" method="xml" indent="yes" href="{$target}"> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 876 | |
| 877 | <!--doctype-public="{$publicDoctypeI5}" |
| 878 | doctype-system="{$systemDoctypeI5}"> |
| 879 | these are, sadly, useless |
| 880 | --> |
| 881 | |
| 882 | <idsHeader type="corpus" pattern="text" status="new" version="1.1" TEIform="teiHeader"> |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 883 | <xsl:apply-templates select="$text.doc/tei:teiCorpus/tei:teiHeader/tei:*" mode="corpus-header"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 884 | </idsHeader> |
| 885 | </xsl:result-document> |
| 886 | </xsl:template> |
| 887 | |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 888 | <xsl:template match="tei:fileDesc" mode="corpus-header"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 889 | <xsl:element name="{local-name()}"> |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 890 | <xsl:apply-templates mode="corpus-header"/> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 891 | </xsl:element> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 892 | </xsl:template> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 893 | |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 894 | |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 895 | <xsl:template match="tei:title" mode="corpus-header"> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 896 | <c.title> |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 897 | <xsl:apply-templates mode="corpus-header" select="@*"/> |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 898 | <xsl:apply-templates mode="text_inside_header"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 899 | </c.title> |
| 900 | </xsl:template> |
| 901 | |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 902 | <xsl:template match="tei:titleStmt" mode="corpus-header"> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 903 | <titleStmt> |
| 904 | <korpusSigle> |
| 905 | <xsl:value-of select="$corpusID"/> |
| 906 | </korpusSigle> |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 907 | <xsl:apply-templates mode="corpus-header"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 908 | </titleStmt> |
| 909 | </xsl:template> |
| 910 | |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 911 | <xsl:template match="tei:publicationStmt" mode="corpus-header"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 912 | <xsl:element name="{local-name()}"> |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 913 | <xsl:apply-templates mode="corpus-header"/> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 914 | </xsl:element> |
| 915 | </xsl:template> |
| 916 | |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 917 | <xsl:template match="tei:availability" mode="corpus-header"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 918 | <xsl:element name="{local-name()}"> |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 919 | <xsl:apply-templates mode="corpus-header" select="@* | *"/> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 920 | </xsl:element> |
| 921 | </xsl:template> |
| 922 | |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 923 | <xsl:template match="tei:encodingDesc" mode="corpus-header"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 924 | <xsl:element name="{local-name()}"> |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 925 | <xsl:apply-templates mode="corpus-header"/> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 926 | </xsl:element> |
| 927 | </xsl:template> |
| 928 | |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 929 | <xsl:template match="tei:classDecl | tei:taxonomy | tei:category | tei:taxonomy/tei:bibl" mode="corpus-header"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 930 | <xsl:element name="{local-name()}"> |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 931 | <xsl:apply-templates mode="corpus-header" select="@* | *"/> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 932 | </xsl:element> |
| 933 | </xsl:template> |
| 934 | |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 935 | <xsl:template match="tei:bibl/tei:title | tei:edition | tei:desc" mode="corpus-header"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 936 | <xsl:element name="{local-name()}"> |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 937 | <xsl:apply-templates mode="corpus-header" select="@*"/> |
Piotr Banski | a0a9fc0 | 2022-06-03 01:20:18 +0200 | [diff] [blame] | 938 | <xsl:apply-templates mode="text_inside_header"/> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 939 | </xsl:element> |
| 940 | </xsl:template> |
| 941 | <!-- |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 942 | <xsl:template match="tei:textClass" mode="corpus-header"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 943 | <xsl:element name="{local-name()}"> |
| 944 | <xsl:apply-templates mode="corpus" select="@* | *"/> |
| 945 | </xsl:element> |
| 946 | </xsl:template> |
| 947 | |
Piotr Banski | faa910f | 2022-06-03 00:46:29 +0200 | [diff] [blame] | 948 | <xsl:template match="tei:catRef" mode="corpus-header"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 949 | <xsl:element name="{local-name()}"> |
| 950 | <xsl:apply-templates mode="corpus" select="@* | *"/> |
| 951 | </xsl:element> |
| 952 | </xsl:template> |
| 953 | --> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 954 | |
| 955 | |
| 956 | |
| 957 | <!-- this template can be called by the XSPEC test; TODO: find a way to call the main() template directly --> |
| 958 | <!-- I have not fully handled the param transmission, which would have to be kludged in just for the sake of XSPec, |
| 959 | because I'm disabling this for now, due to XSpec design issues; relevant links, a.o.: |
| 960 | |
| 961 | https://stackoverflow.com/questions/64933277/what-is-the-cause-of-error-cannot-execute-xslresult-document-while-evaluating |
| 962 | https://www.balisage.net/Proceedings/vol25/html/Galtman01/BalisageVol25-Galtman01.html |
| 963 | |
| 964 | In short: the internal design of XSpec forces kludges when one wants to use xsl:result-document in their stylesheets. But I don't |
| 965 | want to be strangled by kludges at the beginning of work, I've already lost quite a bit of time on this investigation, |
| 966 | I will therefore "just code" and then can think of externalizing bits of templates if we want to play with tests. For now, |
| 967 | 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. |
| 968 | |
| 969 | --> |
| 970 | <!--<xsl:template name="test_full"> |
| 971 | <xsl:param name="corpusID"/> |
| 972 | <xsl:param name="docID"/> |
| 973 | <xsl:param name="textID"/> |
| 974 | <xsl:call-template name="xsl:initial-template"/> |
| 975 | </xsl:template>--> |
| 976 | |
Akron | 9a8ee3e | 2022-01-31 13:51:49 +0100 | [diff] [blame] | 977 | </xsl:stylesheet> |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 978 | |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 979 | <!-- template for serializing maps in messages <xsl:message select="('map:',serialize($map, map{'method':'adaptive'}))"/> --> |