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

RE: how to Display dates in a specific format

Subject: RE: how to Display dates in a specific format
From: cknell@xxxxxxxxxx
Date: Tue, 04 Nov 2003 11:57:08 -0500
xsl display date
After you fix the fact that your file is not XML (bare ampersands are strictly forbidden), this template will do what you want (on element "c9" at least. The rest is left as an exercise for the reader.)

<xsl:template match="/dataroot/GrantNet/c9">
  <xsl:variable name="year"><xsl:value-of select="substring-before(.,'-')" /></xsl:variable>
  <xsl:variable name="month"><xsl:value-of select="substring(substring-after(.,'-'),1,2)" /></xsl:variable>
  <xsl:variable name="day"><xsl:value-of select="substring(substring-after(.,'-'),4,2)" /></xsl:variable>
  <xsl:variable name="date"><xsl:value-of select="$month" />/<xsl:value-of select="$day" />/<xsl:value-of select="$year" /></xsl:variable>
  <xsl:value-of select="$date" />
Charles Knell
cknell@xxxxxxxxxx - email

-----Original Message-----
From:     puja thakral <puja_thakral@xxxxxxxxx>
Sent:     Tue, 4 Nov 2003 08:29:52 -0800 (PST)
To:       List <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject:   how to Display dates in a specific format

Hi All,
I've an xml document.

<?xml version="1.0" encoding="UTF-8"?>
		<fldSponsorDesc>American Association
		<Program>2000-2001 American Fellowships</Program>
		<fldCatDesc>Arts & Humanities</fldCatDesc>

I'm using stylesheet to display all the information in
html format.
But I don't know how to display date.I get the date
displayed as 1999-11-15T00:00:00 although I want to
display it as 11/15/1999.

Thanks for help in advance.

Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

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

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

Current Thread


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.
First Name
Last Name
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.