Wednesday, 14 November 2018

BI Publisher: XDOXSLT


Description Example Result
<?xdoxslt:abs(NUMBER)?> Return absolute value of number <?xdoxslt:abs(-123.45)?> 123.45
<?xdoxslt:current_date('DD-MM-YYYY')+1?> Retrieve current time <?xdoxslt:current_date($_XDOLOCALE, $_XDOTIMEZONE)?> 2011-11-11
<?xdoxslt:current_time($_XDOLOCALE, $_XDOTIMEZONE)?> <?xdoxslt:current_time($_XDOLOCALE, $_XDOTIMEZONE)?> 12:30:44 PM
<?xdoxslt:date_diff(RESULT, FROM_DATE, TO_DATE, $_XDOLOCALE, $_XDOTIMEZONE)?> Determine difference between dates <?xdoxslt:date_diff(‘m', ‘2010-07-30’, ‘2010-12-31’, $_XDOLOCALE, $_XDOTIMEZONE)?> 5
<?xdoxslt:foreach_number($_XDOCTX, 1, ITERATIONS, 1)?> Used in conjunction with for-each loop <?for-each:xdoxslt:foreach_number($_XDOCTX, 1, $iterations, 1)?> -
Format number <?xdoxslt:format_number(12345, 2, $_XDOLOCALE)?> 12,456.00
Format number with custom separators <?xdoxslt:format_number(12345, 3, '.', 'x', $_XDOLOCALE)?> 12.456x000
<?xdoxslt:get_array($_XDOCTX, TABLE_NAME, INDEX)?>  Retrieve value from hash table <?xdoxslt:get_array($_XDOCTX, ‘MyTable’, 2)?>  'Test'
<?xdoxslt:get_day(DATE, LOCALITY)?> Get current day <?xdoxslt:get_day(‘2010-07-29’, 'Australia/Brisbane')?> 29
<?xdoxslt:get_month(DATE, LOCALITY)?> Get current month <?xdoxslt:get_month(‘2010-07-29’, 'Australia/Brisbane')?> 7
<?xdoxslt:get_variable($_XDOCTX, VAR_NAME)?> Get value <?xdoxslt:get_variable($_XDOCTX, 'test')?> 'Hello'
<?xdoxslt:get_year(DATE, LOCALITY)?> Get current year <?xdoxslt:get_year(‘2010-07-29’, 'Australia/Brisbane')?> 2010
<?xdoxslt:ifelse(EXPRESSION, TRUE, FALSE)?> Conditional Statement <?xdoxslt:ifelse(a = b, 'Equivalent', 'Mismatch')?> -
<?xdoxslt:init_cap(STRING)?> Convert initial characters to capitals <?xdoxslt:init_cap('this is a test')?> This Is A Test
<?xdoxslt:left(STRING, LENGTH)?> Extract beginning portion of string <?xdoxslt:left(‘abcdefg’, 3)?> 'abc'
<?xdoxslt:ltrim(STRING)?> Removes leading white space in string <?xdoxslt:ltrim(‘ a ‘)?> 'a '
<?xdoxslt:maximum(ELEMENT_NAME)?> Retrieve largest value from element <?xdoxslt:maximum(Gross_Claims_ID24)?> 253456
<?xdoxslt:month_name(MONTH_NUM, ABBREVIATE, $_XDOLOCALE)?> Retrieves name of specified month <?xdoxslt:month_name(1, 0, $_XDOLOCALE)?> 'January'
<?xdoxslt:minimum(ELEMENT_NAME)?> Retrieve smallest value from element <?xdoxslt:minimum(Gross_Claims_ID24)?> -
<?xdoxslt:next_element(GROUP, ., ELEMENT_NAME)?> Retrieves subsequent element in group <?xdoxslt:next_element(current-group(), ., Pay_ID21)?>
<?xdoxslt:pat_format_number(NUMBER, FORMAT, $_XDOLOCALE)?> Format number with pattern <?xdoxslt:pat_format_number(12345, ‘##,##0.00’, $_XDOLOCALE)?> 12,345.00
<?xdoxslt:prev_element(GROUP, .., ELEMENT_NAME)?>  Retrieves previous element in group <?xdoxslt:prev_element(current-group(), .., Pay_ID21)?> 
<?xdoxslt:replace(STRING, OLD_CHAR, NEW_CHAR)?> Replace consecutive characters <?xdoxslt:replace(‘Mist’, ‘Mi’, ‘Te’)?> Test
<?xdoxslt:right(STRING, LENGTH)?> Replicate string <?xdoxslt:replicate(‘String’, 3)?>
Extract end portion of string <?xdoxslt:right(‘abcdefg’, 3)?> 'StringStringString'
<?xdoxslt:round(NUMBER [, DECIMALS])?> Round number <?xdoxslt:round(4.56 , 0)?> 5
<?xdoxslt:rtrim(STRING)?> Removes trailing white space in string <?xdoxslt:rtrim(‘ a ‘)?> ' a'
<?xdoxslt:sec_diff(FROM_TIME, TO_TIME, $_XDOLOCALE, $_XDOTIMEZONE)?> Determine difference between times <?xdoxslt:sec_diff(‘2000-04-08T20:00:00’, ‘2000-04-08T21:00:00’, $_XDOLOCALE, $_XDOTIMEZONE)?> 3600
<?xdoxslt:set_array($_XDOCTX, TABLE_NAME, INDEX, STORE_VAL)?>  Truncate number to specified decimals <?xdoxslt:set_array($_XDOCTX, ‘MyTable’, 2, ‘Test’)?>  -
<?xdoxslt:set_variable($_XDOCTX, VAR_NAME, VALUE)?> <?xdoxslt:set_variable($_XDOCTX, 'test', "'Hello'")?> -
<?xdoxslt:truncate(NUMBER [, DEC_INT])?> <?xdoxslt:truncate(2.6789, 2)?> 2.67
<?xdoxslt:trim(STRING)?> Removes white space in string <?xdoxslt:trim(‘ A ‘)?> 'A'

No comments:

Post a Comment