Wiki source code of Default eMagiz XSLT Functions

Last modified by Danniar Firdausy on 2024/09/17 09:18

Hide last authors
eMagiz 1.1 1
eMagiz 2.1 2 {{container}}
3 {{container layoutStyle="columns"}}
4 (((
eMagiz 1.1 5
Danniar Firdausy 14.2 6 In this microlearning, we will explore several key XSLT functions available on the eMagiz platform that you can use when transforming messages. Whether you are familiarizing yourself with date and time formatting or learning to adjust time zones, this session will provide practical insights and examples.
eMagiz 1.1 7
eMagiz 3.1 8 Should you have any questions, please contact [[academy@emagiz.com>>mailto:academy@emagiz.com]].
eMagiz 1.1 9
10 == 1. Prerequisites ==
11
12 * Basic knowledge of the eMagiz platform
13
14 == 2. Key concepts ==
15
16 This microlearning discusses the standard eMagiz XSLT Functions that the platform offers.
17
18 Some of these XSLT Functions are:
19
20 * remove-timezone-from-dateTime
21 * adjust-timezone-to-dateTime
22 * call-xslt-extension-gateway
23
24 Apart from that, multiple other XSLT Functions will be described.
25
26 == 3. eMagiz XSLT Functions ==
27
Erik Bakker 11.1 28 In addition to the standard XPath/XSLT functions (see [[W3Schools>>https://www.w3schools.com/xml/xpath_intro.asp||target="blank"]]), eMagiz also supports the functions that are listed below. These extension functions are located in following namespaces:
eMagiz 1.1 29
Erik Bakker 10.1 30 * {{code}}http://www.emagiz.com/ns/mapping/1.0/{{/code}} for the mapping functions (prefixed with `mapping` in this document)
31 * {{code}}http://www.emagiz.com/ns/xml/1.0/{{/code}} for generic eMagiz extension functions (prefixed with `ezx` in this document)
eMagiz 1.1 32
Erik Bakker 5.1 33 === 3.1 lookup-cdm-code ===
eMagiz 1.1 34
Erik Bakker 4.1 35 {{code}}string mapping:lookup-cdm-code(string system, string codeType, string systemCode, boolean mustExist){{/code}}
eMagiz 1.1 36
37 Looks up the CDM code for the given system code. If caching is enabled, the CDM code will be returned from the cache if possible, otherwise it will be added to the cache after performing the lookup so subsequent calls can use this cached value.
38
Erik Bakker 5.1 39 ==== Parameters ====
eMagiz 1.1 40
41 * **system** identifier of the system to do the lookup for (not null or empty, max length 64)
42 * **codeType** type of code to do the lookup for (not null or empty, max length 64)
43 * **systemCode** system code to do the lookup for (not null or empty, max length 64)
44 * **mustExist** if true, a `MappingException` is thrown when the resulting CDM code would be null or empty
45
Erik Bakker 5.1 46 ==== Returns ====
eMagiz 1.1 47
Erik Bakker 5.1 48 The requested CDM code (if _mustExist_ is false, the value might be null or empty, indicating no code element was present in the mapping service response or the code element was present but didn't have a value)
eMagiz 1.1 49
Erik Bakker 5.1 50 === 3.2 lookup-system-code ===
eMagiz 1.1 51
Erik Bakker 4.1 52 {{code}}string mapping:lookup-system-code(string system, string codeType, string cdmCode, boolean mustExist){{/code}}
eMagiz 1.1 53
54 Looks up the system code for the given CDM code. If caching is enabled, the system code will be returned from the cache if possible, otherwise it will be added to the cache after performing the lookup so subsequent calls can use this cached value.
55
Erik Bakker 6.1 56 ==== Parameters ====
eMagiz 1.1 57
58 * **system** identifier of the system to do the lookup for (not null or empty, max length 64)
59 * **codeType** type of code to do the lookup for (not null or empty, max length 64)
60 * **cdmCode** CDM code to do the lookup for (not null or empty, max length 64)
61 * **mustExist** if true, a `MappingException` is thrown when the resulting system code would be null or empty
62
Erik Bakker 6.1 63 ==== Returns ====
eMagiz 1.1 64
65 the requested system code (if _mustExist_ is false, the value might be null or empty, indicating no code element was present in the mapping service response or the code element was present but didn't have a value)
66
Erik Bakker 6.1 67 === 3.3 lookup-custom-attribute ===
eMagiz 1.1 68
Erik Bakker 4.1 69 {{code}}string mapping:lookup-custom-attribute(string codeType, string cdmCode, string customAttribute, boolean mustExist){{/code}}
eMagiz 1.1 70
71 Looks up the value for the specified custom attribute of the given CDM code. If caching is enabled, the custom attribute value will be returned from the cache if possible, otherwise it will be added to the cache after performing the lookup so subsequent calls can use this cached value.
72
Erik Bakker 6.1 73 ==== Parameters ====
eMagiz 1.1 74
75 * **codeType** type of code to do the lookup for (not null or empty, max length 64)
76 * **cdmCode** CDM code to do the lookup for (not null or empty, max length 64)
77 * **customAttribute** custom attribute to do the lookup for (not null or empty, max length 64)
78 * **mustExist** if true, a `MappingException` is thrown when the resulting custom attribute value would be null or empty
79
Erik Bakker 6.1 80 ==== Returns ====
eMagiz 1.1 81
82 the value of the requested custom attribute (if _mustExist_ is false, the value might be null or empty, indicating no value element was present in the mapping service response or the value element was present but didn't have a value)
83
Erik Bakker 6.1 84 === 3.4 format-dateTime ===
eMagiz 1.1 85
Erik Bakker 4.1 86 {{code}}
eMagiz 1.1 87 string ezx:format-dateTime(dateTime dateTime, string pattern)
88
89 string ezx:format-dateTime(dateTime dateTime, string pattern, string timeZone)
Erik Bakker 4.1 90 {{/code}}
eMagiz 1.1 91
92 Formats a given date/time as a string using the specified pattern.
93
Erik Bakker 6.1 94 ==== Parameters ====
eMagiz 1.1 95
96 * **dateTime** the date/time to format
97 * **pattern** the pattern (a string following the [DateTimeFormat pattern syntax]) to use for formatting the date/time
98 * **timeZone** [Optional] the time zone (a string as accepted by [DateTimeZone.forID(String)]) to use when formatting the output; if not specified the time zone of the input date/time is used (which, when unspecified, defaults to UTC if the input is an instance of xs:dateTime or the JVM local time zone otherwise)
99
Erik Bakker 6.1 100 ==== Returns ====
eMagiz 1.1 101
102 The formatted date/time as a string value.
103
Erik Bakker 6.1 104 ==== Example ====
eMagiz 1.1 105
Erik Bakker 4.1 106 {{code}}ezx:format-dateTime('2014-01-01T04:45:30.000+01:00', 'E MMM dd yyyy h:mma Z'){{/code}}
eMagiz 1.1 107
Erik Bakker 7.1 108 **Result** {{code}}Wed Jan 01 2014 4:45AM +0100{{/code}}
eMagiz 1.1 109
Erik Bakker 6.1 110 ==== Example ====
eMagiz 1.1 111
Erik Bakker 4.1 112 {{code}}ezx:format-dateTime('2014-01-01T04:45:30.000+01:00', 'E MMM dd yyyy h:mma Z', 'America/New_York'){{/code}}
eMagiz 1.1 113
Erik Bakker 7.1 114 **Result** {{code}}Tue Dec 31 2013 10:45PM -0500{{/code}}
eMagiz 1.1 115
Erik Bakker 7.1 116 === 3.5 format-date ===
eMagiz 1.1 117
Erik Bakker 4.1 118 {{code}}
eMagiz 1.1 119 string ezx:format-date(date date, string pattern)
120
121 string ezx:format-date(date date, string pattern, string timeZone)
Erik Bakker 4.1 122 {{/code}}
eMagiz 1.1 123
124 Formats a given date as a string using the specified pattern.
125
Erik Bakker 7.1 126 ==== Parameters ====
eMagiz 1.1 127
128 * **date** the date to format
129 * **pattern** the pattern (a string following the [DateTimeFormat pattern syntax]) to use for formatting the date
130 * **timeZone** [Optional] the time zone (a string as accepted by [DateTimeZone.forID(String)]) to use when formatting the output; if not specified the time zone of the input date is used (which, when unspecified, defaults to UTC if the input is an instance of xs:date or the JVM local time zone otherwise)
131
Erik Bakker 7.1 132 ==== Returns ====
eMagiz 1.1 133
134 The formatted date as a string value.
135
Erik Bakker 7.1 136 ==== Example ====
eMagiz 1.1 137
Erik Bakker 4.1 138 {{code}}ezx:format-date('2014-01-01+01:00', 'E MMM dd yyyy Z'){{/code}}
eMagiz 1.1 139
Erik Bakker 7.1 140 **Result** {{code}}Wed Jan 01 2014 +0100{{/code}}
eMagiz 1.1 141
Erik Bakker 7.1 142 ==== Example ====
eMagiz 1.1 143
Erik Bakker 4.1 144 {{code}}ezx:format-date('2014-01-01+01:00', 'E MMM dd yyyy Z', 'America/New_York'){{/code}}
eMagiz 1.1 145
Erik Bakker 7.1 146 **Result** {{code}}Tue Dec 31 2013 -0500{{/code}}
eMagiz 1.1 147
Erik Bakker 7.1 148 === 3.6 format-time ===
eMagiz 1.1 149
Erik Bakker 4.1 150 {{code}}
eMagiz 1.1 151 string ezx:format-time(time time, string pattern)
152
153 string ezx:format-time(time time, string pattern, string timeZone)
Erik Bakker 4.1 154 {{/code}}
eMagiz 1.1 155
156 Formats a given time as a string using the specified pattern.
157
Erik Bakker 7.1 158 ==== Parameters ====
eMagiz 1.1 159
160 * **time** the time to format
161 * **pattern** the pattern (a string following the [DateTimeFormat pattern syntax]) to use for formatting the time
162 * **timeZone** [Optional] the time zone (a string as accepted by [DateTimeZone.forID(String)]) to use when formatting the output; if not specified the time zone of the input time is used (which, when unspecified, defaults to UTC if the input is an instance of xs:time or the JVM local time zone otherwise)
163
Erik Bakker 7.1 164 ==== Returns ====
eMagiz 1.1 165
166 The formatted time as a string value.
167
Erik Bakker 7.1 168 ==== Example ====
eMagiz 1.1 169
Erik Bakker 4.1 170 {{code}}ezx:format-time('04:45:30.000+01:00', 'h:mma Z'){{/code}}
eMagiz 1.1 171
Erik Bakker 7.1 172 **Result** {{code}}4:45AM +0100{{/code}}
eMagiz 1.1 173
174 ==== Example: ====
175
Erik Bakker 4.1 176 {{code}}ezx:format-time('04:45:30.000+01:00', 'h:mma Z', 'America/New_York'){{/code}}
eMagiz 1.1 177
Erik Bakker 7.1 178 **Result** {{code}}10:45PM -0500{{/code}}
eMagiz 1.1 179
Erik Bakker 7.1 180 === 3.7 parse-dateTime ===
eMagiz 1.1 181
Erik Bakker 4.1 182 {{code}}
eMagiz 1.1 183 dateTime ezx:parse-dateTime(string stringValue, string pattern)
184
185 dateTime ezx:parse-dateTime(string stringValue, string pattern, string timeZone)
Erik Bakker 4.1 186 {{/code}}
eMagiz 1.1 187
188 Parses a given string value into a date/time using the specified pattern.
189
Erik Bakker 7.1 190 ==== Parameters ====
eMagiz 1.1 191
192 * **stringValue** the string value to parse into a date/time
193 * **pattern** the pattern (a string following the [DateTimeFormat pattern syntax]) to use for parsing the string value into a date/time
194 * **timeZone** [Optional] the time zone (a string as accepted by [DateTimeZone.forID(String)]) to use when parsing the input, completely ignoring any time zone information in the string value; if not specified the time zone information in the string value is used (which, when not present, defaults to the JVM local time zone)
195
Erik Bakker 7.1 196 ==== Returns ====
eMagiz 1.1 197
198 The parsed date/time as a dateTime value.
199
Erik Bakker 7.1 200 ==== Example ====
eMagiz 1.1 201
Erik Bakker 4.1 202 {{code}}ezx:parse-dateTime('Wed Jan 01 2014 4:45AM +0100', 'E MMM dd yyyy h:mma Z'){{/code}}
eMagiz 1.1 203
Erik Bakker 7.1 204 **Result** {{code}}2014-01-01T04:45:00+01:00{{/code}}
eMagiz 1.1 205
Erik Bakker 7.1 206 ==== Example ====
eMagiz 1.1 207
Erik Bakker 4.1 208 {{code}}ezx:parse-dateTime('Wed Jan 01 2014 4:45AM +0100', 'E MMM dd yyyy h:mma Z', 'America/New_York'){{/code}}
eMagiz 1.1 209
Erik Bakker 7.1 210 **Result** {{code}}2014-01-01T04:45:00-05:00{{/code}}
eMagiz 1.1 211
Erik Bakker 7.1 212 === 3.8 parse-date ===
eMagiz 1.1 213
Erik Bakker 4.1 214 {{code}}
eMagiz 1.1 215 date ezx:parse-date(string stringValue, string pattern)
216
217 date ezx:parse-date(string stringValue, string pattern, string timeZone)
Erik Bakker 4.1 218 {{/code}}
eMagiz 1.1 219
220 Parses a given string value into a date using the specified pattern.
221
Erik Bakker 7.1 222 ==== Parameters ====
eMagiz 1.1 223
224 * **stringValue** the string value to parse into a date
225 * **pattern** the pattern (a string following the [DateTimeFormat pattern syntax]) to use for parsing the string value into a date
226 * **timeZone** [Optional] the time zone (a string as accepted by [DateTimeZone.forID(String)]) to use when parsing the input, completely ignoring any time zone information in the string value; if not specified the time zone information in the string value is used (which, when not present, defaults to the JVM local time zone)
227
Erik Bakker 7.1 228 ==== Returns ====
eMagiz 1.1 229
230 The parsed date as a date value.
231
Erik Bakker 7.1 232 ==== Example ====
eMagiz 1.1 233
Erik Bakker 4.1 234 {{code}}ezx:parse-date('Wed Jan 01 2014 +0100', 'E MMM dd yyyy Z'){{/code}}
eMagiz 1.1 235
Erik Bakker 7.1 236 **Result** {{code}}2014-01-01+01:00{{/code}}
eMagiz 1.1 237
238 ==== Example: ====
239
Erik Bakker 4.1 240 {{code}}ezx:parse-date('Wed Jan 01 2014 +0100', 'E MMM dd yyyy Z', 'America/New_York'){{/code}}
eMagiz 1.1 241
Erik Bakker 7.1 242 **Result** {{code}}2014-01-01-05:00{{/code}}
eMagiz 1.1 243
Erik Bakker 7.1 244 === 3.9 parse-time ===
eMagiz 1.1 245
Erik Bakker 4.1 246 {{code}}
eMagiz 1.1 247 time ezx:parse-time(string stringValue, string pattern)
248
249 time ezx:parse-time(string stringValue, string pattern, string timeZone)
Erik Bakker 4.1 250 {{/code}}
eMagiz 1.1 251
252 Parses a given string value into a time using the specified pattern.
253
Erik Bakker 7.1 254 ==== Parameters ====
eMagiz 1.1 255
256 * **stringValue** the string value to parse into a time
257 * **pattern** the pattern (a string following the [DateTimeFormat pattern syntax]) to use for parsing the string value into a time
258 * **timeZone** [Optional] the time zone (a string as accepted by [DateTimeZone.forID(String)]) to use when parsing the input, completely ignoring any time zone information in the string value; if not specified the time zone information in the string value is used (which, when not present, defaults to the JVM local time zone)
259
Erik Bakker 7.1 260 ==== Returns ====
eMagiz 1.1 261
262 The parsed time as a time value.
263
Erik Bakker 7.1 264 ==== Example ====
eMagiz 1.1 265
Erik Bakker 4.1 266 {{code}}ezx:parse-time('4:45AM +0100', 'h:mma Z'){{/code}}
eMagiz 1.1 267
Erik Bakker 7.1 268 **Result** {{code}}04:45:00+01:00{{/code}}
eMagiz 1.1 269
Erik Bakker 7.1 270 ==== Example ====
eMagiz 1.1 271
Erik Bakker 4.1 272 {{code}}ezx:parse-time('4:45AM +0100', 'h:mma Z', 'America/New_York'){{/code}}
eMagiz 1.1 273
Erik Bakker 7.1 274 **Result** {{code}}04:45:00-05:00{{/code}}
eMagiz 1.1 275
Erik Bakker 8.1 276 === 3.10 remove-timezone-from-dateTime ===
eMagiz 1.1 277
Erik Bakker 4.1 278 {{code}}
eMagiz 1.1 279 dateTime ezx:remove-timezone-from-dateTime(dateTime dateTime)
Erik Bakker 4.1 280 {{/code}}
eMagiz 1.1 281
282 Removes all timezone information from the given date/time without changing its value.
283
Erik Bakker 7.1 284 ==== Parameters ====
eMagiz 1.1 285
286 * **dateTime** the date/time to remove the timezone information from
287
Erik Bakker 7.1 288 ==== Returns ====
eMagiz 1.1 289
290 The date/time without any timezone information as a dateTime value.
291
Erik Bakker 7.1 292 ==== Example ====
eMagiz 1.1 293
Erik Bakker 4.1 294 {{code}}ezx:remove-timezone-from-dateTime('2014-01-01T04:45:30.000+01:00'){{/code}}
eMagiz 1.1 295
Erik Bakker 7.1 296 **Result** {{code}}2014-01-01T04:45:30{{/code}}
eMagiz 1.1 297
Erik Bakker 8.1 298 === 3.11 remove-timezone-from-date ===
eMagiz 1.1 299
Erik Bakker 4.1 300 {{code}}
eMagiz 1.1 301 date ezx:remove-timezone-from-date(date date)
Erik Bakker 4.1 302 {{/code}}
eMagiz 1.1 303
304 Removes all timezone information from the given date without changing its value.
305
Erik Bakker 7.1 306 ==== Parameters ====
eMagiz 1.1 307
308 * **date** the date to remove the timezone information from
309
Erik Bakker 7.1 310 ==== Returns ====
eMagiz 1.1 311
312 The date without any timezone information as a date value.
313
Erik Bakker 7.1 314 ==== Example ====
eMagiz 1.1 315
Erik Bakker 4.1 316 {{code}}ezx:remove-timezone-from-date('2014-01-01+01:00'){{/code}}
eMagiz 1.1 317
Erik Bakker 7.1 318 **Result** {{code}}2014-01-01{{/code}}
eMagiz 1.1 319
Erik Bakker 8.1 320 === 3.12 remove-timezone-from-time ===
eMagiz 1.1 321
Erik Bakker 4.1 322 {{code}}
eMagiz 1.1 323 time ezx:remove-timezone-from-time(time time)
Erik Bakker 4.1 324 {{/code}}
eMagiz 1.1 325
326 Removes all timezone information from the given time without changing its value.
327
Erik Bakker 7.1 328 ==== Parameters ====
eMagiz 1.1 329
330 * **time** the time to remove the timezone information from
331
Erik Bakker 7.1 332 ==== Returns ====
eMagiz 1.1 333
334 The time without any timezone information as a time value.
335
Erik Bakker 7.1 336 ==== Example ====
eMagiz 1.1 337
Erik Bakker 7.1 338 {{code}}ezx:remove-timezone-from-time('04:45:30.000+01:00'){{/code}}
eMagiz 1.1 339
Erik Bakker 7.1 340 **Result** {{code}}04:45:30{{/code}}
eMagiz 1.1 341
Erik Bakker 8.1 342 === 3.13 adjust-dateTime-to-timezone ===
eMagiz 1.1 343
Erik Bakker 7.1 344 {{code}}dateTime ezx:adjust-dateTime-to-timezone(dateTime dateTime, string timeZone){{/code}}
eMagiz 1.1 345
346 Adjusts the given date/time to the specified timezone (respecting the original timezone).
347
Erik Bakker 7.1 348 ==== Parameters ====
eMagiz 1.1 349
350 * **dateTime** the date/time to adjust to a timezone; when the timezone of this date/time is unspecified, it defaults to UTC if the input is an instance of xs:dateTime or the JVM local time zone otherwise
351 * **timeZone** the time zone (a string as accepted by [DateTimeZone.forID(String)]) to adjust the date/time to
352
Erik Bakker 7.1 353 ==== Returns ====
eMagiz 1.1 354
355 The adjusted date/time as a dateTime value.
356
Erik Bakker 7.1 357 ==== Example ====
eMagiz 1.1 358
Erik Bakker 7.1 359 {{code}}ezx:adjust-dateTime-to-timezone('2014-01-01T04:45:30.000+01:00', 'America/New_York'){{/code}}
eMagiz 1.1 360
Erik Bakker 7.1 361 **Result** {{code}}2013-12-31T22:45:30-05:00{{/code}}
eMagiz 1.1 362
Erik Bakker 8.1 363 === 3.14 adjust-date-to-timezone ===
eMagiz 1.1 364
Erik Bakker 7.1 365 {{code}}date ezx:adjust-date-to-timezone(date date, string timeZone){{/code}}
eMagiz 1.1 366
367 Adjusts the given date to the specified timezone (respecting the original timezone).
368
Erik Bakker 7.1 369 ==== Parameters ====
eMagiz 1.1 370
371 * **date** the date to adjust to a timezone; when the timezone of this date is unspecified, it defaults to UTC if the input is an instance of xs:date or the JVM local time zone otherwise
372 * **timeZone** the time zone (a string as accepted by [DateTimeZone.forID(String)]) to adjust the date to
373
Erik Bakker 7.1 374 ==== Returns ====
eMagiz 1.1 375
376 The adjusted date as a date value.
377
Erik Bakker 7.1 378 ==== Example ====
eMagiz 1.1 379
Erik Bakker 7.1 380 {{code}}ezx:adjust-date-to-timezone('2014-01-01+01:00', 'America/New_York'){{/code}}
eMagiz 1.1 381
Erik Bakker 7.1 382 **Result** {{code}}2013-12-31-05:00{{/code}}
eMagiz 1.1 383
Erik Bakker 8.1 384 === 3.15 adjust-time-to-timezone ===
eMagiz 1.1 385
Erik Bakker 7.1 386 {{code}}time ezx:adjust-time-to-timezone(time time, string timeZone){{/code}}
eMagiz 1.1 387
388 Adjusts the given time to the specified timezone (respecting the original timezone).
389
Erik Bakker 7.1 390 ==== Parameters ====
eMagiz 1.1 391
392 * **time** the time to adjust to a timezone; when the timezone of this time is unspecified, it defaults to UTC if the input is an instance of xs:time or the JVM local time zone otherwise
393 * **timeZone** the time zone (a string as accepted by [DateTimeZone.forID(String)]) to adjust the time to
394
Erik Bakker 7.1 395 ==== Returns ====
eMagiz 1.1 396
397 The adjusted time as a time value.
398
Erik Bakker 7.1 399 ==== Example ====
eMagiz 1.1 400
Erik Bakker 7.1 401 {{code}}ezx:adjust-time-to-timezone('04:45:30.000+01:00', 'America/New_York'){{/code}}
eMagiz 1.1 402
Erik Bakker 7.1 403 **Result** {{code}}22:45:30-05:00{{/code}}
eMagiz 1.1 404
Erik Bakker 8.1 405 === 3.16 override-timezone-of-dateTime ===
eMagiz 1.1 406
Erik Bakker 7.1 407 {{code}}dateTime ezx:override-timezone-of-dateTime(dateTime dateTime, string timeZone){{/code}}
eMagiz 1.1 408
409 Overrides the timezone of the given date/time with the specified timezone (ignoring the original timezone).
410
Erik Bakker 7.1 411 ==== Parameters ====
eMagiz 1.1 412
413 * **dateTime** the date/time to override the timezone of; whether this date/time specifies a timezone or not is irrelevant, as it will be overridden anyway
414 * **timeZone** the time zone (a string as accepted by [DateTimeZone.forID(String)]) to override the date/time with
415
Erik Bakker 7.1 416 ==== Returns ====
eMagiz 1.1 417
418 The date/time with the new timezone as a dateTime value.
419
Erik Bakker 7.1 420 ==== Example ====
eMagiz 1.1 421
Erik Bakker 7.1 422 {{code}}ezx:override-timezone-of-dateTime('2014-01-01T04:45:30.000+01:00', 'America/New_York'){{/code}}
eMagiz 1.1 423
Erik Bakker 7.1 424 **Result** {{code}}2014-01-01T04:45:30-05:00{{/code}}
eMagiz 1.1 425
Erik Bakker 8.1 426 === 3.17 override-timezone-of-date ===
eMagiz 1.1 427
Erik Bakker 7.1 428 {{code}}date ezx:override-timezone-of-date(date date, string timeZone){{/code}}
eMagiz 1.1 429
430 Overrides the timezone of the given date with the specified timezone (ignoring the original timezone).
431
Erik Bakker 7.1 432 ==== Parameters ====
eMagiz 1.1 433
434 * **date** the date to override the timezone of; whether this date specifies a timezone or not is irrelevant, as it will be overridden anyway
435 * **timeZone** the time zone (a string as accepted by [DateTimeZone.forID(String)]) to override the date with
436
Erik Bakker 7.1 437 ==== Returns ====
eMagiz 1.1 438
439 The date with the new timezone as a date value.
440
Erik Bakker 7.1 441 ==== Example ====
eMagiz 1.1 442
Erik Bakker 7.1 443 {{code}}ezx:override-timezone-of-date('2014-01-01+01:00', 'America/New_York'){{/code}}
eMagiz 1.1 444
Erik Bakker 7.1 445 **Result** {{code}}2014-01-01-05:00{{/code}}
eMagiz 1.1 446
Erik Bakker 8.1 447 === 3.18 override-timezone-of-time ===
eMagiz 1.1 448
Erik Bakker 7.1 449 {{code}}time ezx:override-timezone-of-time(time time, string timeZone){{/code}}
eMagiz 1.1 450
451 Overrides the timezone of the given time with the specified timezone (ignoring the original timezone).
452
Erik Bakker 7.1 453 ==== Parameters ====
eMagiz 1.1 454
455 * **time** the time to override the timezone of; whether this time specifies a timezone or not is irrelevant, as it will be overridden anyway
456 * **timeZone** the time zone (a string as accepted by [DateTimeZone.forID(String)]) to override the time with
457
Erik Bakker 7.1 458 ==== Returns ====
eMagiz 1.1 459
460 The time with the new timezone as a time value.
461
Erik Bakker 7.1 462 ==== Example ====
eMagiz 1.1 463
Erik Bakker 7.1 464 {{code}}ezx:override-timezone-of-time('04:45:30.000+01:00', 'America/New_York'){{/code}}
eMagiz 1.1 465
Erik Bakker 7.1 466 **Result** {{code}}04:45:30-05:00{{/code}}
eMagiz 1.1 467
Erik Bakker 8.1 468 === 3.19 call-xslt-extension-gateway ===
eMagiz 1.1 469
Erik Bakker 7.1 470 {{code}}node ezx:call-xslt-extension-gateway(gateway gateway, node request){{/code}}
eMagiz 1.1 471
472 Calls the given XSLT extension gateway and returns the response XML message.
473
Erik Bakker 7.1 474 ==== Parameters ====
eMagiz 1.1 475
476 * **gateway** the XSLT extension gateway to call (should be passed to the stylesheet as an `<xsl:param/>` value)
477 * **request** the request message (a single XML node) to send to the gateway; this XML node will be serialized into a string value before sending it to the gateway
478
Erik Bakker 7.1 479 ==== Returns ====
eMagiz 1.1 480
481 The response message (a single XML node) received from the gateway; the gateway's string response will be parsed as an XML document before it is returned.
482
Erik Bakker 7.1 483 ==== Example ====
eMagiz 1.1 484
Erik Bakker 7.1 485 {{code}}ezx:call-xslt-extension-gateway($gateway, //Customer[1]){{/code}}
eMagiz 1.1 486
Erik Bakker 7.1 487 **Result** {{code}}<CustomerDetails>...</CustomerDetails>{{/code}}
eMagiz 1.1 488
Eva Torken 13.1 489 == 4. Key takeaways ==
eMagiz 1.1 490
Danniar Firdausy 14.8 491 eMagiz provides a variety of powerful XSLT extension functions that enhance the standard XSLT/XPath capabilities, supporting efficient message transformation within the platform.
Danniar Firdausy 14.3 492
Danniar Firdausy 14.8 493 * remove-timezone-from-dateTime, adjust-dateTime-to-timezone, and format-dateTime allow for flexible manipulation of dates, times, and time zones.
494 * lookup-cdm-code and lookup-system-code streamline code translations between different systems.
495 * lookup-custom-attribute allow for retrieving custom attributes, offering advanced customization options when working with specific data types.
496 * call-xslt-extension-gateway function allows direct interaction with external gateways, enabling complex logic execution and data retrieval during transformations.
497
Eva Torken 13.1 498 == 5. Suggested Additional Readings ==
eMagiz 1.1 499
Danniar Firdausy 14.1 500 If you are interested in this topic and want more information on it please read the help text provided by eMagiz and read the following links:
eMagiz 1.1 501
Danniar Firdausy 13.4 502 * [[Novice (Menu)>>doc:Main.eMagiz Academy.Microlearnings.Novice.WebHome||target="blank"]]
503 ** [[Create your transformations (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Novice.Create your transformations.WebHome||target="blank"]]
504 *** [[XSLT Parameters (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Novice.Create your transformations.novice-create-your-transformations-xslt-parameters||target="blank"]]
505 *** [[XSLT Snippets (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Novice.Create your transformations.novice-create-your-transformations-xslt-snippet||target="blank"]]
Danniar Firdausy 13.2 506 * [[XSLT Functions (Search Results)>>url:https://docs.emagiz.com/bin/view/Main/Search?sort=score&sortOrder=desc&highlight=true&facet=true&r=1&f_space_facet=0%2FMain.&l_space_facet=10&f_type=DOCUMENT&f_locale=en&f_locale=&f_locale=en&text=%22XSLT+functions%22||target="blank"]]
Danniar Firdausy 13.3 507 * [[XSL Functions (External)>>https://www.w3schools.com/xml/xsl_functions.asp||target="blank"]]
508 * [[DateTime format syntax (External)>>http://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html||target="blank"]]
509 * [[DateTimeZone For ID (External)>>http://joda-time.sourceforge.net/apidocs/org/joda/time/DateTimeZone.html#forID(java.lang.String)||target="blank"]]
Danniar Firdausy 13.2 510
eMagiz 2.1 511 )))
eMagiz 1.1 512
eMagiz 2.1 513 ((({{toc/}}))){{/container}}
514 {{/container}}