Wiki source code of Default eMagiz XSLT Functions
Last modified by Danniar Firdausy on 2024/09/17 09:18
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
1.1 | 1 | |
![]() |
2.1 | 2 | {{container}} |
3 | {{container layoutStyle="columns"}} | ||
4 | ((( | ||
![]() |
1.1 | 5 | |
![]() |
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. |
![]() |
1.1 | 7 | |
![]() |
3.1 | 8 | Should you have any questions, please contact [[academy@emagiz.com>>mailto:academy@emagiz.com]]. |
![]() |
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 | |||
![]() |
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: |
![]() |
1.1 | 29 | |
![]() |
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) | ||
![]() |
1.1 | 32 | |
![]() |
5.1 | 33 | === 3.1 lookup-cdm-code === |
![]() |
1.1 | 34 | |
![]() |
4.1 | 35 | {{code}}string mapping:lookup-cdm-code(string system, string codeType, string systemCode, boolean mustExist){{/code}} |
![]() |
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 | |||
![]() |
5.1 | 39 | ==== Parameters ==== |
![]() |
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 | |||
![]() |
5.1 | 46 | ==== Returns ==== |
![]() |
1.1 | 47 | |
![]() |
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) |
![]() |
1.1 | 49 | |
![]() |
5.1 | 50 | === 3.2 lookup-system-code === |
![]() |
1.1 | 51 | |
![]() |
4.1 | 52 | {{code}}string mapping:lookup-system-code(string system, string codeType, string cdmCode, boolean mustExist){{/code}} |
![]() |
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 | |||
![]() |
6.1 | 56 | ==== Parameters ==== |
![]() |
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 | |||
![]() |
6.1 | 63 | ==== Returns ==== |
![]() |
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 | |||
![]() |
6.1 | 67 | === 3.3 lookup-custom-attribute === |
![]() |
1.1 | 68 | |
![]() |
4.1 | 69 | {{code}}string mapping:lookup-custom-attribute(string codeType, string cdmCode, string customAttribute, boolean mustExist){{/code}} |
![]() |
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 | |||
![]() |
6.1 | 73 | ==== Parameters ==== |
![]() |
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 | |||
![]() |
6.1 | 80 | ==== Returns ==== |
![]() |
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 | |||
![]() |
6.1 | 84 | === 3.4 format-dateTime === |
![]() |
1.1 | 85 | |
![]() |
4.1 | 86 | {{code}} |
![]() |
1.1 | 87 | string ezx:format-dateTime(dateTime dateTime, string pattern) |
88 | |||
89 | string ezx:format-dateTime(dateTime dateTime, string pattern, string timeZone) | ||
![]() |
4.1 | 90 | {{/code}} |
![]() |
1.1 | 91 | |
92 | Formats a given date/time as a string using the specified pattern. | ||
93 | |||
![]() |
6.1 | 94 | ==== Parameters ==== |
![]() |
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 | |||
![]() |
6.1 | 100 | ==== Returns ==== |
![]() |
1.1 | 101 | |
102 | The formatted date/time as a string value. | ||
103 | |||
![]() |
6.1 | 104 | ==== Example ==== |
![]() |
1.1 | 105 | |
![]() |
4.1 | 106 | {{code}}ezx:format-dateTime('2014-01-01T04:45:30.000+01:00', 'E MMM dd yyyy h:mma Z'){{/code}} |
![]() |
1.1 | 107 | |
![]() |
7.1 | 108 | **Result** {{code}}Wed Jan 01 2014 4:45AM +0100{{/code}} |
![]() |
1.1 | 109 | |
![]() |
6.1 | 110 | ==== Example ==== |
![]() |
1.1 | 111 | |
![]() |
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}} |
![]() |
1.1 | 113 | |
![]() |
7.1 | 114 | **Result** {{code}}Tue Dec 31 2013 10:45PM -0500{{/code}} |
![]() |
1.1 | 115 | |
![]() |
7.1 | 116 | === 3.5 format-date === |
![]() |
1.1 | 117 | |
![]() |
4.1 | 118 | {{code}} |
![]() |
1.1 | 119 | string ezx:format-date(date date, string pattern) |
120 | |||
121 | string ezx:format-date(date date, string pattern, string timeZone) | ||
![]() |
4.1 | 122 | {{/code}} |
![]() |
1.1 | 123 | |
124 | Formats a given date as a string using the specified pattern. | ||
125 | |||
![]() |
7.1 | 126 | ==== Parameters ==== |
![]() |
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 | |||
![]() |
7.1 | 132 | ==== Returns ==== |
![]() |
1.1 | 133 | |
134 | The formatted date as a string value. | ||
135 | |||
![]() |
7.1 | 136 | ==== Example ==== |
![]() |
1.1 | 137 | |
![]() |
4.1 | 138 | {{code}}ezx:format-date('2014-01-01+01:00', 'E MMM dd yyyy Z'){{/code}} |
![]() |
1.1 | 139 | |
![]() |
7.1 | 140 | **Result** {{code}}Wed Jan 01 2014 +0100{{/code}} |
![]() |
1.1 | 141 | |
![]() |
7.1 | 142 | ==== Example ==== |
![]() |
1.1 | 143 | |
![]() |
4.1 | 144 | {{code}}ezx:format-date('2014-01-01+01:00', 'E MMM dd yyyy Z', 'America/New_York'){{/code}} |
![]() |
1.1 | 145 | |
![]() |
7.1 | 146 | **Result** {{code}}Tue Dec 31 2013 -0500{{/code}} |
![]() |
1.1 | 147 | |
![]() |
7.1 | 148 | === 3.6 format-time === |
![]() |
1.1 | 149 | |
![]() |
4.1 | 150 | {{code}} |
![]() |
1.1 | 151 | string ezx:format-time(time time, string pattern) |
152 | |||
153 | string ezx:format-time(time time, string pattern, string timeZone) | ||
![]() |
4.1 | 154 | {{/code}} |
![]() |
1.1 | 155 | |
156 | Formats a given time as a string using the specified pattern. | ||
157 | |||
![]() |
7.1 | 158 | ==== Parameters ==== |
![]() |
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 | |||
![]() |
7.1 | 164 | ==== Returns ==== |
![]() |
1.1 | 165 | |
166 | The formatted time as a string value. | ||
167 | |||
![]() |
7.1 | 168 | ==== Example ==== |
![]() |
1.1 | 169 | |
![]() |
4.1 | 170 | {{code}}ezx:format-time('04:45:30.000+01:00', 'h:mma Z'){{/code}} |
![]() |
1.1 | 171 | |
![]() |
7.1 | 172 | **Result** {{code}}4:45AM +0100{{/code}} |
![]() |
1.1 | 173 | |
174 | ==== Example: ==== | ||
175 | |||
![]() |
4.1 | 176 | {{code}}ezx:format-time('04:45:30.000+01:00', 'h:mma Z', 'America/New_York'){{/code}} |
![]() |
1.1 | 177 | |
![]() |
7.1 | 178 | **Result** {{code}}10:45PM -0500{{/code}} |
![]() |
1.1 | 179 | |
![]() |
7.1 | 180 | === 3.7 parse-dateTime === |
![]() |
1.1 | 181 | |
![]() |
4.1 | 182 | {{code}} |
![]() |
1.1 | 183 | dateTime ezx:parse-dateTime(string stringValue, string pattern) |
184 | |||
185 | dateTime ezx:parse-dateTime(string stringValue, string pattern, string timeZone) | ||
![]() |
4.1 | 186 | {{/code}} |
![]() |
1.1 | 187 | |
188 | Parses a given string value into a date/time using the specified pattern. | ||
189 | |||
![]() |
7.1 | 190 | ==== Parameters ==== |
![]() |
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 | |||
![]() |
7.1 | 196 | ==== Returns ==== |
![]() |
1.1 | 197 | |
198 | The parsed date/time as a dateTime value. | ||
199 | |||
![]() |
7.1 | 200 | ==== Example ==== |
![]() |
1.1 | 201 | |
![]() |
4.1 | 202 | {{code}}ezx:parse-dateTime('Wed Jan 01 2014 4:45AM +0100', 'E MMM dd yyyy h:mma Z'){{/code}} |
![]() |
1.1 | 203 | |
![]() |
7.1 | 204 | **Result** {{code}}2014-01-01T04:45:00+01:00{{/code}} |
![]() |
1.1 | 205 | |
![]() |
7.1 | 206 | ==== Example ==== |
![]() |
1.1 | 207 | |
![]() |
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}} |
![]() |
1.1 | 209 | |
![]() |
7.1 | 210 | **Result** {{code}}2014-01-01T04:45:00-05:00{{/code}} |
![]() |
1.1 | 211 | |
![]() |
7.1 | 212 | === 3.8 parse-date === |
![]() |
1.1 | 213 | |
![]() |
4.1 | 214 | {{code}} |
![]() |
1.1 | 215 | date ezx:parse-date(string stringValue, string pattern) |
216 | |||
217 | date ezx:parse-date(string stringValue, string pattern, string timeZone) | ||
![]() |
4.1 | 218 | {{/code}} |
![]() |
1.1 | 219 | |
220 | Parses a given string value into a date using the specified pattern. | ||
221 | |||
![]() |
7.1 | 222 | ==== Parameters ==== |
![]() |
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 | |||
![]() |
7.1 | 228 | ==== Returns ==== |
![]() |
1.1 | 229 | |
230 | The parsed date as a date value. | ||
231 | |||
![]() |
7.1 | 232 | ==== Example ==== |
![]() |
1.1 | 233 | |
![]() |
4.1 | 234 | {{code}}ezx:parse-date('Wed Jan 01 2014 +0100', 'E MMM dd yyyy Z'){{/code}} |
![]() |
1.1 | 235 | |
![]() |
7.1 | 236 | **Result** {{code}}2014-01-01+01:00{{/code}} |
![]() |
1.1 | 237 | |
238 | ==== Example: ==== | ||
239 | |||
![]() |
4.1 | 240 | {{code}}ezx:parse-date('Wed Jan 01 2014 +0100', 'E MMM dd yyyy Z', 'America/New_York'){{/code}} |
![]() |
1.1 | 241 | |
![]() |
7.1 | 242 | **Result** {{code}}2014-01-01-05:00{{/code}} |
![]() |
1.1 | 243 | |
![]() |
7.1 | 244 | === 3.9 parse-time === |
![]() |
1.1 | 245 | |
![]() |
4.1 | 246 | {{code}} |
![]() |
1.1 | 247 | time ezx:parse-time(string stringValue, string pattern) |
248 | |||
249 | time ezx:parse-time(string stringValue, string pattern, string timeZone) | ||
![]() |
4.1 | 250 | {{/code}} |
![]() |
1.1 | 251 | |
252 | Parses a given string value into a time using the specified pattern. | ||
253 | |||
![]() |
7.1 | 254 | ==== Parameters ==== |
![]() |
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 | |||
![]() |
7.1 | 260 | ==== Returns ==== |
![]() |
1.1 | 261 | |
262 | The parsed time as a time value. | ||
263 | |||
![]() |
7.1 | 264 | ==== Example ==== |
![]() |
1.1 | 265 | |
![]() |
4.1 | 266 | {{code}}ezx:parse-time('4:45AM +0100', 'h:mma Z'){{/code}} |
![]() |
1.1 | 267 | |
![]() |
7.1 | 268 | **Result** {{code}}04:45:00+01:00{{/code}} |
![]() |
1.1 | 269 | |
![]() |
7.1 | 270 | ==== Example ==== |
![]() |
1.1 | 271 | |
![]() |
4.1 | 272 | {{code}}ezx:parse-time('4:45AM +0100', 'h:mma Z', 'America/New_York'){{/code}} |
![]() |
1.1 | 273 | |
![]() |
7.1 | 274 | **Result** {{code}}04:45:00-05:00{{/code}} |
![]() |
1.1 | 275 | |
![]() |
8.1 | 276 | === 3.10 remove-timezone-from-dateTime === |
![]() |
1.1 | 277 | |
![]() |
4.1 | 278 | {{code}} |
![]() |
1.1 | 279 | dateTime ezx:remove-timezone-from-dateTime(dateTime dateTime) |
![]() |
4.1 | 280 | {{/code}} |
![]() |
1.1 | 281 | |
282 | Removes all timezone information from the given date/time without changing its value. | ||
283 | |||
![]() |
7.1 | 284 | ==== Parameters ==== |
![]() |
1.1 | 285 | |
286 | * **dateTime** the date/time to remove the timezone information from | ||
287 | |||
![]() |
7.1 | 288 | ==== Returns ==== |
![]() |
1.1 | 289 | |
290 | The date/time without any timezone information as a dateTime value. | ||
291 | |||
![]() |
7.1 | 292 | ==== Example ==== |
![]() |
1.1 | 293 | |
![]() |
4.1 | 294 | {{code}}ezx:remove-timezone-from-dateTime('2014-01-01T04:45:30.000+01:00'){{/code}} |
![]() |
1.1 | 295 | |
![]() |
7.1 | 296 | **Result** {{code}}2014-01-01T04:45:30{{/code}} |
![]() |
1.1 | 297 | |
![]() |
8.1 | 298 | === 3.11 remove-timezone-from-date === |
![]() |
1.1 | 299 | |
![]() |
4.1 | 300 | {{code}} |
![]() |
1.1 | 301 | date ezx:remove-timezone-from-date(date date) |
![]() |
4.1 | 302 | {{/code}} |
![]() |
1.1 | 303 | |
304 | Removes all timezone information from the given date without changing its value. | ||
305 | |||
![]() |
7.1 | 306 | ==== Parameters ==== |
![]() |
1.1 | 307 | |
308 | * **date** the date to remove the timezone information from | ||
309 | |||
![]() |
7.1 | 310 | ==== Returns ==== |
![]() |
1.1 | 311 | |
312 | The date without any timezone information as a date value. | ||
313 | |||
![]() |
7.1 | 314 | ==== Example ==== |
![]() |
1.1 | 315 | |
![]() |
4.1 | 316 | {{code}}ezx:remove-timezone-from-date('2014-01-01+01:00'){{/code}} |
![]() |
1.1 | 317 | |
![]() |
7.1 | 318 | **Result** {{code}}2014-01-01{{/code}} |
![]() |
1.1 | 319 | |
![]() |
8.1 | 320 | === 3.12 remove-timezone-from-time === |
![]() |
1.1 | 321 | |
![]() |
4.1 | 322 | {{code}} |
![]() |
1.1 | 323 | time ezx:remove-timezone-from-time(time time) |
![]() |
4.1 | 324 | {{/code}} |
![]() |
1.1 | 325 | |
326 | Removes all timezone information from the given time without changing its value. | ||
327 | |||
![]() |
7.1 | 328 | ==== Parameters ==== |
![]() |
1.1 | 329 | |
330 | * **time** the time to remove the timezone information from | ||
331 | |||
![]() |
7.1 | 332 | ==== Returns ==== |
![]() |
1.1 | 333 | |
334 | The time without any timezone information as a time value. | ||
335 | |||
![]() |
7.1 | 336 | ==== Example ==== |
![]() |
1.1 | 337 | |
![]() |
7.1 | 338 | {{code}}ezx:remove-timezone-from-time('04:45:30.000+01:00'){{/code}} |
![]() |
1.1 | 339 | |
![]() |
7.1 | 340 | **Result** {{code}}04:45:30{{/code}} |
![]() |
1.1 | 341 | |
![]() |
8.1 | 342 | === 3.13 adjust-dateTime-to-timezone === |
![]() |
1.1 | 343 | |
![]() |
7.1 | 344 | {{code}}dateTime ezx:adjust-dateTime-to-timezone(dateTime dateTime, string timeZone){{/code}} |
![]() |
1.1 | 345 | |
346 | Adjusts the given date/time to the specified timezone (respecting the original timezone). | ||
347 | |||
![]() |
7.1 | 348 | ==== Parameters ==== |
![]() |
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 | |||
![]() |
7.1 | 353 | ==== Returns ==== |
![]() |
1.1 | 354 | |
355 | The adjusted date/time as a dateTime value. | ||
356 | |||
![]() |
7.1 | 357 | ==== Example ==== |
![]() |
1.1 | 358 | |
![]() |
7.1 | 359 | {{code}}ezx:adjust-dateTime-to-timezone('2014-01-01T04:45:30.000+01:00', 'America/New_York'){{/code}} |
![]() |
1.1 | 360 | |
![]() |
7.1 | 361 | **Result** {{code}}2013-12-31T22:45:30-05:00{{/code}} |
![]() |
1.1 | 362 | |
![]() |
8.1 | 363 | === 3.14 adjust-date-to-timezone === |
![]() |
1.1 | 364 | |
![]() |
7.1 | 365 | {{code}}date ezx:adjust-date-to-timezone(date date, string timeZone){{/code}} |
![]() |
1.1 | 366 | |
367 | Adjusts the given date to the specified timezone (respecting the original timezone). | ||
368 | |||
![]() |
7.1 | 369 | ==== Parameters ==== |
![]() |
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 | |||
![]() |
7.1 | 374 | ==== Returns ==== |
![]() |
1.1 | 375 | |
376 | The adjusted date as a date value. | ||
377 | |||
![]() |
7.1 | 378 | ==== Example ==== |
![]() |
1.1 | 379 | |
![]() |
7.1 | 380 | {{code}}ezx:adjust-date-to-timezone('2014-01-01+01:00', 'America/New_York'){{/code}} |
![]() |
1.1 | 381 | |
![]() |
7.1 | 382 | **Result** {{code}}2013-12-31-05:00{{/code}} |
![]() |
1.1 | 383 | |
![]() |
8.1 | 384 | === 3.15 adjust-time-to-timezone === |
![]() |
1.1 | 385 | |
![]() |
7.1 | 386 | {{code}}time ezx:adjust-time-to-timezone(time time, string timeZone){{/code}} |
![]() |
1.1 | 387 | |
388 | Adjusts the given time to the specified timezone (respecting the original timezone). | ||
389 | |||
![]() |
7.1 | 390 | ==== Parameters ==== |
![]() |
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 | |||
![]() |
7.1 | 395 | ==== Returns ==== |
![]() |
1.1 | 396 | |
397 | The adjusted time as a time value. | ||
398 | |||
![]() |
7.1 | 399 | ==== Example ==== |
![]() |
1.1 | 400 | |
![]() |
7.1 | 401 | {{code}}ezx:adjust-time-to-timezone('04:45:30.000+01:00', 'America/New_York'){{/code}} |
![]() |
1.1 | 402 | |
![]() |
7.1 | 403 | **Result** {{code}}22:45:30-05:00{{/code}} |
![]() |
1.1 | 404 | |
![]() |
8.1 | 405 | === 3.16 override-timezone-of-dateTime === |
![]() |
1.1 | 406 | |
![]() |
7.1 | 407 | {{code}}dateTime ezx:override-timezone-of-dateTime(dateTime dateTime, string timeZone){{/code}} |
![]() |
1.1 | 408 | |
409 | Overrides the timezone of the given date/time with the specified timezone (ignoring the original timezone). | ||
410 | |||
![]() |
7.1 | 411 | ==== Parameters ==== |
![]() |
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 | |||
![]() |
7.1 | 416 | ==== Returns ==== |
![]() |
1.1 | 417 | |
418 | The date/time with the new timezone as a dateTime value. | ||
419 | |||
![]() |
7.1 | 420 | ==== Example ==== |
![]() |
1.1 | 421 | |
![]() |
7.1 | 422 | {{code}}ezx:override-timezone-of-dateTime('2014-01-01T04:45:30.000+01:00', 'America/New_York'){{/code}} |
![]() |
1.1 | 423 | |
![]() |
7.1 | 424 | **Result** {{code}}2014-01-01T04:45:30-05:00{{/code}} |
![]() |
1.1 | 425 | |
![]() |
8.1 | 426 | === 3.17 override-timezone-of-date === |
![]() |
1.1 | 427 | |
![]() |
7.1 | 428 | {{code}}date ezx:override-timezone-of-date(date date, string timeZone){{/code}} |
![]() |
1.1 | 429 | |
430 | Overrides the timezone of the given date with the specified timezone (ignoring the original timezone). | ||
431 | |||
![]() |
7.1 | 432 | ==== Parameters ==== |
![]() |
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 | |||
![]() |
7.1 | 437 | ==== Returns ==== |
![]() |
1.1 | 438 | |
439 | The date with the new timezone as a date value. | ||
440 | |||
![]() |
7.1 | 441 | ==== Example ==== |
![]() |
1.1 | 442 | |
![]() |
7.1 | 443 | {{code}}ezx:override-timezone-of-date('2014-01-01+01:00', 'America/New_York'){{/code}} |
![]() |
1.1 | 444 | |
![]() |
7.1 | 445 | **Result** {{code}}2014-01-01-05:00{{/code}} |
![]() |
1.1 | 446 | |
![]() |
8.1 | 447 | === 3.18 override-timezone-of-time === |
![]() |
1.1 | 448 | |
![]() |
7.1 | 449 | {{code}}time ezx:override-timezone-of-time(time time, string timeZone){{/code}} |
![]() |
1.1 | 450 | |
451 | Overrides the timezone of the given time with the specified timezone (ignoring the original timezone). | ||
452 | |||
![]() |
7.1 | 453 | ==== Parameters ==== |
![]() |
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 | |||
![]() |
7.1 | 458 | ==== Returns ==== |
![]() |
1.1 | 459 | |
460 | The time with the new timezone as a time value. | ||
461 | |||
![]() |
7.1 | 462 | ==== Example ==== |
![]() |
1.1 | 463 | |
![]() |
7.1 | 464 | {{code}}ezx:override-timezone-of-time('04:45:30.000+01:00', 'America/New_York'){{/code}} |
![]() |
1.1 | 465 | |
![]() |
7.1 | 466 | **Result** {{code}}04:45:30-05:00{{/code}} |
![]() |
1.1 | 467 | |
![]() |
8.1 | 468 | === 3.19 call-xslt-extension-gateway === |
![]() |
1.1 | 469 | |
![]() |
7.1 | 470 | {{code}}node ezx:call-xslt-extension-gateway(gateway gateway, node request){{/code}} |
![]() |
1.1 | 471 | |
472 | Calls the given XSLT extension gateway and returns the response XML message. | ||
473 | |||
![]() |
7.1 | 474 | ==== Parameters ==== |
![]() |
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 | |||
![]() |
7.1 | 479 | ==== Returns ==== |
![]() |
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 | |||
![]() |
7.1 | 483 | ==== Example ==== |
![]() |
1.1 | 484 | |
![]() |
7.1 | 485 | {{code}}ezx:call-xslt-extension-gateway($gateway, //Customer[1]){{/code}} |
![]() |
1.1 | 486 | |
![]() |
7.1 | 487 | **Result** {{code}}<CustomerDetails>...</CustomerDetails>{{/code}} |
![]() |
1.1 | 488 | |
![]() |
13.1 | 489 | == 4. Key takeaways == |
![]() |
1.1 | 490 | |
![]() |
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. |
![]() |
14.3 | 492 | |
![]() |
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 | |||
![]() |
13.1 | 498 | == 5. Suggested Additional Readings == |
![]() |
1.1 | 499 | |
![]() |
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: |
![]() |
1.1 | 501 | |
![]() |
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"]] | ||
![]() |
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"]] |
![]() |
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"]] | ||
![]() |
13.2 | 510 | |
![]() |
2.1 | 511 | ))) |
![]() |
1.1 | 512 | |
![]() |
2.1 | 513 | ((({{toc/}}))){{/container}} |
514 | {{/container}} |