Re: [xsl] splitting the date field in xml
Subject: Re: [xsl] splitting the date field in xml|
From: jim smith <jim@xxxxxxxxx>
Date: Wed, 14 Feb 2001 00:44:36 +0000
I've cheated a bit and made two assumptions:
I have a xml file which looks like this
<Date>Tue Jan 11 16:00:00 PST 1949</Date>
I need to show the date in 3 textfields as
Jan 11 1949
1. that the length of the day of the month field never changes
2. that the length of the of the time field never changes
You can probably fix it if only one of those changes with a
string-length() - eg if the string is less than 28 characters you
know you're dealing with a shortened date or time and can wrap it in
If both change - eg, if you don't pad date and time with leading
zeroes, then i'm baffled.
I also cheated and pinched the padding spaces from the string itself.
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:value-of select="substring(Date, 5, 4)"
/><xsl:value-of select="substring(Date, 9, 3)" /> <xsl:value-of
select="substring(Date, 25, 4)" />
020 7837 0377
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list