[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

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


<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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.