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

RE: Formatting date

Subject: RE: Formatting date
From: Jarno.Elovirta@xxxxxxxxx
Date: Fri, 8 Nov 2002 16:28:57 +0200
RE:  Formatting date
Hi,

> I want to format the next element:
> 
>   <creation_date>2/9/2001 9:23:13</creation_date>
> 
> And transform to:
> 
>   <cr_date day="02" month="09" year="2001"/>
> 
> Can I do this transformation using XSL.

  <xsl:template match="creation_date">
    <cr_date day="{format-number(substring-before(., '/'), '00')}"
             month="{format-number(substring-before(substring-after(., '/'), '/'), '00')}"
             year="{substring-before(substring-after(substring-after(., '/'), '/'), ' ')}"/>
  </xsl:template>

Cheers,

Jarno

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


Current Thread
  • Formatting date
    • Felix Garcia - Fri, 8 Nov 2002 08:52:44 -0500 (EST)
      • <Possible follow-ups>
      • Jarno . Elovirta - Fri, 8 Nov 2002 09:24:49 -0500 (EST) <=
      • Ben Robb - Fri, 8 Nov 2002 09:37:50 -0500 (EST)

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.