[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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


Subject: Re: [xsl] How to convert day-of-month with xslt 2.0
From: andrew welch <andrew.j.welch@xxxxxxxxx>
Date: Tue, 23 Aug 2005 16:25:20 +0100

> >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


Current Thread