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 | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 6 | xmlns:map="http://www.w3.org/2005/xpath-functions/map" exclude-result-prefixes="xs f fn map nkjp tei" |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 7 | version="3.0" expand-text="yes"> |
Akron | 9a8ee3e | 2022-01-31 13:51:49 +0100 | [diff] [blame] | 8 | |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 9 | |
| 10 | <!-- PARAMETERS --> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 11 | |
bansp | 8f6700b | 2022-03-27 05:27:09 +0200 | [diff] [blame] | 12 | <xsl:param name="sourceDir" select="'test/resources/nkjp2korap_sample2'" as="xs:string"/> |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 13 | <!-- 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) --> |
Akron | 9a8ee3e | 2022-01-31 13:51:49 +0100 | [diff] [blame] | 15 | |
bansp | 8f6700b | 2022-03-27 05:27:09 +0200 | [diff] [blame] | 16 | <xsl:param name="targetDir" select="'test/output'" as="xs:string"/> |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 17 | <!-- where the corpus/document/text/annotations hierarchy is going to be created --> |
bansp | f2b24e6 | 2022-03-28 18:12:08 +0200 | [diff] [blame] | 18 | |
| 19 | <xsl:param name="skip_docID" as="xs:string"> |
bansp | b599253 | 2022-03-29 15:55:44 +0200 | [diff] [blame] | 20 | <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 |
bansp | f2b24e6 | 2022-03-28 18:12:08 +0200 | [diff] [blame] | 23 | example: HellerPodgladanie,KOT |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 24 | no functionality beyond string identity is supported |
| 25 | (this is just for testing) --> |
bansp | b599253 | 2022-03-29 15:55:44 +0200 | [diff] [blame] | 26 | |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 27 | <xsl:param name="SHOW_ORTH_IN_STRUCT" as="xs:boolean" select="true()"/> |
| 28 | <!-- for debugging structure.xml production --> |
| 29 | |
bansp | 8f6700b | 2022-03-27 05:27:09 +0200 | [diff] [blame] | 30 | |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 31 | <!-- VARIABLES (= constants...) --> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 32 | |
| 33 | <xsl:variable name="corpusID" as="xs:string" select="'NKJP'" static="yes"/> |
| 34 | <xsl:variable name="docID" as="xs:string" select="'NKJP'" static="yes"/> |
bansp | 8f6700b | 2022-03-27 05:27:09 +0200 | [diff] [blame] | 35 | |
| 36 | <xsl:variable name="targetCorpusDir_slashed" select="$targetDir || '/' || $corpusID || '/'" as="xs:string"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 37 | |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 38 | <xsl:variable name="systemDoctypeI5" as="xs:string" |
| 39 | select="'http://corpora.ids-mannheim.de/I5/DTD/i5.dtd'" static="true"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 40 | |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 41 | <xsl:variable name="publicDoctypeI5" as="xs:string" static="true" |
| 42 | select="'-//IDS//DTD I5 1.0//EN'"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 43 | |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 44 | <xsl:variable name="KorAP_namespace" static="true" as="xs:string" |
| 45 | select="'http://ids-mannheim.de/ns/KorAP'"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 46 | |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 47 | <xsl:variable name="KorAP-XML_version" select="'KorAP-0.4'" as="xs:string" static="true"/> |
| 48 | <!-- this is only a bit funny --> |
| 49 | |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 50 | <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()+"/> |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 56 | |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 57 | <!-- MODES --> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 58 | |
| 59 | <xsl:mode name="corpus" on-no-match="deep-skip"/> |
| 60 | <xsl:mode name="text" on-no-match="deep-skip"/> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 61 | <xsl:mode name="header-text" on-no-match="text-only-copy"/> |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 62 | <xsl:mode use-accumulators="#all"/> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 63 | |
| 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 Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 67 | |
| 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 Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 74 | </xsl:variable> |
| 75 | |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 76 | <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 Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 78 | |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 79 | <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 Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 90 | </xsl:variable> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 91 | <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^] | 92 | |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 93 | <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 Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 104 | </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 Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 106 | |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 107 | <xsl:sequence select=" |
| 108 | $value, |
| 109 | map { |
Piotr Banski | 69f3c5f | 2022-05-24 10:52:09 +0200 | [diff] [blame] | 110 | string(parent::tei:seg/@xml:id): ($our_base,$our_base + string-length()) |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 111 | }"/> |
| 112 | </xsl:accumulator-rule> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 113 | |
| 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 Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 118 | |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 119 | </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 Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 124 | |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 125 | <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 Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 137 | </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 Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 142 | |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 143 | <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 Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 175 | </xsl:accumulator> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 176 | |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 177 | |
| 178 | <!-- FUNCTIONS --> |
| 179 | |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 180 | <xsl:function name="f:compute_nesting" as="xs:integer"> |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 181 | <xsl:param name="node" as="element()"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 182 | <xsl:variable name="rel_depth" |
| 183 | select="count($node/ancestor-or-self::*[local-name(.) ne 'TEI'][local-name(.) ne 'teiCorpus'])" |
| 184 | as="xs:integer"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 185 | <xsl:sequence select="$rel_depth"/> |
| 186 | </xsl:function> |
| 187 | |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 188 | <xsl:function name="f:is_preceded_by_ws" as="xs:boolean"> |
| 189 | <xsl:param name="node" as="element()"/> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 190 | <xsl:param name="suppress_initial" as="xs:boolean"/> |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 191 | <xsl:choose> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 192 | <xsl:when test="local-name($node) eq 'seg'"> |
| 193 | <xsl:choose> |
| 194 | <xsl:when test="$node/@nkjp:nps"><xsl:sequence select="fn:false()"/></xsl:when> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 195 | <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> |
| 196 | <!-- this is checking if we're preceding by a seg under the same tei:s, modulo choice/paren --> |
| 197 | <!-- THIS CHECK should be streamlined for efficiency, maybe try comparing positions in the descendant axis --> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 198 | <xsl:otherwise> |
| 199 | <xsl:sequence |
| 200 | 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])" |
| 201 | /> |
| 202 | </xsl:otherwise> |
| 203 | </xsl:choose> |
Piotr Banski | 4f4c2d2 | 2022-05-19 01:44:32 +0200 | [diff] [blame] | 204 | |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 205 | </xsl:when> |
| 206 | <xsl:when test="local-name($node) eq 's'"> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 207 | <xsl:choose> |
| 208 | <xsl:when test="exists($node/preceding-sibling::tei:s)"><xsl:sequence select="fn:true()"/></xsl:when> |
| 209 | <xsl:otherwise> |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 210 | <xsl:sequence select="not($suppress_initial) and exists($node/ancestor::tei:p[1]/preceding-sibling::tei:p)"/> |
| 211 | </xsl:otherwise> |
| 212 | </xsl:choose> |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 213 | |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 214 | </xsl:when> |
| 215 | <xsl:when test="local-name($node) eq 'p'"> |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 216 | <xsl:sequence select="exists($node/preceding-sibling::tei:p)"/> |
| 217 | </xsl:when> |
| 218 | <xsl:otherwise> |
| 219 | <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> |
| 220 | </xsl:otherwise> |
| 221 | </xsl:choose> |
| 222 | </xsl:function> |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 223 | |
bansp | b599253 | 2022-03-29 15:55:44 +0200 | [diff] [blame] | 224 | |
| 225 | <!-- UTILITY TEMPLATES --> |
| 226 | |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 227 | <xsl:template match="@default" mode="#all"/> |
bansp | 97ba7ce | 2022-03-26 05:14:06 +0100 | [diff] [blame] | 228 | <!-- this is to delete some auto-inserted attribute throughout --> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 229 | |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 230 | <xsl:template match="tei:w" mode="#all"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 231 | <!-- NKJP-SGJP has apparently resigned from standoff representations by adding <w> everywhere; |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 232 | 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] | 233 | |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 234 | <!-- 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] | 235 | <xsl:template match="tei:choice" mode="struct"> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 236 | <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] | 237 | </xsl:template> |
bansp | b599253 | 2022-03-29 15:55:44 +0200 | [diff] [blame] | 238 | |
| 239 | <!-- MAIN PROCESSING --> |
| 240 | |
| 241 | |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 242 | <xsl:template name="xsl:initial-template"> |
bansp | f2b24e6 | 2022-03-28 18:12:08 +0200 | [diff] [blame] | 243 | <xsl:variable name="IDs_to_skip" select="tokenize($skip_docID,',')" as="xs:string*"/> |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 244 | |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 245 | <!-- 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] | 246 | 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"> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 248 | <xsl:with-param name="text.xml" select="$collection_of_text[1]" as="document-node()"/> |
bansp | 8f6700b | 2022-03-27 05:27:09 +0200 | [diff] [blame] | 249 | <xsl:with-param name="target" select="$targetCorpusDir_slashed || 'header.xml'" as="xs:string"/> |
| 250 | </xsl:call-template> |
| 251 | |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 252 | <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 | |
bansp | f2b24e6 | 2022-03-28 18:12:08 +0200 | [diff] [blame] | 258 | <xsl:choose> |
| 259 | <xsl:when test="$my_textID = $IDs_to_skip"/> |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 260 | <!-- 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] | 261 | <xsl:otherwise> |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 262 | |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 263 | <xsl:call-template name="process_single_sample"> |
bansp | f2b24e6 | 2022-03-28 18:12:08 +0200 | [diff] [blame] | 264 | <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"/> |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 270 | </xsl:call-template> |
bansp | f2b24e6 | 2022-03-28 18:12:08 +0200 | [diff] [blame] | 271 | </xsl:otherwise> |
| 272 | </xsl:choose> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 273 | </xsl:for-each> |
bansp | 8f6700b | 2022-03-27 05:27:09 +0200 | [diff] [blame] | 274 | </xsl:template> |
| 275 | |
| 276 | <xsl:template name="process_single_sample"> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 277 | <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()"/> |
bansp | d1bf1db | 2022-04-04 02:16:24 +0200 | [diff] [blame] | 280 | <xsl:param name="my_textID" as="xs:string" select="'0-BAD_textID'"/> |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 281 | <!-- empty textID should never happen, but if it does, it will be signalled at the top of the output --> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 282 | |
| 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 | |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 289 | <xsl:call-template name="create_data"> |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 290 | <!--<xsl:with-param name="text.xml" select="$text.xml" as="document-node()"/>--> |
| 291 | <xsl:with-param name="ann_segmentation.xml" select="$ann_segmentation.xml" as="document-node()"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 292 | <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/> |
| 293 | <xsl:with-param name="target" select="$targetBaseDir || '/data.xml'" as="xs:string"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 294 | </xsl:call-template> |
| 295 | |
Piotr Banski | 4f4c2d2 | 2022-05-19 01:44:32 +0200 | [diff] [blame] | 296 | <xsl:call-template name="create_struct"> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 297 | <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 298 | <xsl:with-param name="ann_segmentation.xml" select="$ann_segmentation.xml" |
| 299 | as="document-node()"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 300 | <xsl:with-param name="target" select="$targetBaseDir || '/struct/structure.xml'" as="xs:string" |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 301 | /> |
| 302 | </xsl:call-template> |
Piotr Banski | 4f4c2d2 | 2022-05-19 01:44:32 +0200 | [diff] [blame] | 303 | |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 304 | <!-- <xsl:call-template name="create_morpho"> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 305 | <xsl:with-param name="text.xml" select="$text.xml" as="document-node()"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 306 | <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 307 | <xsl:with-param name="ann_segmentation.xml" select="$ann_segmentation.xml" |
| 308 | as="document-node()"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 309 | <xsl:with-param name="ann_morphosyntax.xml" select="$ann_morphosyntax.xml" |
| 310 | as="document-node()"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 311 | <xsl:with-param name="target" select="$targetBaseDir || '/nkjp/morpho.xml'" as="xs:string"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 312 | </xsl:call-template> |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 313 | --> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 314 | <xsl:call-template name="create_text_header"> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 315 | <xsl:with-param name="text.xml" select="$text.xml" as="document-node()"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 316 | <xsl:with-param name="compoundID" select="$compoundID" as="xs:string"/> |
| 317 | <xsl:with-param name="target" select="$targetBaseDir || '/header.xml'" as="xs:string"/> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 318 | </xsl:call-template> |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 319 | |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 320 | </xsl:template> |
| 321 | |
| 322 | <!-- ************************** data.xml ******************* --> |
| 323 | |
| 324 | <xsl:template name="create_data"> |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 325 | <xsl:param name="ann_segmentation.xml" as="document-node()"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 326 | <xsl:param name="compoundID" as="xs:string"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 327 | <xsl:param name="target" as="xs:string"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 328 | <!-- create the data.xml file --> |
| 329 | <xsl:result-document encoding="UTF-8" method="xml" indent="yes" |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 330 | xpath-default-namespace="{$KorAP_namespace}" href="{$target}"> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 331 | |
Akron | 9a8ee3e | 2022-01-31 13:51:49 +0100 | [diff] [blame] | 332 | <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] | 333 | <xsl:element name="raw_text" namespace="{$KorAP_namespace}"> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 334 | <xsl:attribute name="docid" select="$compoundID"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 335 | <xsl:element name="metadata" namespace="{$KorAP_namespace}"> |
| 336 | <xsl:attribute name="file" select="'metadata.xml'"/> |
| 337 | </xsl:element> |
| 338 | |
| 339 | <xsl:element name="text" namespace="{$KorAP_namespace}"> |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 340 | <xsl:variable name="content" as="xs:string+"> |
Piotr Banski | 4f4c2d2 | 2022-05-19 01:44:32 +0200 | [diff] [blame] | 341 | <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]"> |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 342 | <xsl:sequence select=" |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 343 | if (f:is_preceded_by_ws(.,false())) then |
bansp | 9dc1000 | 2022-05-17 22:33:34 +0200 | [diff] [blame] | 344 | ' ' |
| 345 | else |
| 346 | '', ./tei:w"/> |
| 347 | </xsl:for-each> |
| 348 | </xsl:variable> |
| 349 | <xsl:value-of select="string-join($content)"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 350 | </xsl:element> |
Akron | 9a8ee3e | 2022-01-31 13:51:49 +0100 | [diff] [blame] | 351 | </xsl:element> |
bansp | f79443e | 2022-02-25 14:25:33 +0100 | [diff] [blame] | 352 | </xsl:result-document> |
Akron | 9a8ee3e | 2022-01-31 13:51:49 +0100 | [diff] [blame] | 353 | </xsl:template> |
| 354 | |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 355 | <!-- ************************** struct ******************* --> |
| 356 | |
| 357 | <xsl:template name="create_struct"> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 358 | <xsl:param name="compoundID" as="xs:string"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 359 | <xsl:param name="ann_segmentation.xml" as="document-node()"/> |
| 360 | <xsl:param name="target" as="xs:string"/> |
Piotr Banski | 4f4c2d2 | 2022-05-19 01:44:32 +0200 | [diff] [blame] | 361 | |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 362 | <xsl:result-document encoding="UTF-8" method="xml" indent="yes" |
| 363 | xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}"> |
| 364 | <xsl:processing-instruction name="xml-model">href="span.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"</xsl:processing-instruction> |
| 365 | <xsl:element name="layer" namespace="{$KorAP_namespace}"> |
| 366 | <xsl:attribute name="docid" select="$compoundID"/> |
| 367 | <xsl:attribute name="version" select="$KorAP-XML_version"/> |
| 368 | |
| 369 | <xsl:element name="spanList" namespace="{$KorAP_namespace}"> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 370 | <xsl:apply-templates select="$ann_segmentation.xml//tei:text" mode="struct"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 371 | </xsl:element> |
| 372 | </xsl:element> |
| 373 | </xsl:result-document> |
| 374 | </xsl:template> |
| 375 | |
| 376 | <xsl:template match="tei:*" mode="struct"> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 377 | <xsl:variable name="offsets" as="xs:integer+"> |
| 378 | <xsl:variable name="akku" |
| 379 | select="map:merge(tail(fn:accumulator-after('elem-offset-seq')), map {'duplicates': 'use-last'})" |
| 380 | as="map(xs:string,xs:integer+)"/> <!--test later if the merger is really needed here, given how accus work--> |
| 381 | <xsl:sequence select="map:get($akku, string(@xml:id))"/> |
| 382 | </xsl:variable> |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 383 | |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 384 | <xsl:variable name="my_name" select="local-name()" as="xs:string"/> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 385 | <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] | 386 | |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 387 | <xsl:element name="span" namespace="{$KorAP_namespace}"> |
| 388 | <xsl:attribute name="id" select="'s' || $my_index"/> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 389 | <xsl:attribute name="from" select="$offsets[1]"/> |
| 390 | <xsl:attribute name="to" select="$offsets[2]"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 391 | <xsl:attribute name="l" select="f:compute_nesting(.)"/> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 392 | <xsl:if test="local-name() eq 'seg' and $SHOW_ORTH_IN_STRUCT"> |
| 393 | <xsl:comment><xsl:value-of select="fn:normalize-space(.)"/></xsl:comment> |
| 394 | </xsl:if> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 395 | <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] | 396 | <xsl:attribute name="type" select="'struct'"></xsl:attribute> <!-- STRUCT vs. LEX for morpho --> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 397 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 398 | <xsl:attribute name="name" select="'name'"/> |
| 399 | <xsl:value-of select="local-name()"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 400 | </xsl:element> |
| 401 | <xsl:if test="count(@*)"> |
| 402 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
| 403 | <xsl:attribute name="name" select="'attr'"/> |
| 404 | <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0"> |
| 405 | <xsl:attribute name="type" select="'attr'"/> |
| 406 | <xsl:for-each select="@*"> |
| 407 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
| 408 | <xsl:attribute name="name" select="local-name(.)"/> |
| 409 | <xsl:value-of select="."/> |
| 410 | </xsl:element> |
| 411 | </xsl:for-each> |
| 412 | </xsl:element> |
| 413 | </xsl:element> |
| 414 | </xsl:if> |
| 415 | </xsl:element> |
| 416 | </xsl:element> |
| 417 | <xsl:apply-templates mode="struct"> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 418 | <!--<xsl:with-param name="index" select="$my_index"/>--> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 419 | </xsl:apply-templates> |
| 420 | </xsl:template> |
| 421 | |
| 422 | <!-- ************************** morpho ******************* --> |
| 423 | |
| 424 | <xsl:template name="create_morpho"> |
| 425 | <xsl:param name="text.xml" as="document-node()"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 426 | <xsl:param name="compoundID" as="xs:string"/> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 427 | <xsl:param name="ann_segmentation.xml" as="document-node()"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 428 | <xsl:param name="ann_morphosyntax.xml" as="document-node()"/> |
| 429 | <xsl:param name="target" as="xs:string"/> |
| 430 | |
| 431 | <xsl:result-document encoding="UTF-8" method="xml" indent="yes" |
| 432 | xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}"> |
| 433 | <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] | 434 | <xsl:element name="layer" namespace="{$KorAP_namespace}"> |
| 435 | <xsl:attribute name="docid" select="$compoundID"/> |
| 436 | <xsl:attribute name="version" select="$KorAP-XML_version"/> |
| 437 | |
| 438 | <xsl:element name="spanList" namespace="{$KorAP_namespace}"> |
| 439 | <xsl:apply-templates select="$ann_segmentation.xml//tei:text" mode="morpho"> |
| 440 | <xsl:with-param name="ann_morphosyntax.xml" select="$ann_morphosyntax.xml" as="document-node()"/> |
| 441 | </xsl:apply-templates> |
| 442 | </xsl:element> |
| 443 | </xsl:element> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 444 | </xsl:result-document> |
| 445 | </xsl:template> |
| 446 | |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 447 | <xsl:template match="tei:*" mode="morpho"> |
| 448 | <xsl:param name="ini" as="xs:integer" required="no" select="0"/> |
| 449 | <xsl:param name="fin" as="xs:integer" required="no" select="999999999"/> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 450 | <xsl:param name="ann_morphosyntax.xml" as="document-node()"/> |
| 451 | <xsl:variable name="my_name" select="local-name()" as="xs:string"/> |
| 452 | <xsl:variable name="preceding" select="preceding-sibling::*[local-name(.) eq $my_name]"/> |
| 453 | <xsl:variable name="preceding-count" select="count($preceding)"/> |
| 454 | <xsl:variable name="outside-preceding-count" as="xs:integer"> |
| 455 | <xsl:choose> |
| 456 | <xsl:when test="self::tei:s or self::tei:p"> |
| 457 | <xsl:choose> |
| 458 | <xsl:when test="$preceding-count"> |
| 459 | <xsl:sequence select=" |
| 460 | sum(for $p in $preceding |
| 461 | return |
| 462 | count($p/descendant::*))"/> |
| 463 | </xsl:when> |
| 464 | <xsl:otherwise> |
| 465 | <xsl:sequence select="0"/> |
| 466 | </xsl:otherwise> |
| 467 | </xsl:choose> |
| 468 | </xsl:when> |
| 469 | <xsl:otherwise> |
| 470 | <xsl:sequence select="0"/> |
| 471 | </xsl:otherwise> |
| 472 | </xsl:choose> |
| 473 | </xsl:variable> |
Piotr Banski | 09096ee | 2022-05-25 13:41:03 +0200 | [diff] [blame^] | 474 | <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] | 475 | |
| 476 | <xsl:variable name="start" as="xs:integer"> |
| 477 | <xsl:choose> |
| 478 | <xsl:when test="self::tei:text or self::tei:body"> |
| 479 | <xsl:sequence select="0"/> |
| 480 | </xsl:when> |
| 481 | <xsl:when test="self::tei:p"> |
| 482 | <xsl:variable name="first_corresp" |
| 483 | select="descendant::tei:s[1]/descendant::tei:seg[1]/attribute::corresp" |
| 484 | as="attribute(corresp)"/> |
| 485 | <xsl:variable name="numbers" select="substring-after(substring-before($first_corresp,')'),',')"/> |
| 486 | <xsl:sequence select="xs:integer(substring-before($numbers,','))"/> |
| 487 | </xsl:when> |
| 488 | <xsl:when test="self::tei:s"> |
| 489 | <xsl:variable name="first_corresp" |
| 490 | select="descendant::tei:seg[1]/attribute::corresp" |
| 491 | as="attribute(corresp)"/> |
| 492 | <xsl:variable name="numbers" select="substring-after(substring-before($first_corresp,')'),',')"/> |
| 493 | <xsl:sequence select="xs:integer(substring-before($numbers,','))"/> |
| 494 | </xsl:when> |
| 495 | <!--<xsl:when test="self::tei:seg"> |
| 496 | <xsl:variable name="numbers" select="substring-after(substring-before(@corresp,')'),',')"/> |
| 497 | <xsl:sequence select="xs:integer(substring-before($numbers,','))"/> |
| 498 | </xsl:when>--> |
| 499 | </xsl:choose> |
| 500 | </xsl:variable> |
| 501 | <xsl:variable name="end" as="xs:integer" select="f:calc_content_length(.)"> |
| 502 | </xsl:variable> |
| 503 | |
| 504 | <xsl:apply-templates mode="morpho"> |
| 505 | <xsl:with-param name="ini" select="$start" as="xs:integer"/> |
| 506 | <xsl:with-param name="fin" select="$end" as="xs:integer"/> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 507 | <xsl:with-param name="ann_morphosyntax.xml" select="$ann_morphosyntax.xml" as="document-node()"/> |
| 508 | </xsl:apply-templates> |
| 509 | </xsl:template> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 510 | |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 511 | <xsl:template match="tei:seg" mode="morpho"> |
| 512 | <xsl:param name="ini" as="xs:integer" required="no" select="0"/> |
| 513 | <xsl:param name="fin" as="xs:integer" required="no" select="999999999"/> |
| 514 | <xsl:param name="index" as="xs:integer" required="no" select="1"/> |
| 515 | <xsl:param name="ann_morphosyntax.xml" as="document-node()"/> |
| 516 | <!-- I have made a major mess here, but it works... it's so spread out |
| 517 | because I wanted to make sure to be able to look up the individual |
| 518 | constituent values, should anything go wrong --> |
| 519 | <xsl:variable name="my_name" select="local-name()" as="xs:string"/> |
| 520 | <xsl:variable name="my_id" select="@xml:id" as="xs:string"/> |
| 521 | <xsl:variable name="my_morph-seg" as="node()" select="$ann_morphosyntax.xml//tei:seg[substring-after(@corresp,'#') eq $my_id]"/> |
| 522 | <xsl:variable name="my_disamb" select="$my_morph-seg//tei:fs/tei:f[@name eq 'disamb']" as="node()"/> |
| 523 | <xsl:variable name="my_choice-id" select="substring-after($my_disamb//tei:f[@name eq 'choice']/@fVal,'#')" as="xs:string"/> |
| 524 | <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()"/> |
| 525 | <xsl:variable name="chosen-msd" as="xs:string" select="$my_choice-lex/descendant::tei:symbol[@xml:id eq $my_choice-id]/@value"/> |
| 526 | <xsl:variable name="preceding" select="preceding-sibling::*[local-name(.) eq $my_name]"/> |
| 527 | <xsl:variable name="preceding-count" select="count($preceding)"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 528 | <!--<xsl:variable name="outside-preceding-count" as="xs:integer"> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 529 | <xsl:choose> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 530 | <xsl:when test="self::tei:s or self::tei:p"> <!-\- THIS NEEDS TO BE REVISITED AFTER THIS TEMPLATE HAS BECOME MORE SPECIFIC -\-> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 531 | <xsl:choose> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 532 | <xsl:when test="$preceding-count"> commented out for now |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 533 | <xsl:sequence select=" |
| 534 | sum(for $p in $preceding |
| 535 | return |
| 536 | count($p/descendant::*))"/> |
| 537 | </xsl:when> |
| 538 | <xsl:otherwise> |
| 539 | <xsl:sequence select="0"/> |
| 540 | </xsl:otherwise> |
| 541 | </xsl:choose> |
| 542 | </xsl:when> |
| 543 | <xsl:otherwise> |
| 544 | <xsl:sequence select="0"/> |
| 545 | </xsl:otherwise> |
| 546 | </xsl:choose> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 547 | </xsl:variable>--> |
| 548 | <xsl:variable name="my_index" select="$index + 1 + $preceding-count" as="xs:integer"/> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 549 | |
| 550 | <xsl:variable name="start" as="xs:integer"> |
| 551 | <xsl:variable name="numbers" select="substring-after(substring-before(@corresp,')'),',')"/> |
| 552 | <xsl:sequence select="xs:integer(substring-before($numbers,','))"/> |
| 553 | </xsl:variable> |
| 554 | <xsl:variable name="end" as="xs:integer" select="f:calc_content_length(.)"> |
| 555 | </xsl:variable> |
| 556 | <xsl:element name="span" namespace="{$KorAP_namespace}"> |
| 557 | <xsl:attribute name="id" select="'s' || $my_index"/> |
| 558 | <xsl:attribute name="from" select="$start"/> |
| 559 | <xsl:attribute name="to" select="$end"/> |
| 560 | <xsl:attribute name="l" select="f:compute_nesting(.)"/> |
| 561 | <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0"> |
| 562 | <xsl:attribute name="type" select="'lex'"/> |
| 563 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
| 564 | <xsl:attribute name="name" select="'lex'"/> |
| 565 | <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0"> |
| 566 | <xsl:comment select="$my_morph-seg//tei:fs/tei:f[@name eq 'orth']/tei:string"/> |
| 567 | |
| 568 | |
| 569 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
| 570 | <xsl:attribute name="name" select="'lemma'"/> |
| 571 | <xsl:value-of select="$my_choice-lex/tei:f[@name eq 'base']/tei:string"/> |
| 572 | </xsl:element> |
| 573 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
| 574 | <xsl:attribute name="name" select="'pos'"/> |
| 575 | <xsl:value-of select="$my_choice-lex/tei:f[@name eq 'ctag']/tei:symbol/@value"/> |
| 576 | </xsl:element> |
| 577 | <xsl:if test="string-length($chosen-msd)"> |
| 578 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
| 579 | <xsl:attribute name="name" select="'msd'"/> |
| 580 | <xsl:value-of select="$chosen-msd"/> |
| 581 | </xsl:element> |
| 582 | </xsl:if> |
| 583 | <xsl:if test="$my_morph-seg//tei:fs/tei:f[@name eq 'nps']"> |
| 584 | <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0"> |
| 585 | <xsl:attribute name="name" select="'join'"/> |
| 586 | <xsl:value-of select="'left'"/> |
| 587 | </xsl:element> |
| 588 | </xsl:if> |
| 589 | </xsl:element> |
| 590 | </xsl:element> |
| 591 | </xsl:element> |
| 592 | </xsl:element> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 593 | <xsl:apply-templates mode="morpho"> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 594 | <xsl:with-param name="ini" select="$start" as="xs:integer"/> |
| 595 | <xsl:with-param name="fin" select="$end" as="xs:integer"/> |
| 596 | <xsl:with-param name="index" select="$my_index"/> |
| 597 | <xsl:with-param name="ann_morphosyntax.xml" select="$ann_morphosyntax.xml" as="document-node()"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 598 | </xsl:apply-templates>--> |
bansp | 3e5b20c | 2022-03-18 20:22:31 +0100 | [diff] [blame] | 599 | </xsl:template> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 600 | |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 601 | <!-- ************************** TEXT header ******************* --> |
| 602 | |
| 603 | <xsl:template name="create_text_header"> |
| 604 | <xsl:param name="text.xml" as="document-node()"/> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 605 | <xsl:param name="compoundID" as="xs:string"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 606 | <xsl:param name="target" as="xs:string"/> |
| 607 | |
| 608 | <!-- create the local header.xml file --> |
| 609 | <xsl:result-document encoding="UTF-8" method="xml" indent="yes" |
| 610 | xpath-default-namespace="http://ids-mannheim.de/ns/KorAP" href="{$target}"> |
| 611 | |
| 612 | <idsHeader type="document" pattern="text" status="new" version="1.1" TEIform="teiHeader"> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 613 | <xsl:apply-templates select="$text.xml//tei:TEI/tei:teiHeader/tei:*" mode="text"> |
| 614 | <xsl:with-param name="compoundID" as="xs:string" select="$compoundID" tunnel="yes"/> |
| 615 | </xsl:apply-templates> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 616 | </idsHeader> |
| 617 | </xsl:result-document> |
| 618 | </xsl:template> |
| 619 | |
| 620 | <xsl:template match="tei:fileDesc" mode="text"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 621 | <xsl:element name="{local-name()}"> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 622 | <xsl:apply-templates mode="text"/> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 623 | </xsl:element> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 624 | </xsl:template> |
| 625 | |
| 626 | <xsl:template match="tei:title" mode="text"> |
| 627 | <t.title> |
| 628 | <xsl:apply-templates/> |
| 629 | </t.title> |
| 630 | </xsl:template> |
| 631 | |
| 632 | <xsl:template match="tei:titleStmt" mode="text"> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 633 | <xsl:param name="compoundID" as="xs:string" tunnel="yes"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 634 | <titleStmt> |
| 635 | <textSigle> |
bansp | e726b4a | 2022-03-28 05:47:45 +0200 | [diff] [blame] | 636 | <xsl:value-of select="$compoundID"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 637 | </textSigle> |
| 638 | <xsl:apply-templates mode="text"/> |
| 639 | </titleStmt> |
| 640 | </xsl:template> |
| 641 | |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 642 | <xsl:template match="tei:publicationStmt" mode="text"> |
| 643 | <xsl:element name="{local-name()}"> |
| 644 | <xsl:apply-templates mode="text"/> |
| 645 | </xsl:element> |
| 646 | </xsl:template> |
| 647 | |
| 648 | <xsl:template match="tei:availability" mode="text"> |
| 649 | <xsl:element name="{local-name()}"> |
| 650 | <xsl:apply-templates mode="text" select="@* | *"/> |
| 651 | </xsl:element> |
| 652 | </xsl:template> |
| 653 | |
| 654 | <xsl:template match="tei:profileDesc" mode="text"> |
| 655 | <xsl:element name="{local-name()}"> |
| 656 | <xsl:apply-templates mode="text"/> |
| 657 | </xsl:element> |
| 658 | </xsl:template> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 659 | |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 660 | <xsl:template match="tei:textClass" mode="text"> |
| 661 | <xsl:element name="{local-name()}"> |
| 662 | <xsl:apply-templates mode="text" select="@* | *"/> |
| 663 | </xsl:element> |
| 664 | </xsl:template> |
| 665 | |
| 666 | <xsl:template match="tei:catRef" mode="text corpus"> |
| 667 | <xsl:element name="{local-name()}"> |
| 668 | <xsl:apply-templates mode="text" select="@* | *"/> |
| 669 | </xsl:element> |
| 670 | </xsl:template> |
| 671 | |
| 672 | <xsl:template match="@status | @scheme | @target | @type | @xml:id[ancestor::tei:classDecl] | @xml:lang" mode="text corpus"> |
| 673 | <xsl:copy-of select="."/> |
| 674 | </xsl:template> |
| 675 | |
| 676 | <xsl:template match="tei:p" mode="text corpus"> |
| 677 | <xsl:element name="{local-name()}"> |
| 678 | <xsl:apply-templates mode="header-text"/> |
| 679 | </xsl:element> |
| 680 | </xsl:template> |
| 681 | |
| 682 | |
| 683 | <!-- OPTIMIZATION has to take modes into account --> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 684 | <!-- ************************** CORPUS header ******************* --> |
| 685 | <xsl:template name="create_corpus_header"> |
| 686 | <xsl:param name="text.xml" as="document-node()"/> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 687 | <xsl:param name="target" as="xs:string"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 688 | |
| 689 | <!-- create the corpus-level header.xml file --> |
bansp | 5f84173 | 2022-03-16 06:27:31 +0100 | [diff] [blame] | 690 | <xsl:result-document encoding="UTF-8" method="xml" indent="yes" href="{$target}"> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 691 | |
| 692 | <!--doctype-public="{$publicDoctypeI5}" |
| 693 | doctype-system="{$systemDoctypeI5}"> |
| 694 | these are, sadly, useless |
| 695 | --> |
| 696 | |
| 697 | <idsHeader type="corpus" pattern="text" status="new" version="1.1" TEIform="teiHeader"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 698 | <xsl:apply-templates select="$text.xml/tei:teiCorpus/tei:teiHeader/tei:*" mode="corpus"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 699 | </idsHeader> |
| 700 | </xsl:result-document> |
| 701 | </xsl:template> |
| 702 | |
| 703 | <xsl:template match="tei:fileDesc" mode="corpus"> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 704 | <xsl:element name="{local-name()}"> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 705 | <xsl:apply-templates mode="corpus"/> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 706 | </xsl:element> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 707 | </xsl:template> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 708 | |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 709 | |
| 710 | <xsl:template match="tei:title" mode="corpus"> |
| 711 | <c.title> |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 712 | <xsl:apply-templates mode="corpus" select="@*"/> |
| 713 | <xsl:apply-templates mode="header-text"/> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 714 | </c.title> |
| 715 | </xsl:template> |
| 716 | |
| 717 | <xsl:template match="tei:titleStmt" mode="corpus"> |
| 718 | <titleStmt> |
| 719 | <korpusSigle> |
| 720 | <xsl:value-of select="$corpusID"/> |
| 721 | </korpusSigle> |
| 722 | <xsl:apply-templates mode="corpus"/> |
| 723 | </titleStmt> |
| 724 | </xsl:template> |
| 725 | |
bansp | 9103aab | 2022-03-19 05:10:21 +0100 | [diff] [blame] | 726 | <xsl:template match="tei:publicationStmt" mode="corpus"> |
| 727 | <xsl:element name="{local-name()}"> |
| 728 | <xsl:apply-templates mode="corpus"/> |
| 729 | </xsl:element> |
| 730 | </xsl:template> |
| 731 | |
| 732 | <xsl:template match="tei:availability" mode="corpus"> |
| 733 | <xsl:element name="{local-name()}"> |
| 734 | <xsl:apply-templates mode="corpus" select="@* | *"/> |
| 735 | </xsl:element> |
| 736 | </xsl:template> |
| 737 | |
| 738 | <xsl:template match="tei:encodingDesc" mode="corpus"> |
| 739 | <xsl:element name="{local-name()}"> |
| 740 | <xsl:apply-templates mode="corpus"/> |
| 741 | </xsl:element> |
| 742 | </xsl:template> |
| 743 | |
| 744 | <xsl:template match="tei:classDecl | tei:taxonomy | tei:category | tei:taxonomy/tei:bibl" mode="corpus"> |
| 745 | <xsl:element name="{local-name()}"> |
| 746 | <xsl:apply-templates mode="corpus" select="@* | *"/> |
| 747 | </xsl:element> |
| 748 | </xsl:template> |
| 749 | |
| 750 | <xsl:template match="tei:bibl/tei:title | tei:edition | tei:desc" mode="corpus"> |
| 751 | <xsl:element name="{local-name()}"> |
| 752 | <xsl:apply-templates mode="corpus" select="@*"/> |
| 753 | <xsl:apply-templates mode="header-text"/> |
| 754 | </xsl:element> |
| 755 | </xsl:template> |
| 756 | <!-- |
| 757 | <xsl:template match="tei:textClass" mode="corpus"> |
| 758 | <xsl:element name="{local-name()}"> |
| 759 | <xsl:apply-templates mode="corpus" select="@* | *"/> |
| 760 | </xsl:element> |
| 761 | </xsl:template> |
| 762 | |
| 763 | <xsl:template match="tei:catRef" mode="corpus"> |
| 764 | <xsl:element name="{local-name()}"> |
| 765 | <xsl:apply-templates mode="corpus" select="@* | *"/> |
| 766 | </xsl:element> |
| 767 | </xsl:template> |
| 768 | --> |
bansp | 5e2d1c0 | 2022-03-10 04:51:40 +0100 | [diff] [blame] | 769 | |
| 770 | |
| 771 | |
| 772 | <!-- this template can be called by the XSPEC test; TODO: find a way to call the main() template directly --> |
| 773 | <!-- I have not fully handled the param transmission, which would have to be kludged in just for the sake of XSPec, |
| 774 | because I'm disabling this for now, due to XSpec design issues; relevant links, a.o.: |
| 775 | |
| 776 | https://stackoverflow.com/questions/64933277/what-is-the-cause-of-error-cannot-execute-xslresult-document-while-evaluating |
| 777 | https://www.balisage.net/Proceedings/vol25/html/Galtman01/BalisageVol25-Galtman01.html |
| 778 | |
| 779 | In short: the internal design of XSpec forces kludges when one wants to use xsl:result-document in their stylesheets. But I don't |
| 780 | want to be strangled by kludges at the beginning of work, I've already lost quite a bit of time on this investigation, |
| 781 | I will therefore "just code" and then can think of externalizing bits of templates if we want to play with tests. For now, |
| 782 | 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. |
| 783 | |
| 784 | --> |
| 785 | <!--<xsl:template name="test_full"> |
| 786 | <xsl:param name="corpusID"/> |
| 787 | <xsl:param name="docID"/> |
| 788 | <xsl:param name="textID"/> |
| 789 | <xsl:call-template name="xsl:initial-template"/> |
| 790 | </xsl:template>--> |
| 791 | |
Piotr Banski | 4f4c2d2 | 2022-05-19 01:44:32 +0200 | [diff] [blame] | 792 | <xsl:function name="f:calc_content_length" as="xs:integer"> |
| 793 | <xsl:param name="node" as="node()"/> |
| 794 | <xsl:choose> |
| 795 | <xsl:when test="$node/self::tei:text or $node/self::tei:body"> |
| 796 | <xsl:variable name="last_corresp" |
| 797 | select="$node/descendant::tei:p[last()]/descendant::tei:s[last()]/descendant::tei:seg[count(@nkjp:rejected) eq 0 or @nkjp:rejected ne 'true'][last()]/attribute::corresp" |
| 798 | as="attribute(corresp)"/> |
| 799 | <xsl:variable name="numbers" select="substring-after(substring-before($last_corresp,')'),',')"/> |
| 800 | <xsl:sequence select="xs:integer(substring-before($numbers,',')) + xs:integer(substring-after($numbers,','))"/> |
| 801 | </xsl:when> |
| 802 | <xsl:when test="$node/self::tei:p"> |
| 803 | <xsl:variable name="last_corresp" |
| 804 | select="$node/descendant::tei:s[last()]/descendant::tei:seg[count(@nkjp:rejected) eq 0 or @nkjp:rejected ne 'true'][last()]/attribute::corresp" |
| 805 | as="attribute(corresp)"/> |
| 806 | <xsl:variable name="numbers" select="substring-after(substring-before($last_corresp,')'),',')"/> |
| 807 | <xsl:sequence select="xs:integer(substring-before($numbers,',')) + xs:integer(substring-after($numbers,','))"/> |
| 808 | </xsl:when> |
| 809 | <xsl:when test="$node/self::tei:s"> |
| 810 | <xsl:variable name="last_corresp" |
| 811 | select="$node/descendant::tei:seg[count(@nkjp:rejected) eq 0 or @nkjp:rejected ne 'true'][last()]/attribute::corresp" |
| 812 | as="attribute(corresp)"/> |
| 813 | <xsl:variable name="numbers" select="substring-after(substring-before($last_corresp,')'),',')"/> |
| 814 | <xsl:sequence select="xs:integer(substring-before($numbers,',')) + xs:integer(substring-after($numbers,','))"/> |
| 815 | </xsl:when> |
| 816 | <xsl:otherwise> |
| 817 | <xsl:variable name="numbers" select="substring-after(substring-before($node/@corresp,')'),',')"/> |
| 818 | <xsl:if test="$node/self::tei:seg and count($node/@nkjp:rejected)"> |
| 819 | <!-- REMOVE THIS --> |
| 820 | <xsl:message select="$numbers"/> |
| 821 | </xsl:if> |
| 822 | <xsl:sequence select="xs:integer(substring-before($numbers,',')) + xs:integer(substring-after($numbers,','))"/> |
| 823 | </xsl:otherwise> |
| 824 | </xsl:choose> |
| 825 | </xsl:function> |
| 826 | |
Akron | 9a8ee3e | 2022-01-31 13:51:49 +0100 | [diff] [blame] | 827 | </xsl:stylesheet> |
Piotr Banski | 6a4a252 | 2022-05-24 01:16:47 +0200 | [diff] [blame] | 828 | |
Piotr Banski | fdc858a | 2022-05-25 02:40:32 +0200 | [diff] [blame] | 829 | <!-- template for serializing maps in messages <xsl:message select="('map:',serialize($map, map{'method':'adaptive'}))"/> --> |