Re: [xsl] Parsing day out of date format 10/12/00

Subject: Re: [xsl] Parsing day out of date format 10/12/00
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 12 Feb 2003 21:29:17 GMT


<BirthMonth><xsl:value-of select="substring(.,1,2)"/></BirthMonth>
<BirthDay><xsl:value-of select="substring(.,3,2)"/></BirthDay>
<BirthYear><xsl:value-of select="substring(.,5,2)"/></BirthYear>

> How would I go about parsing so> me xml like this:
> 
> <BirthDate>10/12/00</BirthDate>

If you can't rely on on two digits in each field (y2k bugs hit 2 digit
year fields you know:-) then use substring-after and substring-before to
split on / instead of using substring. Of course in most places 
10/12/(20)00 would parse as 10th December rather than 12th October
so it was good you showed the desired output..



David

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread