xsl-list
[Top] [All Lists]

Re: How to convert day-of-month with xslt 2.0

2005-08-23 08:25:20
Couldn't you use translate and format-number in a >choose/when? e.g:
select="format-number(translate(input,'()',''),'00')"
after some testing it looks like this:
replace(format-number(number(translate(input,'()','')),'00'),'NaN','00')

An alternative is:

if (number(input)) then format-number(translate(input,'()',''),'00') else '00'

which is more readable, perhaps.


cheers
andrew

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>