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

Re: Date Formating

Subject: Re: Date Formating
From: Heiko Specht <heiko@xxxxxxxxxx>
Date: Sun, 12 Jan 2003 15:28:29 +0100
heiko specht
Hello Arthur,

you may try this



<date-created>2003-01-12</date-created>

<xsl:template name="dateFormat">
  <xsl:param name="str" select="/date-created" />
  <xsl:param name="year" select="substring-before($str, '-')" />
  <xsl:param name="end" select="substring-after($str, '-')" />
  <xsl:param name="day" select="substring-after($end, '-')" />
  <xsl:param name="month" select="substring-before($end, '-')" />
  <xsl:choose>
    <xsl:when test="$month = '01'">
      <xsl:variable name="mon">Jan</xsl:variable>
    </xsl:when>
    .... <!-- make this for each month -->
    <xsl:otherwise />
  </xsl:choose>
  <xsl:value-of select="$day" />-<xsl:value-of select="$mon" />-<xsl:value-of select="$year" />
</xsl:template>

in your xsl you have to call this template
 with: <xsl:call-template name="dateFormat" /> at the point you need
 it.

best regards

Heiko

Friday, December 12, 2003, 2:09:43 PM, you wrote:

A> Hello xsl-list,

A>   I'm transforming an xml file that gives me a nicely formatted report
A>   (html 80 odd pages).
A>   Part of the transform uses format-number() for decimal places etc.

A>   one of the elements in the xml, is a date
A>   <date-created>2003-01-12</date-created>

A>   How do you transform this to 12-Jan-03 ?


 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.