| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 1 | <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 2 | xmlns:xs="http://www.w3.org/2001/XMLSchema" |
| 3 | xmlns:opf="http://www.idpf.org/2007/opf" |
| 4 | xmlns:dc="http://purl.org/dc/elements/1.1/" |
| 5 | xmlns:ids="http://www.ids-mannheim.de/ids" |
| 6 | xmlns:hlu="http://www.ids-mannheim.de/hlu" |
| 7 | xmlns:saxon="http://saxon.sf.net/" |
| 8 | xmlns:xhtml="http://www.w3.org/1999/xhtml" |
| Marc Kupietz | 10903f3 | 2024-04-14 14:21:18 +0200 | [diff] [blame] | 9 | xmlns:map="http://www.w3.org/2005/xpath-functions/map" |
| 10 | exclude-result-prefixes="xs opf dc ids hlu map saxon xhtml"> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 11 | |
| 12 | <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" saxon:line-length="1000"/> |
| 13 | <xsl:strip-space elements="*"/> |
| 14 | |
| 15 | <xsl:variable name="ev"/> |
| 16 | <xsl:variable name="x"/> |
| 17 | |
| Marc Kupietz | 0c24663 | 2024-04-29 07:08:23 +0200 | [diff] [blame] | 18 | <xsl:variable name="idno" as="xs:string" select="replace(document-uri(), '.*/([0-9]{9,13}X?).*' , '$1')"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 19 | |
| Rebecca Wilm | f614a4b | 2024-05-07 10:19:43 +0200 | [diff] [blame] | 20 | <xsl:variable name="idno_type"> |
| 21 | <xsl:choose> |
| 22 | <xsl:when test="starts-with($idno,'1')"> |
| 23 | <xsl:value-of select="'IDN'"/> |
| 24 | </xsl:when> |
| 25 | <xsl:otherwise> |
| 26 | <xsl:value-of select="'ISBN'"/> |
| 27 | </xsl:otherwise> |
| 28 | </xsl:choose> |
| 29 | </xsl:variable> |
| 30 | |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 31 | <xsl:variable name="dnbBookdata"> |
| Rebecca Wilm | f614a4b | 2024-05-07 10:19:43 +0200 | [diff] [blame] | 32 | <xsl:copy-of select="doc(concat('https://services.dnb.de/sru/dnb?version=1.1&operation=searchRetrieve&query=', $idno_type, '%3D', $idno, '&recordSchema=oai_dc'))"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 33 | </xsl:variable> |
| 34 | |
| 35 | <xsl:variable name="autor" |
| Marc Kupietz | de2ca53 | 2024-04-26 16:50:53 +0200 | [diff] [blame] | 36 | select="replace(string-join($dnbBookdata//dc:creator[not(contains(., '[')) or matches(., '\[Verfasser\]')], ' ; '), ' *\[[^\]]*\]', '')"/> |
| Marc Kupietz | eaa9013 | 2024-04-26 18:14:40 +0200 | [diff] [blame] | 37 | <xsl:variable name="straight_autor" select="normalize-space(replace(hlu:reversedAuthors($autor), ',', ''))"/> |
| 38 | <xsl:variable name="translator" |
| 39 | select="replace(string-join($dnbBookdata//dc:creator[matches(., '\[Übersetzer\]')], ' ; '), ' *\[[^\]]*\]', '')"/> |
| 40 | <xsl:variable name="straight_translator" select="normalize-space(replace(hlu:reversedAuthors($translator), ',', ''))"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 41 | |
| Marc Kupietz | 15e7d61 | 2024-04-26 18:16:39 +0200 | [diff] [blame] | 42 | <xsl:variable name="herausgeber" |
| 43 | select="replace(string-join($dnbBookdata//dc:creator[matches(., '\[(Herausgeber|Hrsg.)\]')], ' ; '), ' *\[[^\]]*\]', '')"/> |
| 44 | <xsl:variable name="straight_herausgeber" select="normalize-space(replace(hlu:reversedAuthors($herausgeber), ',', ''))"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 45 | |
| 46 | <xsl:variable name="ina"/> |
| 47 | <xsl:variable name="_corpus"/> |
| 48 | <xsl:variable name="ent_known"/> |
| 49 | |
| 50 | |
| 51 | <!-- added HLU 2012-02-09: --> |
| 52 | <xsl:variable name="ent"> |
| 53 | <xsl:choose> |
| 54 | <xsl:when test="$ent_known"> |
| 55 | <xsl:value-of select="$ent_known"/> |
| 56 | </xsl:when> |
| 57 | <xsl:when test="$ev"> |
| 58 | <xsl:value-of select="$ev"/> |
| 59 | </xsl:when> |
| 60 | <xsl:otherwise> |
| 61 | <xsl:value-of select="$j"/> |
| 62 | </xsl:otherwise> |
| 63 | </xsl:choose> |
| 64 | </xsl:variable> |
| 65 | |
| 66 | <xsl:variable name="titel"> |
| Marc Kupietz | 49124fa | 2024-04-10 16:50:01 +0200 | [diff] [blame] | 67 | <xsl:variable name="title-with-subtitles"> |
| 68 | <xsl:choose> |
| Marc Kupietz | 6cb5223 | 2024-04-13 12:28:44 +0200 | [diff] [blame] | 69 | <xsl:when test="contains(($dnbBookdata//dc:title)[1],':')"> |
| 70 | <xsl:value-of select="normalize-space(substring-before(substring-before(($dnbBookdata//dc:title)[1], '/'), ':'))" |
| Marc Kupietz | 49124fa | 2024-04-10 16:50:01 +0200 | [diff] [blame] | 71 | /> |
| 72 | </xsl:when> |
| 73 | <xsl:otherwise> |
| Marc Kupietz | 6cb5223 | 2024-04-13 12:28:44 +0200 | [diff] [blame] | 74 | <xsl:value-of select="normalize-space(substring-before(($dnbBookdata//dc:title)[1], '/'))"/> |
| Marc Kupietz | 49124fa | 2024-04-10 16:50:01 +0200 | [diff] [blame] | 75 | </xsl:otherwise> |
| 76 | </xsl:choose> |
| 77 | </xsl:variable> |
| 78 | <xsl:value-of select="normalize-space(replace($title-with-subtitles, '\|.*', ''))"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 79 | </xsl:variable> |
| 80 | |
| 81 | <xsl:variable name="erscheinungsort"> |
| 82 | <xsl:choose> |
| Marc Kupietz | 6cb5223 | 2024-04-13 12:28:44 +0200 | [diff] [blame] | 83 | <xsl:when test="contains(($dnbBookdata//dc:publisher)[1], ':')"> |
| 84 | <xsl:value-of select="normalize-space(substring-before(($dnbBookdata//dc:publisher)[1], ':'))"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 85 | </xsl:when> |
| 86 | <xsl:otherwise> |
| Marc Kupietz | 6cb5223 | 2024-04-13 12:28:44 +0200 | [diff] [blame] | 87 | <xsl:value-of select="normalize-space(($dnbBookdata//dc:publisher)[1])"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 88 | </xsl:otherwise> |
| 89 | </xsl:choose> |
| 90 | </xsl:variable> |
| 91 | |
| Marc Kupietz | d8599fc | 2024-04-14 13:16:56 +0200 | [diff] [blame] | 92 | <xsl:variable name="erscheinungsland" select="ids:country-city($erscheinungsort)"/> |
| 93 | |
| Marc Kupietz | 6cb5223 | 2024-04-13 12:28:44 +0200 | [diff] [blame] | 94 | <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] | 95 | |
| Marc Kupietz | 9d87e9d | 2024-05-05 15:56:50 +0200 | [diff] [blame] | 96 | <xsl:variable name="genretable"> |
| 97 | <genres> |
| 98 | <genre keyRegex="krimi" genre="Roman: Kriminalroman"/> |
| 99 | <genre keyRegex="arztroman" genre="Roman: Arztroman"/> |
| 100 | <genre keyRegex="liebesroman" genre="Roman: Liebesroman"/> |
| 101 | <genre keyRegex="science.?fiction" genre="Roman: Science-Fiction-Roman"/> |
| 102 | <genre keyRegex="horror" genre="Roman: Horrorroman"/> |
| 103 | <genre keyRegex="western" genre="Roman: Westernroman"/> |
| 104 | <genre keyRegex="fantasy" genre="Roman: Fantasyroman"/> |
| 105 | <genre keyRegex="historischer roman" genre="Roman: Historischer Roman"/> |
| 106 | <genre keyRegex="erzählung" genre="Erzählung"/> |
| 107 | <genre keyRegex="novelle" genre="Novelle"/> |
| 108 | <genre keyRegex="anthologie" genre="Anthologie"/> |
| 109 | <genre keyRegex="kurzgeschichte" genre="Kurzgeschichte"/> |
| 110 | <genre keyRegex="roman" genre="Roman"/> |
| 111 | <genre keyRegex="." genre="Roman"/> |
| 112 | </genres> |
| 113 | </xsl:variable> |
| 114 | |
| 115 | <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] | 116 | <xsl:variable name="verlag"> |
| 117 | <xsl:choose> |
| Marc Kupietz | 6cb5223 | 2024-04-13 12:28:44 +0200 | [diff] [blame] | 118 | <xsl:when test="contains(($dnbBookdata//dc:publisher)[1], ':')"> |
| 119 | <xsl:value-of select="normalize-space(substring-after(($dnbBookdata//dc:publisher)[1], ':'))"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 120 | </xsl:when> |
| 121 | <xsl:otherwise> |
| Marc Kupietz | 6cb5223 | 2024-04-13 12:28:44 +0200 | [diff] [blame] | 122 | <xsl:value-of select="normalize-space(($dnbBookdata//dc:publisher)[1])"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 123 | </xsl:otherwise> |
| 124 | </xsl:choose> |
| 125 | </xsl:variable> |
| 126 | |
| 127 | <xsl:variable name="erscheinungsjahr"> |
| Marc Kupietz | a5d0118 | 2024-04-14 12:24:02 +0200 | [diff] [blame] | 128 | <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] | 129 | </xsl:variable> |
| 130 | |
| 131 | <xsl:variable name="untertitel" |
| Marc Kupietz | 6cb5223 | 2024-04-13 12:28:44 +0200 | [diff] [blame] | 132 | select="normalize-space(substring-after(substring-before(($dnbBookdata//dc:title)[1], '/'), ':'))"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 133 | |
| Marc Kupietz | a5d0118 | 2024-04-14 12:24:02 +0200 | [diff] [blame] | 134 | <xsl:variable name="j" select="$erscheinungsjahr"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 135 | |
| 136 | <!-- for BOT+s: --> |
| 137 | <xsl:variable name="seiten" select="replace($dnbBookdata//dc:format,'S\.','')"/> |
| 138 | |
| 139 | <!-- fuer BOT+b: --> |
| 140 | <xsl:variable name="_b"> |
| 141 | <xsl:variable name="regexp1" select="'(Band|Bd\.)\s*([0-9]?[0-9]?[0-9])'"/> |
| 142 | <xsl:choose> |
| 143 | <xsl:when test="matches($dnbBookdata, $regexp1)"> |
| 144 | <xsl:analyze-string select="$dnbBookdata//dc:title" regex="{$regexp1}"> |
| 145 | <xsl:matching-substring> |
| 146 | <xsl:value-of select="."/> |
| 147 | </xsl:matching-substring> |
| 148 | </xsl:analyze-string> |
| 149 | </xsl:when> |
| 150 | <xsl:otherwise> |
| 151 | <xsl:value-of select="'.'"/> |
| 152 | </xsl:otherwise> |
| 153 | </xsl:choose> |
| 154 | </xsl:variable> |
| 155 | |
| 156 | <!-- for BOT+x: --> |
| 157 | <xsl:variable name="txtart"> |
| 158 | <xsl:choose> |
| 159 | <xsl:when test="$x"> |
| 160 | <xsl:value-of select="concat('[', $x, ']')"/> |
| 161 | </xsl:when> |
| 162 | <xsl:when |
| Nicolas Arnold | 72aa7a1 | 2024-05-08 12:42:15 +0200 | [diff] [blame] | 163 | 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] | 164 | <xsl:value-of |
| Nicolas Arnold | 72aa7a1 | 2024-05-08 12:42:15 +0200 | [diff] [blame] | 165 | 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'), ']')" |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 166 | /> |
| 167 | </xsl:when> |
| 168 | <xsl:otherwise> |
| 169 | <xsl:value-of>Roman</xsl:value-of> |
| 170 | </xsl:otherwise> |
| 171 | </xsl:choose> |
| 172 | </xsl:variable> |
| 173 | |
| 174 | |
| 175 | |
| 176 | <!-- fuer BOTd: --> |
| 177 | <xsl:variable name="dok" |
| 178 | select="concat((if(string-length($autor) > 0) then concat($straight_autor, ': ') else ''), $titel, ', ', $txtart, ', (', $j, ')')"/> |
| 179 | |
| 180 | <!-- END variables derived from sru request to dnb archive --> |
| 181 | |
| 182 | |
| Marc Kupietz | 94bbe6b | 2024-04-10 20:35:48 +0200 | [diff] [blame] | 183 | <xsl:variable name="corpus_sigle" select="concat('DNB', substring($erscheinungsjahr, 3, 2))"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 184 | |
| 185 | <!-- for BOTD: --> |
| 186 | <!-- Dokumentsigle muss zusammen mit Korpussigle (z.B DIV fuer loz-div und loz-div-pub) eindeutig sein --> |
| 187 | <xsl:variable name="doc_sigle"> |
| 188 | <xsl:variable name="firstContentWordTitleInitial"> |
| 189 | <xsl:variable name="helper"> |
| 190 | <xsl:analyze-string select="$titel" regex="\w+"> |
| 191 | <xsl:matching-substring> |
| 192 | <xsl:choose> |
| 193 | <xsl:when |
| Marc Kupietz | ad1f3b8 | 2024-04-19 19:21:49 +0200 | [diff] [blame] | 194 | 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] | 195 | <!-- TODO: Fktnswoerter nachtragen --> |
| 196 | <xsl:sequence select="."/> |
| 197 | </xsl:when> |
| 198 | <xsl:otherwise/> |
| 199 | </xsl:choose> |
| 200 | </xsl:matching-substring> |
| 201 | </xsl:analyze-string> |
| 202 | </xsl:variable> |
| 203 | <xsl:value-of |
| Marc Kupietz | 77b6aa9 | 2024-04-21 17:31:43 +0200 | [diff] [blame] | 204 | select="upper-case(substring(normalize-space(replace($helper,'\s+.+$','')),1,3))"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 205 | <!-- longest match of .+ --> |
| 206 | </xsl:variable> |
| Marc Kupietz | 77b6aa9 | 2024-04-21 17:31:43 +0200 | [diff] [blame] | 207 | <xsl:variable name="authorInitials"> |
| 208 | <xsl:choose> |
| 209 | <xsl:when test="contains($autor,';')"> |
| 210 | <xsl:variable name="lastname_aut1" |
| 211 | select="upper-case(substring(normalize-space($autor),1,1))"/> |
| 212 | <xsl:variable name="lastname_aut2" |
| 213 | select="replace($autor, '.*?;.*?([A-Z]).*', '$1')"/> |
| 214 | <xsl:value-of select="concat($lastname_aut1, $lastname_aut2)"/> |
| 215 | </xsl:when> |
| 216 | <xsl:otherwise> |
| 217 | <xsl:variable name="lastname_aut1" |
| 218 | select="upper-case(substring(normalize-space(substring-before($autor,',')),1,1))"/> |
| 219 | <xsl:variable name="firstname_aut1" |
| 220 | select="upper-case(substring(normalize-space(substring-after($autor,',')),1,1))"/> |
| 221 | <xsl:value-of select="concat($lastname_aut1, $firstname_aut1)"/> |
| 222 | </xsl:otherwise> |
| 223 | </xsl:choose> |
| 224 | </xsl:variable> |
| Marc Kupietz | 398b596 | 2024-04-21 17:51:34 +0200 | [diff] [blame] | 225 | <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] | 226 | </xsl:variable> |
| 227 | |
| 228 | |
| Marc Kupietz | 0c24663 | 2024-04-29 07:08:23 +0200 | [diff] [blame] | 229 | <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] | 230 | <xsl:variable name="sigle" select="concat($corpus_sigle, '/', $doc_sigle, '.', $text_sigle)"/> |
| 231 | |
| 232 | <!-- fuer BOT+xy: (?) --> |
| 233 | <xsl:variable name="xyref"> |
| 234 | <xsl:value-of select="document-uri(.)"/> |
| 235 | <xsl:text>; </xsl:text> |
| Marc Kupietz | 0c24663 | 2024-04-29 07:08:23 +0200 | [diff] [blame] | 236 | <xsl:text>IDNO:</xsl:text> |
| 237 | <xsl:value-of select="$idno"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 238 | <xsl:text>; </xsl:text> |
| 239 | <xsl:value-of select="string-join($dnbBookdata//dc:identifier)"/> |
| 240 | </xsl:variable> |
| 241 | |
| Marc Kupietz | b660ed6 | 2024-03-16 11:45:53 +0100 | [diff] [blame] | 242 | <xsl:variable name="long-reference" |
| 243 | select="concat($sigle, ' ', $autor, ': ', $titel, '. ', $erscheinungsort, ': ', $verlag, ', ', $erscheinungsjahr)"/> |
| 244 | |
| 245 | <xsl:variable name="short-reference" |
| 246 | select="concat($straight_autor, ': ', $titel, ' (', $erscheinungsjahr, ')')"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 247 | |
| 248 | <xsl:template match="/"> |
| Marc Kupietz | b7a4f6c | 2024-04-19 11:35:25 +0200 | [diff] [blame] | 249 | <xsl:if test="not($j)"> |
| Marc Kupietz | 0c24663 | 2024-04-29 07:08:23 +0200 | [diff] [blame] | 250 | <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] | 251 | </xsl:if> |
| 252 | |
| Marc Kupietz | 815cc6c | 2024-04-19 12:44:44 +0200 | [diff] [blame] | 253 | <xsl:if test="not(normalize-space($titel))"> |
| Marc Kupietz | 0c24663 | 2024-04-29 07:08:23 +0200 | [diff] [blame] | 254 | <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] | 255 | </xsl:if> |
| 256 | |
| Marc Kupietz | 2badfb1 | 2024-04-19 12:59:40 +0200 | [diff] [blame] | 257 | <xsl:if test="not(normalize-space($autor))"> |
| Marc Kupietz | 0c24663 | 2024-04-29 07:08:23 +0200 | [diff] [blame] | 258 | <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] | 259 | </xsl:if> |
| 260 | |
| Marc Kupietz | 52aa505 | 2024-04-21 18:16:06 +0200 | [diff] [blame] | 261 | <xsl:if test="not(matches($sigle, '^[A-Z]{3}[0-9]{2}/[A-Z]{2,3}\.[0-9]{5}$'))"> |
| Marc Kupietz | 0c24663 | 2024-04-29 07:08:23 +0200 | [diff] [blame] | 262 | <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] | 263 | </xsl:if> |
| 264 | |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 265 | <idsDoc TEIform="TEI.2" type="text" version="1.0"> |
| 266 | <idsHeader TEIform="teiHeader" pattern="text" status="new" type="document" version="1.1"> |
| 267 | <fileDesc> |
| 268 | <titleStmt> |
| Marc Kupietz | b660ed6 | 2024-03-16 11:45:53 +0100 | [diff] [blame] | 269 | <dokumentSigle><xsl:value-of select="string-join(($corpus_sigle, $doc_sigle), '/')"/></dokumentSigle> |
| 270 | <d.title><xsl:value-of select="$short-reference"/></d.title> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 271 | </titleStmt> |
| 272 | <publicationStmt> |
| 273 | <distributor/> |
| 274 | <pubAddress/> |
| 275 | <availability region="world" status="unknown">QAO-NC</availability> |
| 276 | <pubDate/> |
| 277 | </publicationStmt> |
| 278 | <sourceDesc> |
| 279 | <biblStruct> |
| 280 | <monogr> |
| 281 | <h.title type="main"/> |
| 282 | <imprint/> |
| 283 | </monogr> |
| 284 | </biblStruct> |
| 285 | </sourceDesc> |
| 286 | </fileDesc> |
| 287 | </idsHeader> |
| 288 | <idsText version="1.0"> |
| 289 | <idsHeader TEIform="teiHeader" pattern="text" status="new" type="text" version="1.1"> |
| 290 | <fileDesc> |
| 291 | <titleStmt> |
| 292 | <textSigle><xsl:sequence select="$sigle"/></textSigle> |
| Marc Kupietz | b660ed6 | 2024-03-16 11:45:53 +0100 | [diff] [blame] | 293 | <t.title assemblage="regular"><xsl:value-of select="$long-reference"/></t.title> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 294 | </titleStmt> |
| 295 | <publicationStmt> |
| 296 | <distributor/> |
| 297 | <pubAddress/> |
| 298 | <availability region="world" status="unknown">QAO-NC</availability> |
| 299 | <pubDate/> |
| 300 | </publicationStmt> |
| 301 | <sourceDesc> |
| 302 | <biblStruct> |
| 303 | <monogr> |
| 304 | <h.title type="main"><xsl:value-of select="$titel"/></h.title> |
| 305 | <h.title type="sub"><xsl:value-of select="$untertitel"/></h.title> |
| 306 | <h.author><xsl:value-of select="$autor"/></h.author> |
| Marc Kupietz | eaa9013 | 2024-04-26 18:14:40 +0200 | [diff] [blame] | 307 | <xsl:if test="$translator"> |
| 308 | <editor role="translator"><xsl:value-of select="$translator"/></editor> |
| 309 | </xsl:if> |
| Marc Kupietz | 15e7d61 | 2024-04-26 18:16:39 +0200 | [diff] [blame] | 310 | <xsl:if test="$herausgeber"> |
| 311 | <editor role="editor"><xsl:value-of select="$herausgeber"/></editor> |
| 312 | </xsl:if> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 313 | <edition> |
| 314 | <further/> |
| 315 | <kind>E-Book-Ausgabe</kind> |
| 316 | <appearance>EPUB-Datei</appearance> |
| 317 | </edition> |
| 318 | <imprint> |
| Marc Kupietz | b660ed6 | 2024-03-16 11:45:53 +0100 | [diff] [blame] | 319 | <publisher><xsl:value-of select="$verlag"/></publisher> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 320 | <pubDate type="year"><xsl:value-of select="$j"/></pubDate> |
| 321 | <pubDate type="month"/> |
| 322 | <pubDate type="day"/> |
| Marc Kupietz | d8599fc | 2024-04-14 13:16:56 +0200 | [diff] [blame] | 323 | <pubPlace key="{$erscheinungsland}"><xsl:value-of select="$erscheinungsort"/></pubPlace> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 324 | </imprint> |
| 325 | <biblScope type="subsume"/> |
| 326 | <biblScope type="pp"/> |
| 327 | <biblScope type="vol"/> |
| 328 | <biblScope type="volume-title"/> |
| 329 | </monogr> |
| 330 | </biblStruct> |
| 331 | <reference assemblage="regular" type="complete"><xsl:value-of select="concat($sigle, ' ', $autor, ': ', $titel, '. ', $erscheinungsort, ': ', $verlag, ', ', $erscheinungsjahr)"/></reference> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 332 | </sourceDesc> |
| 333 | </fileDesc> |
| 334 | <profileDesc> |
| 335 | <creation> |
| 336 | <creatDate><xsl:value-of select="$j"/></creatDate> |
| 337 | </creation> |
| 338 | <textClass/> |
| 339 | <textDesc> |
| Marc Kupietz | 9d87e9d | 2024-05-05 15:56:50 +0200 | [diff] [blame] | 340 | <textType><xsl:value-of select="$textFullGenre"/></textType> |
| 341 | <textTypeRef><xsl:value-of select="replace($textFullGenre, '.*: *', '')"/></textTypeRef> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 342 | <textDomain/> |
| 343 | </textDesc> |
| 344 | </profileDesc> |
| 345 | </idsHeader> |
| 346 | <text> |
| 347 | <body> |
| 348 | <!-- Call the template for each link in the TOC |
| 349 | <xsl:apply-templates select="//xhtml:ol[@class='toc']/xhtml:li/xhtml:a" mode="collect"/> --> |
| Marc Kupietz | 8f72730 | 2024-04-10 16:31:19 +0200 | [diff] [blame] | 350 | <xsl:apply-templates select="//opf:package/opf:manifest/opf:item[matches(@href, '\.x?html$') and not(matches(@href, '(cover|toc|copyright|feedback|inhalt|nav|titlepage).*'))]" mode="collect"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 351 | </body> |
| 352 | </text> |
| 353 | </idsText> |
| 354 | </idsDoc> |
| 355 | </xsl:template> |
| 356 | |
| 357 | <xsl:template match="opf:item" mode="collect"> |
| 358 | <xsl:variable name="href" select="@href"/> |
| 359 | <xsl:message> |
| Marc Kupietz | 0c24663 | 2024-04-29 07:08:23 +0200 | [diff] [blame] | 360 | <xsl:text>converting: </xsl:text><xsl:value-of select="$href"/><xsl:text> </xsl:text><xsl:value-of select="$idno"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 361 | </xsl:message> |
| 362 | <xsl:apply-templates select="doc(resolve-uri($href, base-uri()))/xhtml:html/xhtml:body"/> |
| 363 | </xsl:template> |
| 364 | |
| 365 | <xsl:template match="xhtml:body"> |
| 366 | <div type="chapter"> |
| 367 | <xsl:apply-templates/> |
| 368 | </div> |
| 369 | </xsl:template> |
| 370 | |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 371 | <xsl:template match="xhtml:body/text()"> |
| 372 | <p> |
| 373 | <xsl:value-of select="."/> |
| 374 | </p> |
| 375 | </xsl:template> |
| 376 | |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 377 | <xsl:template match="xhtml:title"> |
| 378 | <head> |
| 379 | <xsl:apply-templates/> |
| 380 | </head> |
| 381 | </xsl:template> |
| 382 | |
| 383 | <xsl:template match="xhtml:h1"> |
| 384 | <head> |
| 385 | <xsl:apply-templates/> |
| 386 | </head> |
| 387 | </xsl:template> |
| 388 | |
| Marc Kupietz | 3989c74 | 2024-04-21 17:33:49 +0200 | [diff] [blame] | 389 | <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] | 390 | <head type="sub"> |
| 391 | <xsl:apply-templates/> |
| 392 | </head> |
| 393 | </xsl:template> |
| 394 | |
| Marc Kupietz | 99ec04b | 2024-03-16 11:30:03 +0100 | [diff] [blame] | 395 | <xsl:template match="xhtml:em"> |
| 396 | <emph> |
| 397 | <xsl:apply-templates/> |
| 398 | </emph> |
| 399 | </xsl:template> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 400 | |
| Marc Kupietz | 30cc080 | 2024-04-10 16:37:04 +0200 | [diff] [blame] | 401 | <xsl:template match="xhtml:span[matches(@class, '(bold|italic|big|kursiv| )+')]"> |
| 402 | <xsl:variable name="class" select="replace(@class, 'kursiv', 'italic')"/> |
| 403 | <hi rend="{$class}"> |
| 404 | <xsl:apply-templates/> |
| 405 | </hi> |
| 406 | </xsl:template> |
| 407 | |
| Marc Kupietz | ad4d446 | 2024-04-26 17:43:08 +0200 | [diff] [blame] | 408 | <xsl:template match="xhtml:span[matches(@class, '(regular|norm)')]"> |
| Marc Kupietz | 5e87311 | 2024-04-15 06:51:08 +0200 | [diff] [blame] | 409 | <xsl:apply-templates/> |
| 410 | </xsl:template> |
| 411 | |
| Marc Kupietz | 3989c74 | 2024-04-21 17:33:49 +0200 | [diff] [blame] | 412 | <xsl:template match="xhtml:b|xhtml:span[@class='b']|xhtml:strong"> |
| Marc Kupietz | 30cc080 | 2024-04-10 16:37:04 +0200 | [diff] [blame] | 413 | <hi rend="bold"> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 414 | <xsl:apply-templates/> |
| 415 | </hi> |
| 416 | </xsl:template> |
| 417 | |
| Marc Kupietz | fb0f2c3 | 2024-04-26 17:43:18 +0200 | [diff] [blame] | 418 | <xsl:template match="xhtml:i|xhtml:span[@class='i' or @class='it']"> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 419 | <hi rend="italic"> |
| 420 | <xsl:apply-templates/> |
| 421 | </hi> |
| 422 | </xsl:template> |
| 423 | |
| 424 | |
| Marc Kupietz | 99ec04b | 2024-03-16 11:30:03 +0100 | [diff] [blame] | 425 | <xsl:template match="xhtml:sub|xhtml:span[@class='sub']"> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 426 | <hi rend="sub"> |
| 427 | <xsl:apply-templates/> |
| 428 | </hi> |
| 429 | </xsl:template> |
| 430 | |
| Marc Kupietz | 99ec04b | 2024-03-16 11:30:03 +0100 | [diff] [blame] | 431 | <xsl:template match="xhtml:sup|xhtml:span[@class='sup']"> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 432 | <hi rend="sup"> |
| 433 | <xsl:apply-templates/> |
| 434 | </hi> |
| 435 | </xsl:template> |
| 436 | |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 437 | <xsl:template match="xhtml:div[not(normalize-space(replace(., ' ', ' ')))]" priority="1.0"/> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 438 | |
| Marc Kupietz | bf47ae7 | 2024-04-14 14:21:43 +0200 | [diff] [blame] | 439 | <xsl:template match="xhtml:body/xhtml:div[./xhtml:h1|./xhtml:h2|./xhtml:h3]" priority="1.0"> |
| 440 | <xsl:apply-templates/> |
| 441 | </xsl:template> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 442 | <xsl:template match="xhtml:div/xhtml:div"> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 443 | <p> |
| 444 | <xsl:apply-templates/> |
| 445 | </p> |
| 446 | </xsl:template> |
| 447 | |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 448 | <xsl:template match="xhtml:body/xhtml:div[(descendant::xhtml:p|descendant::xhtml:div)]"> |
| 449 | <div type="section"> |
| 450 | <xsl:apply-templates/> |
| 451 | </div> |
| 452 | </xsl:template> |
| 453 | |
| 454 | <xsl:template match="xhtml:body/xhtml:div[not(descendant::xhtml:p|descendant::xhtml:div)]"> |
| 455 | <div type="section"> |
| 456 | <p> |
| 457 | <xsl:apply-templates/> |
| 458 | </p> |
| 459 | </div> |
| 460 | </xsl:template> |
| 461 | |
| 462 | <xsl:template match="xhtml:p[not(descendant::xhtml:p|descendant::xhtml:div)]"> |
| 463 | <xsl:if test="normalize-space(.)"> |
| 464 | <p> |
| 465 | <xsl:apply-templates/> |
| 466 | </p> |
| 467 | </xsl:if> |
| 468 | </xsl:template> |
| 469 | |
| 470 | <xsl:template match="xhtml:p[descendant::xhtml:p|descendant::xhtml:div]"> |
| 471 | <xsl:if test="normalize-space(.)"> |
| 472 | <div type="section"> |
| 473 | <xsl:apply-templates/> |
| 474 | </div> |
| 475 | </xsl:if> |
| 476 | </xsl:template> |
| 477 | |
| Marc Kupietz | 09745e1 | 2024-04-21 12:54:10 +0200 | [diff] [blame] | 478 | <xsl:template match="xhtml:ul"> |
| 479 | <list type="unordered"> |
| 480 | <xsl:apply-templates/> |
| 481 | </list> |
| 482 | </xsl:template> |
| 483 | <xsl:template match="xhtml:ol"> |
| 484 | <list type="ordered"> |
| 485 | <xsl:apply-templates/> |
| 486 | </list> |
| 487 | </xsl:template> |
| 488 | <xsl:template match="xhtml:li"> |
| 489 | <item> |
| 490 | <xsl:apply-templates/> |
| 491 | </item> |
| 492 | </xsl:template> |
| 493 | <xsl:template match="xhtml:nav"> |
| Marc Kupietz | 1e6bfd1 | 2024-04-10 16:33:20 +0200 | [diff] [blame] | 494 | <!-- <gap reason="toc"/> --> |
| 495 | </xsl:template> |
| 496 | |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 497 | <xsl:template match="xhtml:img"> |
| 498 | <!-- <gap reason="image"/> --> |
| 499 | </xsl:template> |
| 500 | |
| Marc Kupietz | 1e6bfd1 | 2024-04-10 16:33:20 +0200 | [diff] [blame] | 501 | <xsl:template match="xhtml:audio"> |
| 502 | <!-- <gap reason="audio"/> --> |
| 503 | </xsl:template> |
| 504 | |
| Marc Kupietz | 09745e1 | 2024-04-21 12:54:10 +0200 | [diff] [blame] | 505 | <xsl:template match="xhtml:table"> |
| 506 | <!-- <gap reason="table"/> --> |
| 507 | </xsl:template> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 508 | <xsl:template match="xhtml:body/xhtml:a"> |
| Marc Kupietz | 164a283 | 2024-04-14 21:00:48 +0200 | [diff] [blame] | 509 | <xsl:if test="normalize-space(.)"> |
| 510 | <p> |
| 511 | <ref target="{@href}"> |
| 512 | <xsl:apply-templates /> |
| 513 | </ref> |
| 514 | </p> |
| 515 | </xsl:if> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 516 | </xsl:template> |
| 517 | |
| 518 | <xsl:template match="xhtml:body/xhtml:span"> |
| 519 | <xsl:message> |
| 520 | <xsl:text>unhandled span element: </xsl:text><xsl:value-of select="concat(name(), ' ', string-join(./@*[normalize-space(.) != '']/concat(name(), ':', ., ' '), '_'))"/> |
| 521 | </xsl:message> |
| 522 | <div type="section"> |
| 523 | <p> |
| 524 | <xsl:value-of select="."/> |
| 525 | </p> |
| 526 | </div> |
| 527 | </xsl:template> |
| 528 | <xsl:template match="xhtml:span"> |
| 529 | <xsl:message> |
| 530 | <xsl:text>unhandled span element: </xsl:text><xsl:value-of select="concat(name(), ' ', string-join(./@*[normalize-space(.) != '']/concat(name(), ':', ., ' '), '_'))"/> |
| 531 | </xsl:message> |
| 532 | <xsl:value-of select="."/> |
| 533 | </xsl:template> |
| Marc Kupietz | 99ec04b | 2024-03-16 11:30:03 +0100 | [diff] [blame] | 534 | <xsl:template match="xhtml:a"> |
| Marc Kupietz | 164a283 | 2024-04-14 21:00:48 +0200 | [diff] [blame] | 535 | <xsl:if test="normalize-space(.)"> |
| 536 | <ref target="{@href}"> |
| 537 | <xsl:apply-templates /> |
| 538 | </ref> |
| 539 | </xsl:if> |
| Marc Kupietz | 99ec04b | 2024-03-16 11:30:03 +0100 | [diff] [blame] | 540 | </xsl:template> |
| 541 | |
| Marc Kupietz | 54ec28b | 2024-04-27 10:07:06 +0200 | [diff] [blame] | 542 | <xsl:template match="xhtml:br"> |
| 543 | <lb/><xsl:text> </xsl:text> |
| 544 | </xsl:template> |
| Marc Kupietz | 99ec04b | 2024-03-16 11:30:03 +0100 | [diff] [blame] | 545 | |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 546 | <xsl:template match="xhtml:*"> |
| 547 | <xsl:message> |
| 548 | <xsl:text>unhandled element: </xsl:text><xsl:value-of select="concat(name(), ' ', string-join(./@*[normalize-space(.) != '']/concat(name(), ':', ., ' '), '_'))"/> |
| 549 | </xsl:message> |
| Marc Kupietz | 4b1f595 | 2024-04-13 20:04:56 +0000 | [diff] [blame] | 550 | <xsl:choose> |
| 551 | <xsl:when test="descendant::xhtml:div|descendant::xhtml:p|parent::xhtml:body"> |
| 552 | <div type="section"> |
| 553 | <xsl:apply-templates/> |
| 554 | </div> |
| 555 | </xsl:when> |
| 556 | <xsl:otherwise> |
| 557 | <xsl:apply-templates select="./*|node()"/> |
| 558 | </xsl:otherwise> |
| 559 | </xsl:choose> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 560 | <xsl:apply-templates/> |
| 561 | </xsl:template> |
| 562 | |
| 563 | <xsl:function name="ids:reversedAuthors"> |
| 564 | <xsl:param name="s" /> |
| 565 | <xsl:value-of |
| 566 | select=" |
| 567 | if (matches($s, ';')) then |
| 568 | concat(ids:reversedAuthors(substring-before($s, ' ; ')), ' ; ', ids:reversedAuthors(substring-after($s, ' ; '))) |
| 569 | else |
| 570 | replace($s, '(.+) (.+)', '$2, $1')" |
| 571 | /> |
| 572 | </xsl:function> |
| 573 | |
| 574 | <xsl:function name="hlu:reversedAuthors"> |
| 575 | <xsl:param name="s"/> |
| 576 | <xsl:value-of |
| 577 | select="if (matches($s, ';')) then concat(ids:reversedAuthors(substring-before($s, ' ; ')), ' ; ', ids:reversedAuthors(substring-after($s, ' ; '))) else replace($s, '(.+),(.+)', '$2, $1')" |
| 578 | /> |
| 579 | </xsl:function> |
| 580 | |
| Marc Kupietz | 10903f3 | 2024-04-14 14:21:18 +0200 | [diff] [blame] | 581 | <xsl:variable name="city-country-map" as="map(xs:string, xs:string)"> |
| 582 | <xsl:map> |
| 583 | <xsl:map-entry key="'Axams'" select="'AT'"/> |
| 584 | <xsl:map-entry key="'Vienna'" select="'AT'"/> |
| 585 | <xsl:map-entry key="'Klagenfurt'" select="'AT'"/> |
| 586 | <xsl:map-entry key="'Graz'" select="'AT'"/> |
| 587 | <xsl:map-entry key="'Innsbruck'" select="'AT'"/> |
| 588 | <xsl:map-entry key="'Salzburg'" select="'AT'"/> |
| 589 | <xsl:map-entry key="'Bern'" select="'CH'"/> |
| 590 | <xsl:map-entry key="'Biel/Bienne'" select="'CH'"/> |
| 591 | <xsl:map-entry key="'Zurich'" select="'CH'"/> |
| 592 | <xsl:map-entry key="'Basel'" select="'CH'"/> |
| 593 | <xsl:map-entry key="'Geneva'" select="'CH'"/> |
| 594 | <xsl:map-entry key="'Lucerne'" select="'CH'"/> |
| 595 | <xsl:map-entry key="'Lausanne'" select="'CH'"/> |
| 596 | <xsl:map-entry key="'Winterthur'" select="'CH'"/> |
| 597 | <xsl:map-entry key="'St. Gallen'" select="'CH'"/> |
| 598 | <xsl:map-entry key="'Interlaken'" select="'CH'"/> |
| 599 | <xsl:map-entry key="'Brussels'" select="'BE'"/> |
| 600 | <xsl:map-entry key="'Antwerp'" select="'BE'"/> |
| 601 | <xsl:map-entry key="'Ghent'" select="'BE'"/> |
| 602 | <xsl:map-entry key="'Bruges'" select="'BE'"/> |
| 603 | <xsl:map-entry key="'Leuven'" select="'BE'"/> |
| 604 | <xsl:map-entry key="'Liege'" select="'BE'"/> |
| 605 | <xsl:map-entry key="'Charleroi'" select="'BE'"/> |
| 606 | <xsl:map-entry key="'Namur'" select="'BE'"/> |
| 607 | <xsl:map-entry key="'Mons'" select="'BE'"/> |
| 608 | <xsl:map-entry key="'Bangkok'" select="'TH'"/> |
| 609 | <xsl:map-entry key="'Copenhagen'" select="'DK'"/> |
| 610 | <xsl:map-entry key="'colatina'" select="'BR'"/> |
| 611 | <xsl:map-entry key="'Oakland Park'" select="'US'"/> |
| 612 | <xsl:map-entry key="'Istanbul'" select="'TR'"/> |
| 613 | <xsl:map-entry key="'Luxemburg'" select="'LU'"/> |
| 614 | <xsl:map-entry key="'Palma de Mallorca'" select="'ES'"/> |
| 615 | <xsl:map-entry key="'Swakopmund'" select="'NA'"/> |
| 616 | <xsl:map-entry key="'Victoria'" select="'CA'"/> |
| 617 | <xsl:map-entry key="'Wien'" select="'AT'"/> |
| 618 | <xsl:map-entry key="'Windhoek'" select="'NA'"/> |
| 619 | <xsl:map-entry key="'Zuerich'" select="'CH'"/> |
| 620 | <xsl:map-entry key="'Zürich'" select="'CH'"/> |
| 621 | <xsl:map-entry key="'Zug'" select="'CH'"/> |
| 622 | <xsl:map-entry key="'ZÜRICH'" select="'CH'"/> |
| 623 | </xsl:map> |
| Marc Kupietz | d8599fc | 2024-04-14 13:16:56 +0200 | [diff] [blame] | 624 | |
| Marc Kupietz | 10903f3 | 2024-04-14 14:21:18 +0200 | [diff] [blame] | 625 | </xsl:variable> |
| 626 | |
| 627 | <!-- Define the function --> |
| 628 | <xsl:function name="ids:country-city" as="xs:string"> |
| 629 | <xsl:param name="city" as="xs:string"/> |
| 630 | <xsl:sequence select="if (map:contains($city-country-map, $city)) then map:get($city-country-map, $city) else 'DE'"/> |
| 631 | </xsl:function> |
| Marc Kupietz | 1a42266 | 2024-03-16 09:34:10 +0100 | [diff] [blame] | 632 | </xsl:stylesheet> |