|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Problem with Variables
> I am writing a stylesheet which makes a conversion of a date.
> ie: 1.3.2003 should become 2003.03.01
You can do this in one line:
<xsl:value-of select="
concat(
substring-after(substring-after($date,'.'),'.')
,'.',
format-number(substring-before(substring-after($date,'.'),'.'),'00')
,'.',
format-number(substring-before($date,'.'),'00')
)"/>
The only bit I think you wont already know here is format-number(),
which in this case allows you to pad with zeros to get at least 2 digits
cheers
andrew
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








