| Marc Kupietz | 7cc8fc7 | 2024-05-26 16:49:38 +0200 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 2 | <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:opf="http://www.idpf.org/2007/opf" |
| 3 | xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ids="http://www.ids-mannheim.de/ids" xmlns:hlu="http://www.ids-mannheim.de/hlu" xmlns:saxon="http://saxon.sf.net/" |
| 4 | xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:map="http://www.w3.org/2005/xpath-functions/map" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:srw="http://www.loc.gov/zing/srw/" |
| 5 | xmlns:oai="http://www.openarchives.org/OAI/2.0/oai_dc/" exclude-result-prefixes="xs opf dc ids hlu map saxon xhtml xsi srw oai"> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 6 | |
| 7 | <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" saxon:line-length="1000"/> |
| 8 | <xsl:strip-space elements="*"/> |
| 9 | |
| Marc Kupietz | 7f3fe79 | 2024-07-26 15:28:26 +0200 | [diff] [blame] | 10 | <xsl:param name="debug"/> |
| Nicolas Arnold | 8f5a96b | 2025-01-15 19:26:42 +0100 | [diff] [blame] | 11 | <!--xsl:variable name="debug" select="true()"/--> |
| Marc Kupietz | 7f3fe79 | 2024-07-26 15:28:26 +0200 | [diff] [blame] | 12 | |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 13 | <xsl:variable name="ev"/> |
| 14 | <xsl:variable name="x"/> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 15 | |
| 16 | <xsl:variable name="idno" as="xs:string" select="replace(base-uri(), '.*/([0-9]{9,13}X?).*', '$1')"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 17 | |
| Rebecca Wilm | f614a4b | 2024-05-07 10:19:43 +0200 | [diff] [blame] | 18 | <xsl:variable name="idno_type"> |
| Rebecca Wilm | e5f055a | 2024-05-10 15:07:50 +0200 | [diff] [blame] | 19 | <xsl:choose> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 20 | <xsl:when test="starts-with($idno, '1')"> |
| Rebecca Wilm | e5f055a | 2024-05-10 15:07:50 +0200 | [diff] [blame] | 21 | <xsl:value-of select="'IDN'"/> |
| 22 | </xsl:when> |
| 23 | <xsl:otherwise> |
| 24 | <xsl:value-of select="'ISBN'"/> |
| 25 | </xsl:otherwise> |
| 26 | </xsl:choose> |
| Rebecca Wilm | f614a4b | 2024-05-07 10:19:43 +0200 | [diff] [blame] | 27 | </xsl:variable> |
| Rebecca Wilm | 2f345ff | 2024-07-30 16:58:25 +0200 | [diff] [blame] | 28 | |
| Marc Kupietz | 1c3ebca | 2024-09-22 13:49:28 +0200 | [diff] [blame] | 29 | <xsl:param name="buchpreis"/> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 30 | |
| Marc Kupietz | 0df2a57 | 2024-05-26 16:54:27 +0200 | [diff] [blame] | 31 | <xsl:variable name="dnbBookdataQuery" as="xs:string"> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 32 | <xsl:value-of disable-output-escaping="yes" |
| 33 | select="concat('https://services.dnb.de/sru/dnb?version=1.1&operation=searchRetrieve&query=', $idno_type, '%3D', $idno, '&recordSchema=oai_dc')"/> |
| Nicolas Arnold | 8f5a96b | 2025-01-15 19:26:42 +0100 | [diff] [blame] | 34 | <!-- |
| 35 | <xsl:if test="$debug"> |
| 36 | <xsl:message select="concat('debug: Printing idno, just in case ', $idno)"/> |
| 37 | </xsl:if> |
| 38 | <xsl:value-of disable-output-escaping="yes" select="concat('https://services.dnb.de/sru/dnb?version=1.1&operation=searchRetrieve&query=', $idno_type, '%3D', $idno, '&recordSchema=oai_dc')"/> |
| 39 | >>>>>>> Stashed changes |
| 40 | --> |
| Marc Kupietz | 0df2a57 | 2024-05-26 16:54:27 +0200 | [diff] [blame] | 41 | </xsl:variable> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 42 | <xsl:variable name="dnbBookdata"> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 43 | <xsl:if test="$debug"> |
| 44 | <xsl:message select="concat('debug message dnbBookdataQuery: ', $dnbBookdataQuery)"/> |
| 45 | <xsl:message select="concat('debug message idno: ', $idno)"/> |
| 46 | <xsl:message select=" |
| 47 | concat('debug message original title from static metadata: ', if (starts-with($idno, '8')) then |
| 48 | doc('static_metadata.xml')//oai:dc[dc:identifier = $idno]//dc:title |
| 49 | else |
| 50 | '')"/> |
| 51 | </xsl:if> |
| 52 | <xsl:variable name="tmp" select=" |
| 53 | if (starts-with($idno, '8')) then |
| 54 | doc('static_metadata.xml')//oai:dc[dc:identifier = $idno] |
| 55 | else |
| 56 | doc($dnbBookdataQuery)"/> |
| 57 | <xsl:copy-of select=" |
| 58 | if ($tmp//dc:title) then |
| 59 | $tmp |
| 60 | else |
| 61 | doc('static_metadata.xml')//oai:dc[replace(dc:identifier[@xsi:type = 'tel:ISBN'][1], '-', '') = $idno]"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 62 | </xsl:variable> |
| 63 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 64 | <xsl:variable name="autor" select="replace(string-join($dnbBookdata//dc:creator[not(contains(., '[')) or matches(., '\[Verfasser\]')], ' ; '), ' *\[[^\]]*\]', '')"/> |
| 65 | <xsl:variable name="straight_autor" select="normalize-space(replace(hlu:reversedAuthors($autor), ',', ''))"/> |
| 66 | <xsl:variable name="translator" select="replace(string-join($dnbBookdata//dc:creator[matches(., '\[Übersetzer\]')], ' ; '), ' *\[[^\]]*\]', '')"/> |
| 67 | <xsl:variable name="straight_translator" select="normalize-space(replace(hlu:reversedAuthors($translator), ',', ''))"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 68 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 69 | <xsl:variable name="herausgeber" select="replace(string-join($dnbBookdata//dc:creator[matches(., '\[(Herausgeber|Hrsg.)\]')], ' ; '), ' *\[[^\]]*\]', '')"/> |
| 70 | <xsl:variable name="straight_herausgeber" select="normalize-space(replace(hlu:reversedAuthors($herausgeber), ',', ''))"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 71 | |
| 72 | <xsl:variable name="ina"/> |
| 73 | <xsl:variable name="_corpus"/> |
| 74 | <xsl:variable name="ent_known"/> |
| 75 | |
| 76 | |
| 77 | <!-- added HLU 2012-02-09: --> |
| 78 | <xsl:variable name="ent"> |
| 79 | <xsl:choose> |
| 80 | <xsl:when test="$ent_known"> |
| 81 | <xsl:value-of select="$ent_known"/> |
| 82 | </xsl:when> |
| 83 | <xsl:when test="$ev"> |
| 84 | <xsl:value-of select="$ev"/> |
| 85 | </xsl:when> |
| 86 | <xsl:otherwise> |
| 87 | <xsl:value-of select="$j"/> |
| 88 | </xsl:otherwise> |
| 89 | </xsl:choose> |
| 90 | </xsl:variable> |
| 91 | |
| 92 | <xsl:variable name="titel"> |
| Marc Kupietz | 49124fa | 2024-04-10 16:50:01 +0200 | [diff] [blame] | 93 | <xsl:variable name="title-with-subtitles"> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 94 | <xsl:if test="$debug"> |
| Marc Kupietz | 2c7bc7e | 2024-09-30 14:09:25 +0200 | [diff] [blame] | 95 | <xsl:message select="concat('title: ', ($dnbBookdata//dc:title)[1])"/> |
| 96 | </xsl:if> |
| Marc Kupietz | 49124fa | 2024-04-10 16:50:01 +0200 | [diff] [blame] | 97 | <xsl:choose> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 98 | <xsl:when test="contains(($dnbBookdata//dc:title)[1], ':')"> |
| Marc Kupietz | 744d30e | 2024-09-22 12:49:45 +0200 | [diff] [blame] | 99 | <xsl:choose> |
| 100 | <xsl:when test="matches(($dnbBookdata//dc:title)[1], '.*/.*:.*/')"> |
| 101 | <xsl:value-of select="normalize-space(substring-before(($dnbBookdata//dc:title)[1], ':'))"/> |
| 102 | </xsl:when> |
| 103 | <xsl:otherwise> |
| 104 | <xsl:value-of select="normalize-space(substring-before(substring-before(($dnbBookdata//dc:title)[1], '/'), ':'))"/> |
| 105 | </xsl:otherwise> |
| 106 | </xsl:choose> |
| Marc Kupietz | 49124fa | 2024-04-10 16:50:01 +0200 | [diff] [blame] | 107 | </xsl:when> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 108 | <xsl:when test="contains(($dnbBookdata//dc:title)[1], '/')"> |
| Marc Kupietz | 6cb5223 | 2024-04-13 12:28:44 +0200 | [diff] [blame] | 109 | <xsl:value-of select="normalize-space(substring-before(($dnbBookdata//dc:title)[1], '/'))"/> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 110 | </xsl:when> |
| Marc Kupietz | b990354 | 2024-09-30 14:02:18 +0200 | [diff] [blame] | 111 | <xsl:otherwise> |
| 112 | <xsl:value-of select="normalize-space(($dnbBookdata//dc:title)[1])"/> |
| Marc Kupietz | 49124fa | 2024-04-10 16:50:01 +0200 | [diff] [blame] | 113 | </xsl:otherwise> |
| 114 | </xsl:choose> |
| 115 | </xsl:variable> |
| 116 | <xsl:value-of select="normalize-space(replace($title-with-subtitles, '\|.*', ''))"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 117 | </xsl:variable> |
| 118 | |
| 119 | <xsl:variable name="erscheinungsort"> |
| 120 | <xsl:choose> |
| Marc Kupietz | 6cb5223 | 2024-04-13 12:28:44 +0200 | [diff] [blame] | 121 | <xsl:when test="contains(($dnbBookdata//dc:publisher)[1], ':')"> |
| 122 | <xsl:value-of select="normalize-space(substring-before(($dnbBookdata//dc:publisher)[1], ':'))"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 123 | </xsl:when> |
| 124 | <xsl:otherwise> |
| Marc Kupietz | 6cb5223 | 2024-04-13 12:28:44 +0200 | [diff] [blame] | 125 | <xsl:value-of select="normalize-space(($dnbBookdata//dc:publisher)[1])"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 126 | </xsl:otherwise> |
| 127 | </xsl:choose> |
| 128 | </xsl:variable> |
| 129 | |
| Marc Kupietz | d8599fc | 2024-04-14 13:16:56 +0200 | [diff] [blame] | 130 | <xsl:variable name="erscheinungsland" select="ids:country-city($erscheinungsort)"/> |
| 131 | |
| Marc Kupietz | 6cb5223 | 2024-04-13 12:28:44 +0200 | [diff] [blame] | 132 | <xsl:variable name="texttype" select="replace(($dnbBookdata//dc:subject[matches(., '^[A-Z] ')])[1], '^[A-Z] (.*)', '$1')"/> |
| Marc Kupietz | 7df4ccc | 2024-03-16 15:27:45 +0100 | [diff] [blame] | 133 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 134 | <xsl:variable name="genretable"> |
| 135 | <genres> |
| 136 | <genre keyRegex="true.*crime" genre="Roman: True Crime"/> |
| 137 | <genre keyRegex="(krimi|thriller)" genre="Roman: Kriminalroman"/> |
| 138 | <genre keyRegex="arzt.?roman" genre="Roman: Arztroman"/> |
| 139 | <genre keyRegex="(liebes.*roman|dunja|romanze)" genre="Roman: Liebesroman"/> |
| 140 | <genre keyRegex="science.?fiction" genre="Roman: Science-Fiction-Roman"/> |
| 141 | <genre keyRegex="horror" genre="Roman: Horrorroman"/> |
| 142 | <genre keyRegex="grusel" genre="Roman: Gruselroman"/> |
| 143 | <genre keyRegex="vampir.*roman" genre="Roman: Vampirroman"/> |
| 144 | <genre keyRegex="western" genre="Roman: Westernroman"/> |
| 145 | <genre keyRegex="fantasy" genre="Roman: Fantasyroman"/> |
| 146 | <genre keyRegex="mystery" genre="Roman: Mysteryroman"/> |
| 147 | <genre keyRegex="heimat.*roman" genre="Roman: Heimatroman"/> |
| 148 | <genre keyRegex="familien.*roman" genre="Roman: Familienroman"/> |
| 149 | <genre keyRegex="(sex|erotik|erotische|versaute|fick|sm).*roman" genre="Roman: Erotikroman"/> |
| 150 | <genre keyRegex="gay" genre="Roman: Gay-Roman"/> |
| 151 | <genre keyRegex="(sex|erotik|erotische|versaute|fick|sm)" genre="Erzählung: Erotikerzählung"/> |
| 152 | <genre keyRegex="historischer roman" genre="Roman: Historischer Roman"/> |
| 153 | <genre keyRegex="jugend" genre="Jugendliteratur: Jugendliteratur"/> |
| 154 | <!-- wie in KJL --> |
| 155 | <genre keyRegex="(ein roman|der roman)" genre="Roman"/> |
| 156 | <genre keyRegex="erzählung" genre="Erzählung"/> |
| 157 | <genre keyRegex="novelle" genre="Novelle"/> |
| 158 | <genre keyRegex="anthologie" genre="Anthologie"/> |
| 159 | <genre keyRegex="kurzgeschichte" genre="Kurzgeschichte"/> |
| 160 | <genre keyRegex="geschichte" genre="Erzählung"/> |
| 161 | <genre keyRegex="heftroman" genre="Roman: Heftroman"/> |
| 162 | <genre keyRegex="roman" genre="Roman"/> |
| 163 | <genre keyRegex="." genre="Roman"/> |
| 164 | </genres> |
| 165 | </xsl:variable> |
| Marc Kupietz | 9d87e9d | 2024-05-05 15:56:50 +0200 | [diff] [blame] | 166 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 167 | <xsl:variable name="textFullGenre" select="$genretable/genres/genre[matches($dnbBookdata, ./@keyRegex, 'i')][1]/@genre"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 168 | <xsl:variable name="verlag"> |
| 169 | <xsl:choose> |
| Marc Kupietz | 6cb5223 | 2024-04-13 12:28:44 +0200 | [diff] [blame] | 170 | <xsl:when test="contains(($dnbBookdata//dc:publisher)[1], ':')"> |
| 171 | <xsl:value-of select="normalize-space(substring-after(($dnbBookdata//dc:publisher)[1], ':'))"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 172 | </xsl:when> |
| 173 | <xsl:otherwise> |
| Marc Kupietz | 6cb5223 | 2024-04-13 12:28:44 +0200 | [diff] [blame] | 174 | <xsl:value-of select="normalize-space(($dnbBookdata//dc:publisher)[1])"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 175 | </xsl:otherwise> |
| 176 | </xsl:choose> |
| 177 | </xsl:variable> |
| 178 | |
| 179 | <xsl:variable name="erscheinungsjahr"> |
| Marc Kupietz | a5d0118 | 2024-04-14 12:24:02 +0200 | [diff] [blame] | 180 | <xsl:value-of select="replace(($dnbBookdata//dc:date)[1], '.*?((19|20)[0-9][0-9]).*', '$1')"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 181 | </xsl:variable> |
| 182 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 183 | <xsl:variable name="untertitel" select="normalize-space(substring-after(substring-before(($dnbBookdata//dc:title)[1], '/'), ':'))"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 184 | |
| Marc Kupietz | a5d0118 | 2024-04-14 12:24:02 +0200 | [diff] [blame] | 185 | <xsl:variable name="j" select="$erscheinungsjahr"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 186 | |
| 187 | <!-- for BOT+s: --> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 188 | <xsl:variable name="seiten" select="replace($dnbBookdata//dc:format, 'S\.', '')"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 189 | |
| 190 | <!-- fuer BOT+b: --> |
| 191 | <xsl:variable name="_b"> |
| 192 | <xsl:variable name="regexp1" select="'(Band|Bd\.)\s*([0-9]?[0-9]?[0-9])'"/> |
| 193 | <xsl:choose> |
| 194 | <xsl:when test="matches($dnbBookdata, $regexp1)"> |
| 195 | <xsl:analyze-string select="$dnbBookdata//dc:title" regex="{$regexp1}"> |
| 196 | <xsl:matching-substring> |
| 197 | <xsl:value-of select="."/> |
| 198 | </xsl:matching-substring> |
| 199 | </xsl:analyze-string> |
| 200 | </xsl:when> |
| 201 | <xsl:otherwise> |
| 202 | <xsl:value-of select="'.'"/> |
| 203 | </xsl:otherwise> |
| 204 | </xsl:choose> |
| 205 | </xsl:variable> |
| 206 | |
| 207 | <!-- for BOT+x: --> |
| 208 | <xsl:variable name="txtart"> |
| 209 | <xsl:choose> |
| 210 | <xsl:when test="$x"> |
| 211 | <xsl:value-of select="concat('[', $x, ']')"/> |
| 212 | </xsl:when> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 213 | <xsl:when test="matches($untertitel, '([Rr]oman|[Ee]rzählung(en)?|[Aa]nthologie|[Gg]eschichte(n)?|[Nn]ovelle)')"> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 214 | <xsl:value-of |
| Nicolas Arnold | 2635563 | 2024-05-10 15:25:41 +0200 | [diff] [blame] | 215 | select="concat('[', replace(replace($untertitel, '.*?(((^|\P{L})\p{L}+)?([Rr]oman|[Ee]rzählung(en)?|[Aa]nthologie|[Gg]eschichte(n)?|[Nn]ovelle)).*', '$1'), '\P{L}*(.+)', '$1'), ']')" |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 216 | /> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 217 | </xsl:when> |
| 218 | <xsl:otherwise> |
| 219 | <xsl:value-of>Roman</xsl:value-of> |
| 220 | </xsl:otherwise> |
| 221 | </xsl:choose> |
| 222 | </xsl:variable> |
| 223 | |
| 224 | |
| 225 | |
| 226 | <!-- fuer BOTd: --> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 227 | <xsl:variable name="dok" select=" |
| 228 | concat((if (string-length($autor) > 0) then |
| 229 | concat($straight_autor, ': ') |
| 230 | else |
| 231 | ''), $titel, ', ', $txtart, ', (', $j, ')')"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 232 | |
| 233 | <!-- END variables derived from sru request to dnb archive --> |
| 234 | |
| 235 | |
| Marc Kupietz | 94bbe6b | 2024-04-10 20:35:48 +0200 | [diff] [blame] | 236 | <xsl:variable name="corpus_sigle" select="concat('DNB', substring($erscheinungsjahr, 3, 2))"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 237 | |
| 238 | <!-- for BOTD: --> |
| 239 | <!-- Dokumentsigle muss zusammen mit Korpussigle (z.B DIV fuer loz-div und loz-div-pub) eindeutig sein --> |
| 240 | <xsl:variable name="doc_sigle"> |
| 241 | <xsl:variable name="firstContentWordTitleInitial"> |
| 242 | <xsl:variable name="helper"> |
| 243 | <xsl:analyze-string select="$titel" regex="\w+"> |
| 244 | <xsl:matching-substring> |
| 245 | <xsl:choose> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 246 | <xsl:when test="matches(., '^[A-Z]') and not(matches(., '^(Der|Die|Das|Des|Ein|Eine|Eines|Einmal|Von|Mit|Zu|Zur)$'))"> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 247 | <!-- TODO: Fktnswoerter nachtragen --> |
| 248 | <xsl:sequence select="."/> |
| 249 | </xsl:when> |
| 250 | <xsl:otherwise/> |
| 251 | </xsl:choose> |
| 252 | </xsl:matching-substring> |
| 253 | </xsl:analyze-string> |
| 254 | </xsl:variable> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 255 | <xsl:value-of select="upper-case(substring(normalize-space(replace($helper, '\s+.+$', '')), 1, 3))"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 256 | <!-- longest match of .+ --> |
| 257 | </xsl:variable> |
| Marc Kupietz | 77b6aa9 | 2024-04-21 17:31:43 +0200 | [diff] [blame] | 258 | <xsl:variable name="authorInitials"> |
| 259 | <xsl:choose> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 260 | <xsl:when test="contains($autor, ';')"> |
| 261 | <xsl:variable name="lastname_aut1" select="upper-case(substring(normalize-space($autor), 1, 1))"/> |
| 262 | <xsl:variable name="lastname_aut2" select="replace($autor, '.*?;.*?([A-Z]).*', '$1')"/> |
| 263 | <xsl:value-of select="concat($lastname_aut1, $lastname_aut2)"/> |
| Marc Kupietz | 77b6aa9 | 2024-04-21 17:31:43 +0200 | [diff] [blame] | 264 | </xsl:when> |
| 265 | <xsl:otherwise> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 266 | <xsl:variable name="lastname_aut1" select="upper-case(substring(normalize-space(substring-before($autor, ',')), 1, 1))"/> |
| 267 | <xsl:variable name="firstname_aut1" select="upper-case(substring(normalize-space(substring-after($autor, ',')), 1, 1))"/> |
| Marc Kupietz | 77b6aa9 | 2024-04-21 17:31:43 +0200 | [diff] [blame] | 268 | <xsl:value-of select="concat($lastname_aut1, $firstname_aut1)"/> |
| 269 | </xsl:otherwise> |
| 270 | </xsl:choose> |
| 271 | </xsl:variable> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 272 | <xsl:value-of select="substring(replace(normalize-unicode(concat($authorInitials, $firstContentWordTitleInitial), 'NFKD'), '[^A-Z]', ''), 1, 3)"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 273 | </xsl:variable> |
| 274 | |
| 275 | |
| Marc Kupietz | 0c24663 | 2024-04-29 07:08:23 +0200 | [diff] [blame] | 276 | <xsl:variable name="text_sigle" select="replace($idno, '.*([0-9]{5})[0-9X]$', '$1')"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 277 | <xsl:variable name="sigle" select="concat($corpus_sigle, '/', $doc_sigle, '.', $text_sigle)"/> |
| 278 | |
| 279 | <!-- fuer BOT+xy: (?) --> |
| 280 | <xsl:variable name="xyref"> |
| Marc Kupietz | 0df2a57 | 2024-05-26 16:54:27 +0200 | [diff] [blame] | 281 | <xsl:value-of select="base-uri(.)"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 282 | <xsl:text>; </xsl:text> |
| Marc Kupietz | 0c24663 | 2024-04-29 07:08:23 +0200 | [diff] [blame] | 283 | <xsl:text>IDNO:</xsl:text> |
| 284 | <xsl:value-of select="$idno"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 285 | <xsl:text>; </xsl:text> |
| 286 | <xsl:value-of select="string-join($dnbBookdata//dc:identifier)"/> |
| 287 | </xsl:variable> |
| 288 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 289 | <xsl:variable name="long-reference" select="concat($sigle, ' ', $autor, ': ', $titel, '. ', $erscheinungsort, ': ', $verlag, ', ', $erscheinungsjahr)"/> |
| Marc Kupietz | b660ed6 | 2024-03-16 11:45:53 +0100 | [diff] [blame] | 290 | |
| Nicolas Arnold | f84fcec | 2025-01-15 11:57:55 +0100 | [diff] [blame] | 291 | <!-- NA --> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 292 | <xsl:variable name="bot_title" select="concat($sigle, ' ', $autor, ': ', $titel, '. ', $erscheinungsort, ': ', $verlag, ', ', $erscheinungsjahr)"/> |
| Nicolas Arnold | f84fcec | 2025-01-15 11:57:55 +0100 | [diff] [blame] | 293 | <!-- end NA --> |
| 294 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 295 | <xsl:variable name="short-reference" select="concat($straight_autor, ': ', $titel, ' (', $erscheinungsjahr, ')')"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 296 | |
| Nicolas Arnold | 8f5a96b | 2025-01-15 19:26:42 +0100 | [diff] [blame] | 297 | <xsl:variable name="dtitle" select="concat($straight_autor, ': ', $titel, ' (', $erscheinungsjahr, ')')"/> |
| Nicolas Arnold | f84fcec | 2025-01-15 11:57:55 +0100 | [diff] [blame] | 298 | |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 299 | <xsl:template match="/"> |
| Nicolas Arnold | 8038896 | 2025-01-15 19:35:09 +0100 | [diff] [blame] | 300 | <!-- for debugging purposes |
| Marc Kupietz | 9864524 | 2024-05-26 16:52:47 +0200 | [diff] [blame] | 301 | <xsl:message select="concat('uri: ', base-uri())"/> |
| 302 | <xsl:message select="concat('idno: ', $idno)"/> |
| 303 | |
| 304 | <xsl:message> |
| 305 | dnbBookdataQuery: <xsl:value-of select="$dnbBookdataQuery"/> |
| 306 | </xsl:message> |
| 307 | |
| 308 | <xsl:message> |
| 309 | <xsl:copy-of select="$dnbBookdata"/> |
| 310 | </xsl:message> |
| Nicolas Arnold | 8038896 | 2025-01-15 19:35:09 +0100 | [diff] [blame] | 311 | <!- --> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 312 | |
| 313 | <xsl:if test="not($dnbBookdata//oai:dc)"> |
| Marc Kupietz | 2c7bc7e | 2024-09-30 14:09:25 +0200 | [diff] [blame] | 314 | <xsl:message terminate="yes" default-mode="text">ERROR: No metadata found for IDNO: <xsl:value-of select="$idno"/> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 315 | <xsl:text> Query was: </xsl:text> |
| 316 | <xsl:value-of disable-output-escaping="yes" select="replace($dnbBookdataQuery, '&', '%38')"/> |
| 317 | <xsl:text> Retrieved response: </xsl:text> |
| 318 | <xsl:copy-of select="$dnbBookdata"/> |
| Marc Kupietz | 2c7bc7e | 2024-09-30 14:09:25 +0200 | [diff] [blame] | 319 | </xsl:message> |
| 320 | </xsl:if> |
| 321 | |
| Marc Kupietz | b7a4f6c | 2024-04-19 11:35:25 +0200 | [diff] [blame] | 322 | <xsl:if test="not($j)"> |
| Marc Kupietz | 0c24663 | 2024-04-29 07:08:23 +0200 | [diff] [blame] | 323 | <xsl:message terminate="yes">ERROR: No dc:date found for IDNO: <xsl:value-of select="$idno"/></xsl:message> |
| Marc Kupietz | b7a4f6c | 2024-04-19 11:35:25 +0200 | [diff] [blame] | 324 | </xsl:if> |
| 325 | |
| Marc Kupietz | 815cc6c | 2024-04-19 12:44:44 +0200 | [diff] [blame] | 326 | <xsl:if test="not(normalize-space($titel))"> |
| Marc Kupietz | 0c24663 | 2024-04-29 07:08:23 +0200 | [diff] [blame] | 327 | <xsl:message terminate="yes">ERROR: No title found for IDNO: <xsl:value-of select="$idno"/></xsl:message> |
| Marc Kupietz | 815cc6c | 2024-04-19 12:44:44 +0200 | [diff] [blame] | 328 | </xsl:if> |
| 329 | |
| Marc Kupietz | 2badfb1 | 2024-04-19 12:59:40 +0200 | [diff] [blame] | 330 | <xsl:if test="not(normalize-space($autor))"> |
| Marc Kupietz | 0c24663 | 2024-04-29 07:08:23 +0200 | [diff] [blame] | 331 | <xsl:message terminate="yes">ERROR: No author found for IDNO: <xsl:value-of select="$idno"/></xsl:message> |
| Marc Kupietz | 2badfb1 | 2024-04-19 12:59:40 +0200 | [diff] [blame] | 332 | </xsl:if> |
| 333 | |
| Nicolas Arnold | 1fbd37f | 2024-06-28 15:10:47 +0200 | [diff] [blame] | 334 | <xsl:if test="not(matches($sigle, '^[A-Z]{2,3}[0-9]{2}/[A-Z]{2,3}\.[0-9]{5}$'))"> |
| Marc Kupietz | 0c24663 | 2024-04-29 07:08:23 +0200 | [diff] [blame] | 335 | <xsl:message terminate="yes">ERROR: Invalid sigle »<xsl:value-of select="$sigle"/>« for IDNO: <xsl:value-of select="$idno"/></xsl:message> |
| Marc Kupietz | 09745e1 | 2024-04-21 12:54:10 +0200 | [diff] [blame] | 336 | </xsl:if> |
| 337 | |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 338 | <idsDoc TEIform="TEI.2" type="text" version="1.0"> |
| 339 | <idsHeader TEIform="teiHeader" pattern="text" status="new" type="document" version="1.1"> |
| 340 | <fileDesc> |
| 341 | <titleStmt> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 342 | <dokumentSigle> |
| 343 | <xsl:value-of select="string-join(($corpus_sigle, $doc_sigle), '/')"/> |
| 344 | </dokumentSigle> |
| 345 | <d.title> |
| Nicolas Arnold | 8f5a96b | 2025-01-15 19:26:42 +0100 | [diff] [blame] | 346 | <!-- NA: use separate dtitle variable, to have independent control over $short-reference --> |
| 347 | <xsl:value-of select="$dtitle"/> |
| 348 | <!-- END NA --> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 349 | </d.title> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 350 | </titleStmt> |
| 351 | <publicationStmt> |
| 352 | <distributor/> |
| 353 | <pubAddress/> |
| 354 | <availability region="world" status="unknown">QAO-NC</availability> |
| 355 | <pubDate/> |
| 356 | </publicationStmt> |
| 357 | <sourceDesc> |
| 358 | <biblStruct> |
| 359 | <monogr> |
| 360 | <h.title type="main"/> |
| 361 | <imprint/> |
| 362 | </monogr> |
| 363 | </biblStruct> |
| 364 | </sourceDesc> |
| 365 | </fileDesc> |
| 366 | </idsHeader> |
| 367 | <idsText version="1.0"> |
| 368 | <idsHeader TEIform="teiHeader" pattern="text" status="new" type="text" version="1.1"> |
| 369 | <fileDesc> |
| 370 | <titleStmt> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 371 | <textSigle> |
| 372 | <xsl:sequence select="$sigle"/> |
| 373 | </textSigle> |
| Nicolas Arnold | f84fcec | 2025-01-15 11:57:55 +0100 | [diff] [blame] | 374 | <!-- NA --> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 375 | <t.title assemblage="regular"> |
| 376 | <xsl:value-of select="$bot_title"/> |
| 377 | </t.title> |
| Nicolas Arnold | f84fcec | 2025-01-15 11:57:55 +0100 | [diff] [blame] | 378 | <!-- end NA --> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 379 | </titleStmt> |
| 380 | <publicationStmt> |
| 381 | <distributor/> |
| 382 | <pubAddress/> |
| Rebecca Wilm | 7bb2b6f | 2024-06-17 10:34:47 +0200 | [diff] [blame] | 383 | <xsl:for-each select="$dnbBookdata//dc:identifier"> |
| 384 | <xsl:variable name="type" select="substring-after(@xsi:type, ':')"/> |
| 385 | <xsl:choose> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 386 | <xsl:when test="@xsi:type = 'tel:ISBN'"> |
| 387 | <xsl:if test="matches(., '(^([0-9]|-)+X?).*')"> |
| 388 | <idno type="{$type}"> |
| 389 | <xsl:value-of select="replace(., '(([0-9]|-)+X?).*', '$1')"/> |
| 390 | </idno> |
| Rebecca Wilm | 7bb2b6f | 2024-06-17 10:34:47 +0200 | [diff] [blame] | 391 | </xsl:if> |
| 392 | </xsl:when> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 393 | <xsl:when test="$type = 'URL' and contains(., '/urn:nbn:de')"> |
| 394 | <idno rend="URN;{tokenize(., '/')[last()]}" type="URL"> |
| 395 | <xsl:value-of select="."/> |
| 396 | </idno> |
| Marc Kupietz | c4ea409 | 2024-07-25 11:00:00 +0200 | [diff] [blame] | 397 | </xsl:when> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 398 | <xsl:otherwise> |
| 399 | <idno type="{$type}"> |
| 400 | <xsl:value-of select="."/> |
| 401 | </idno> |
| 402 | </xsl:otherwise> |
| Rebecca Wilm | 7bb2b6f | 2024-06-17 10:34:47 +0200 | [diff] [blame] | 403 | </xsl:choose> |
| 404 | </xsl:for-each> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 405 | <availability region="world" status="unknown">QAO-NC</availability> |
| 406 | <pubDate/> |
| 407 | </publicationStmt> |
| 408 | <sourceDesc> |
| 409 | <biblStruct> |
| 410 | <monogr> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 411 | <h.title type="main"> |
| 412 | <xsl:value-of select="$titel"/> |
| 413 | </h.title> |
| 414 | <h.title type="sub"> |
| 415 | <xsl:value-of select="$untertitel"/> |
| 416 | </h.title> |
| 417 | <h.author> |
| 418 | <xsl:value-of select="$autor"/> |
| 419 | </h.author> |
| Marc Kupietz | eaa9013 | 2024-04-26 18:14:40 +0200 | [diff] [blame] | 420 | <xsl:if test="$translator"> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 421 | <editor role="translator"> |
| 422 | <xsl:value-of select="$translator"/> |
| 423 | </editor> |
| Marc Kupietz | eaa9013 | 2024-04-26 18:14:40 +0200 | [diff] [blame] | 424 | </xsl:if> |
| Marc Kupietz | 15e7d61 | 2024-04-26 18:16:39 +0200 | [diff] [blame] | 425 | <xsl:if test="$herausgeber"> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 426 | <editor role="editor"> |
| 427 | <xsl:value-of select="$herausgeber"/> |
| 428 | </editor> |
| Marc Kupietz | 15e7d61 | 2024-04-26 18:16:39 +0200 | [diff] [blame] | 429 | </xsl:if> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 430 | <edition> |
| 431 | <further/> |
| 432 | <kind>E-Book-Ausgabe</kind> |
| 433 | <appearance>EPUB-Datei</appearance> |
| 434 | </edition> |
| 435 | <imprint> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 436 | <publisher> |
| 437 | <xsl:value-of select="$verlag"/> |
| 438 | </publisher> |
| 439 | <pubDate type="year"> |
| 440 | <xsl:value-of select="$j"/> |
| 441 | </pubDate> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 442 | <pubDate type="month"/> |
| 443 | <pubDate type="day"/> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 444 | <pubPlace key="{$erscheinungsland}"> |
| 445 | <xsl:value-of select="$erscheinungsort"/> |
| 446 | </pubPlace> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 447 | </imprint> |
| 448 | <biblScope type="subsume"/> |
| 449 | <biblScope type="pp"/> |
| 450 | <biblScope type="vol"/> |
| 451 | <biblScope type="volume-title"/> |
| 452 | </monogr> |
| Marc Kupietz | 1c3ebca | 2024-09-22 13:49:28 +0200 | [diff] [blame] | 453 | <xsl:if test="$buchpreis"> |
| Rebecca Wilm | 2f345ff | 2024-07-30 16:58:25 +0200 | [diff] [blame] | 454 | <xsl:element name="note"> |
| 455 | <xsl:attribute name="type">award</xsl:attribute> |
| 456 | <xsl:attribute name="subtype"> |
| Marc Kupietz | e43c720 | 2024-09-22 12:53:41 +0200 | [diff] [blame] | 457 | <xsl:value-of select="'Buchpreis deutscher_buchpreis'"/> |
| Rebecca Wilm | 2f345ff | 2024-07-30 16:58:25 +0200 | [diff] [blame] | 458 | </xsl:attribute> |
| 459 | </xsl:element> |
| 460 | </xsl:if> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 461 | </biblStruct> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 462 | <!-- NA --> |
| 463 | <reference assemblage="regular" type="complete"> |
| 464 | <xsl:value-of select="$long-reference"/> |
| 465 | </reference> |
| 466 | <reference assemblage="regular" type="short"> |
| 467 | <xsl:value-of select="$short-reference"/> |
| 468 | </reference> |
| 469 | <!-- END NA --> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 470 | </sourceDesc> |
| 471 | </fileDesc> |
| 472 | <profileDesc> |
| Harald Luengen | b81b63b | 2025-01-09 15:44:14 +0100 | [diff] [blame] | 473 | <!-- outcommented HL --> |
| 474 | <!--creation> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 475 | <creatDate><xsl:value-of select="$j"/></creatDate> |
| Harald Luengen | b81b63b | 2025-01-09 15:44:14 +0100 | [diff] [blame] | 476 | </creation--> |
| 477 | <!-- BEGIN HL --> |
| 478 | <xsl:call-template name="creation_temp"> |
| 479 | <xsl:with-param name="j" select="$j"/> |
| 480 | </xsl:call-template> |
| 481 | <!-- END HL --> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 482 | <textClass/> |
| 483 | <textDesc> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 484 | <textType> |
| 485 | <xsl:value-of select="$textFullGenre"/> |
| 486 | </textType> |
| 487 | <textTypeRef> |
| 488 | <xsl:value-of select="replace($textFullGenre, '.*: *', '')"/> |
| 489 | </textTypeRef> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 490 | <textDomain/> |
| 491 | </textDesc> |
| 492 | </profileDesc> |
| 493 | </idsHeader> |
| 494 | <text> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 495 | <body> |
| Marc Kupietz | 6b6d470 | 2024-09-12 17:54:10 +0200 | [diff] [blame] | 496 | <!-- Call the template for each idref the spine --> |
| 497 | <xsl:apply-templates select="//opf:spine/opf:itemref" mode="collect"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 498 | </body> |
| 499 | </text> |
| 500 | </idsText> |
| 501 | </idsDoc> |
| 502 | </xsl:template> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 503 | |
| Harald Luengen | b81b63b | 2025-01-09 15:44:14 +0100 | [diff] [blame] | 504 | <!-- BEGIN HL --> |
| 505 | <xsl:template name="creation_temp"> |
| 506 | <xsl:param name="j"/> |
| 507 | <creation> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 508 | <creatDate> |
| 509 | <xsl:value-of select="$j"/> |
| 510 | </creatDate> |
| Harald Luengen | b81b63b | 2025-01-09 15:44:14 +0100 | [diff] [blame] | 511 | </creation> |
| 512 | </xsl:template> |
| 513 | <!-- END HL --> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 514 | |
| Marc Kupietz | 6b6d470 | 2024-09-12 17:54:10 +0200 | [diff] [blame] | 515 | <xsl:template match="opf:itemref" mode="collect"> |
| 516 | <xsl:variable name="id" select="@idref"/> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 517 | <xsl:variable name="item" select="//opf:manifest/opf:item[@id = $id and matches(@href, '\.x?html?$') and not(matches(@href, '(cover|toc|copyright|feedback|inhalt|nav|titlepage).*'))]"/> |
| Marc Kupietz | 6b6d470 | 2024-09-12 17:54:10 +0200 | [diff] [blame] | 518 | |
| 519 | <xsl:choose> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 520 | <xsl:when test="$item"> |
| Marc Kupietz | 6b6d470 | 2024-09-12 17:54:10 +0200 | [diff] [blame] | 521 | <xsl:variable name="href" select="$item/@href"/> |
| 522 | <xsl:if test="$debug"> |
| 523 | <xsl:message> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 524 | <xsl:text>converting: </xsl:text> |
| 525 | <xsl:value-of select="$id"/> |
| 526 | <xsl:text> </xsl:text> |
| 527 | <xsl:value-of select="$href"/> |
| 528 | <xsl:text> </xsl:text> |
| 529 | <xsl:value-of select="$idno"/> |
| Marc Kupietz | 6b6d470 | 2024-09-12 17:54:10 +0200 | [diff] [blame] | 530 | </xsl:message> |
| 531 | </xsl:if> |
| 532 | <xsl:apply-templates select="doc(resolve-uri($href, base-uri()))/xhtml:html/xhtml:body"/> |
| 533 | </xsl:when> |
| 534 | <xsl:otherwise> |
| 535 | <xsl:if test="$debug"> |
| 536 | <xsl:message> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 537 | <xsl:text>skipping: </xsl:text> |
| 538 | <xsl:value-of select="$id"/> |
| 539 | <xsl:text> </xsl:text> |
| 540 | <xsl:value-of select="$idno"/> |
| Marc Kupietz | 6b6d470 | 2024-09-12 17:54:10 +0200 | [diff] [blame] | 541 | </xsl:message> |
| 542 | </xsl:if> |
| 543 | </xsl:otherwise> |
| 544 | </xsl:choose> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 545 | </xsl:template> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 546 | |
| 547 | <xsl:template match="xhtml:body"> |
| 548 | <div type="chapter"> |
| 549 | <xsl:apply-templates/> |
| 550 | </div> |
| 551 | </xsl:template> |
| 552 | |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 553 | <xsl:template match="xhtml:body/text()"> |
| 554 | <p> |
| 555 | <xsl:value-of select="."/> |
| 556 | </p> |
| 557 | </xsl:template> |
| 558 | |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 559 | <xsl:template match="xhtml:title"> |
| 560 | <head> |
| 561 | <xsl:apply-templates/> |
| 562 | </head> |
| 563 | </xsl:template> |
| 564 | |
| 565 | <xsl:template match="xhtml:h1"> |
| 566 | <head> |
| 567 | <xsl:apply-templates/> |
| 568 | </head> |
| 569 | </xsl:template> |
| 570 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 571 | <xsl:template match="xhtml:h2 | xhtml:h3 | xhtml:h4 | xhtml:h5 | xhtml:h6"> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 572 | <head type="sub"> |
| 573 | <xsl:apply-templates/> |
| 574 | </head> |
| 575 | </xsl:template> |
| 576 | |
| Marc Kupietz | 99ec04b | 2024-03-16 11:30:03 +0100 | [diff] [blame] | 577 | <xsl:template match="xhtml:em"> |
| 578 | <emph> |
| 579 | <xsl:apply-templates/> |
| 580 | </emph> |
| 581 | </xsl:template> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 582 | |
| Marc Kupietz | 30cc080 | 2024-04-10 16:37:04 +0200 | [diff] [blame] | 583 | <xsl:template match="xhtml:span[matches(@class, '(bold|italic|big|kursiv| )+')]"> |
| 584 | <xsl:variable name="class" select="replace(@class, 'kursiv', 'italic')"/> |
| 585 | <hi rend="{$class}"> |
| 586 | <xsl:apply-templates/> |
| 587 | </hi> |
| 588 | </xsl:template> |
| 589 | |
| Marc Kupietz | ad4d446 | 2024-04-26 17:43:08 +0200 | [diff] [blame] | 590 | <xsl:template match="xhtml:span[matches(@class, '(regular|norm)')]"> |
| Marc Kupietz | 5e87311 | 2024-04-15 06:51:08 +0200 | [diff] [blame] | 591 | <xsl:apply-templates/> |
| 592 | </xsl:template> |
| 593 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 594 | <xsl:template match="xhtml:b | xhtml:span[@class = 'b'] | xhtml:strong"> |
| Marc Kupietz | 30cc080 | 2024-04-10 16:37:04 +0200 | [diff] [blame] | 595 | <hi rend="bold"> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 596 | <xsl:apply-templates/> |
| 597 | </hi> |
| 598 | </xsl:template> |
| 599 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 600 | <xsl:template match="xhtml:i | xhtml:span[@class = 'i' or @class = 'it' or @class = 'Italic'] | xhtml:span[@style = 'font-style:italic' or @style = 'font-style:italic;']"> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 601 | <hi rend="italic"> |
| 602 | <xsl:apply-templates/> |
| 603 | </hi> |
| 604 | </xsl:template> |
| 605 | |
| 606 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 607 | <xsl:template match="xhtml:sub | xhtml:span[@class = 'sub']"> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 608 | <hi rend="sub"> |
| 609 | <xsl:apply-templates/> |
| 610 | </hi> |
| 611 | </xsl:template> |
| 612 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 613 | <xsl:template match="xhtml:sup | xhtml:span[@class = 'sup']"> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 614 | <hi rend="sup"> |
| 615 | <xsl:apply-templates/> |
| 616 | </hi> |
| 617 | </xsl:template> |
| 618 | |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 619 | <xsl:template match="xhtml:div[not(normalize-space(replace(., ' ', ' ')))]" priority="1.0"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 620 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 621 | <xsl:template match="xhtml:body/xhtml:div[./xhtml:h1 | ./xhtml:h2 | ./xhtml:h3]" priority="1.0"> |
| Marc Kupietz | bf47ae7 | 2024-04-14 14:21:43 +0200 | [diff] [blame] | 622 | <xsl:apply-templates/> |
| 623 | </xsl:template> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 624 | <xsl:template match="xhtml:div/xhtml:div"> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 625 | <p> |
| 626 | <xsl:apply-templates/> |
| 627 | </p> |
| 628 | </xsl:template> |
| 629 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 630 | <xsl:template match="xhtml:body/xhtml:div[(descendant::xhtml:p | descendant::xhtml:div)]"> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 631 | <div type="section"> |
| 632 | <xsl:apply-templates/> |
| 633 | </div> |
| 634 | </xsl:template> |
| 635 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 636 | <xsl:template match="xhtml:body/xhtml:div[not(descendant::xhtml:p | descendant::xhtml:div)]"> |
| 637 | <div type="section"> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 638 | <p> |
| 639 | <xsl:apply-templates/> |
| 640 | </p> |
| 641 | </div> |
| 642 | </xsl:template> |
| 643 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 644 | <xsl:template match="xhtml:p[not(descendant::xhtml:p | descendant::xhtml:div)]"> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 645 | <xsl:if test="normalize-space(.)"> |
| 646 | <p> |
| 647 | <xsl:apply-templates/> |
| 648 | </p> |
| 649 | </xsl:if> |
| 650 | </xsl:template> |
| 651 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 652 | <xsl:template match="xhtml:p[descendant::xhtml:p | descendant::xhtml:div]"> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 653 | <xsl:if test="normalize-space(.)"> |
| 654 | <div type="section"> |
| 655 | <xsl:apply-templates/> |
| 656 | </div> |
| 657 | </xsl:if> |
| 658 | </xsl:template> |
| 659 | |
| Marc Kupietz | 09745e1 | 2024-04-21 12:54:10 +0200 | [diff] [blame] | 660 | <xsl:template match="xhtml:ul"> |
| 661 | <list type="unordered"> |
| 662 | <xsl:apply-templates/> |
| 663 | </list> |
| 664 | </xsl:template> |
| 665 | <xsl:template match="xhtml:ol"> |
| 666 | <list type="ordered"> |
| 667 | <xsl:apply-templates/> |
| 668 | </list> |
| 669 | </xsl:template> |
| 670 | <xsl:template match="xhtml:li"> |
| 671 | <item> |
| 672 | <xsl:apply-templates/> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 673 | </item> |
| Marc Kupietz | 09745e1 | 2024-04-21 12:54:10 +0200 | [diff] [blame] | 674 | </xsl:template> |
| 675 | <xsl:template match="xhtml:nav"> |
| Marc Kupietz | 1e6bfd1 | 2024-04-10 16:33:20 +0200 | [diff] [blame] | 676 | <!-- <gap reason="toc"/> --> |
| 677 | </xsl:template> |
| 678 | |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 679 | <xsl:template match="xhtml:img"> |
| 680 | <!-- <gap reason="image"/> --> |
| 681 | </xsl:template> |
| 682 | |
| Marc Kupietz | 1e6bfd1 | 2024-04-10 16:33:20 +0200 | [diff] [blame] | 683 | <xsl:template match="xhtml:audio"> |
| 684 | <!-- <gap reason="audio"/> --> |
| 685 | </xsl:template> |
| 686 | |
| Marc Kupietz | 09745e1 | 2024-04-21 12:54:10 +0200 | [diff] [blame] | 687 | <xsl:template match="xhtml:table"> |
| 688 | <!-- <gap reason="table"/> --> |
| 689 | </xsl:template> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 690 | <xsl:template match="xhtml:body/xhtml:a"> |
| Marc Kupietz | 164a283 | 2024-04-14 21:00:48 +0200 | [diff] [blame] | 691 | <xsl:if test="normalize-space(.)"> |
| 692 | <p> |
| 693 | <ref target="{@href}"> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 694 | <xsl:apply-templates/> |
| Marc Kupietz | 164a283 | 2024-04-14 21:00:48 +0200 | [diff] [blame] | 695 | </ref> |
| 696 | </p> |
| 697 | </xsl:if> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 698 | </xsl:template> |
| 699 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 700 | <xsl:template match="xhtml:body/xhtml:span"> |
| Marc Kupietz | 7f3fe79 | 2024-07-26 15:28:26 +0200 | [diff] [blame] | 701 | <xsl:if test="$debug"> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 702 | <xsl:message> |
| 703 | <xsl:text>unhandled span element: </xsl:text> |
| 704 | <xsl:value-of select="concat(name(), ' ', string-join(./@*[normalize-space(.) != '']/concat(name(), ':', ., ' '), '_'))"/> |
| Marc Kupietz | 7f3fe79 | 2024-07-26 15:28:26 +0200 | [diff] [blame] | 705 | </xsl:message> |
| 706 | </xsl:if> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 707 | <div type="section"> |
| 708 | <p> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 709 | <xsl:value-of select="."/> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 710 | </p> |
| 711 | </div> |
| 712 | </xsl:template> |
| 713 | <xsl:template match="xhtml:span"> |
| Marc Kupietz | 7f3fe79 | 2024-07-26 15:28:26 +0200 | [diff] [blame] | 714 | <xsl:if test="$debug"> |
| 715 | <xsl:message> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 716 | <xsl:text>unhandled span element: </xsl:text> |
| 717 | <xsl:value-of select="concat(name(), ' ', string-join(./@*[normalize-space(.) != '']/concat(name(), ':', ., ' '), '_'))"/> |
| Marc Kupietz | 7f3fe79 | 2024-07-26 15:28:26 +0200 | [diff] [blame] | 718 | </xsl:message> |
| 719 | </xsl:if> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 720 | <xsl:value-of select="."/> |
| 721 | </xsl:template> |
| Marc Kupietz | 99ec04b | 2024-03-16 11:30:03 +0100 | [diff] [blame] | 722 | <xsl:template match="xhtml:a"> |
| Marc Kupietz | 164a283 | 2024-04-14 21:00:48 +0200 | [diff] [blame] | 723 | <xsl:if test="normalize-space(.)"> |
| 724 | <ref target="{@href}"> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 725 | <xsl:apply-templates/> |
| Marc Kupietz | 164a283 | 2024-04-14 21:00:48 +0200 | [diff] [blame] | 726 | </ref> |
| 727 | </xsl:if> |
| Marc Kupietz | 99ec04b | 2024-03-16 11:30:03 +0100 | [diff] [blame] | 728 | </xsl:template> |
| 729 | |
| Marc Kupietz | 54ec28b | 2024-04-27 10:07:06 +0200 | [diff] [blame] | 730 | <xsl:template match="xhtml:br"> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 731 | <lb/> |
| 732 | <xsl:text> </xsl:text> |
| Marc Kupietz | 54ec28b | 2024-04-27 10:07:06 +0200 | [diff] [blame] | 733 | </xsl:template> |
| Marc Kupietz | 99ec04b | 2024-03-16 11:30:03 +0100 | [diff] [blame] | 734 | |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 735 | <xsl:template match="xhtml:*"> |
| Marc Kupietz | 7f3fe79 | 2024-07-26 15:28:26 +0200 | [diff] [blame] | 736 | <xsl:if test="$debug"> |
| 737 | <xsl:message> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 738 | <xsl:text>unhandled element: </xsl:text> |
| 739 | <xsl:value-of select="concat(name(), ' ', string-join(./@*[normalize-space(.) != '']/concat(name(), ':', ., ' '), '_'))"/> |
| Marc Kupietz | 7f3fe79 | 2024-07-26 15:28:26 +0200 | [diff] [blame] | 740 | </xsl:message> |
| 741 | </xsl:if> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 742 | <xsl:choose> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 743 | <xsl:when test="descendant::xhtml:div | descendant::xhtml:p | parent::xhtml:body"> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 744 | <div type="section"> |
| 745 | <xsl:apply-templates/> |
| 746 | </div> |
| 747 | </xsl:when> |
| 748 | <xsl:otherwise> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 749 | <xsl:apply-templates select="./* | node()"/> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 750 | </xsl:otherwise> |
| 751 | </xsl:choose> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 752 | <xsl:apply-templates/> |
| 753 | </xsl:template> |
| 754 | |
| 755 | <xsl:function name="ids:reversedAuthors"> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 756 | <xsl:param name="s"/> |
| 757 | <xsl:value-of select=" |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 758 | if (matches($s, ';')) then |
| 759 | concat(ids:reversedAuthors(substring-before($s, ' ; ')), ' ; ', ids:reversedAuthors(substring-after($s, ' ; '))) |
| 760 | else |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 761 | replace($s, '(.+) (.+)', '$2, $1')"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 762 | </xsl:function> |
| 763 | |
| 764 | <xsl:function name="hlu:reversedAuthors"> |
| 765 | <xsl:param name="s"/> |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 766 | <xsl:value-of select=" |
| 767 | if (matches($s, ';')) then |
| 768 | concat(ids:reversedAuthors(substring-before($s, ' ; ')), ' ; ', ids:reversedAuthors(substring-after($s, ' ; '))) |
| 769 | else |
| 770 | replace($s, '(.+),(.+)', '$2, $1')"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 771 | </xsl:function> |
| 772 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 773 | <xsl:variable name="city-country-map" as="map(xs:string, xs:string)"> |
| 774 | <xsl:map> |
| 775 | <xsl:map-entry key="'Axams'" select="'AT'"/> |
| 776 | <xsl:map-entry key="'Vienna'" select="'AT'"/> |
| 777 | <xsl:map-entry key="'Klagenfurt'" select="'AT'"/> |
| 778 | <xsl:map-entry key="'Graz'" select="'AT'"/> |
| 779 | <xsl:map-entry key="'Innsbruck'" select="'AT'"/> |
| 780 | <xsl:map-entry key="'Salzburg'" select="'AT'"/> |
| 781 | <xsl:map-entry key="'Bern'" select="'CH'"/> |
| 782 | <xsl:map-entry key="'Biel/Bienne'" select="'CH'"/> |
| 783 | <xsl:map-entry key="'Zurich'" select="'CH'"/> |
| 784 | <xsl:map-entry key="'Basel'" select="'CH'"/> |
| 785 | <xsl:map-entry key="'Geneva'" select="'CH'"/> |
| 786 | <xsl:map-entry key="'Lucerne'" select="'CH'"/> |
| 787 | <xsl:map-entry key="'Lausanne'" select="'CH'"/> |
| 788 | <xsl:map-entry key="'Winterthur'" select="'CH'"/> |
| 789 | <xsl:map-entry key="'St. Gallen'" select="'CH'"/> |
| 790 | <xsl:map-entry key="'Interlaken'" select="'CH'"/> |
| 791 | <xsl:map-entry key="'Brussels'" select="'BE'"/> |
| 792 | <xsl:map-entry key="'Antwerp'" select="'BE'"/> |
| 793 | <xsl:map-entry key="'Ghent'" select="'BE'"/> |
| 794 | <xsl:map-entry key="'Bruges'" select="'BE'"/> |
| 795 | <xsl:map-entry key="'Leuven'" select="'BE'"/> |
| 796 | <xsl:map-entry key="'Liege'" select="'BE'"/> |
| 797 | <xsl:map-entry key="'Charleroi'" select="'BE'"/> |
| 798 | <xsl:map-entry key="'Namur'" select="'BE'"/> |
| 799 | <xsl:map-entry key="'Mons'" select="'BE'"/> |
| 800 | <xsl:map-entry key="'Bangkok'" select="'TH'"/> |
| 801 | <xsl:map-entry key="'Copenhagen'" select="'DK'"/> |
| 802 | <xsl:map-entry key="'colatina'" select="'BR'"/> |
| 803 | <xsl:map-entry key="'Oakland Park'" select="'US'"/> |
| 804 | <xsl:map-entry key="'Istanbul'" select="'TR'"/> |
| 805 | <xsl:map-entry key="'Luxemburg'" select="'LU'"/> |
| 806 | <xsl:map-entry key="'Palma de Mallorca'" select="'ES'"/> |
| 807 | <xsl:map-entry key="'Swakopmund'" select="'NA'"/> |
| 808 | <xsl:map-entry key="'Victoria'" select="'CA'"/> |
| 809 | <xsl:map-entry key="'Wien'" select="'AT'"/> |
| 810 | <xsl:map-entry key="'Windhoek'" select="'NA'"/> |
| 811 | <xsl:map-entry key="'Zuerich'" select="'CH'"/> |
| 812 | <xsl:map-entry key="'Zürich'" select="'CH'"/> |
| 813 | <xsl:map-entry key="'Zug'" select="'CH'"/> |
| 814 | <xsl:map-entry key="'ZÜRICH'" select="'CH'"/> |
| 815 | </xsl:map> |
| Marc Kupietz | d8599fc | 2024-04-14 13:16:56 +0200 | [diff] [blame] | 816 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 817 | </xsl:variable> |
| Marc Kupietz | 10903f3 | 2024-04-14 14:21:18 +0200 | [diff] [blame] | 818 | |
| Harald Luengen | 017ab12 | 2025-01-15 15:40:33 +0100 | [diff] [blame] | 819 | <!-- Define the function --> |
| 820 | <xsl:function name="ids:country-city" as="xs:string"> |
| 821 | <xsl:param name="city" as="xs:string"/> |
| 822 | <xsl:sequence select=" |
| 823 | if (map:contains($city-country-map, $city)) then |
| 824 | map:get($city-country-map, $city) |
| 825 | else |
| 826 | 'DE'"/> |
| 827 | </xsl:function> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 828 | </xsl:stylesheet> |