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

RE: Dates and XSL

Subject: RE: Dates and XSL
From: "Richard Reich" <richard@xxxxxxxxx>
Date: Sun, 31 Oct 1999 16:50:00 -0800
dates in xsl
If you are processing on a server or a client with access to Java
extensions, you can write an xpath extension function to format dates.  (I
do it in LotusXSL, but it's also possible in SAXON and probably others.)

For example, somewhere in the transform you will have something like:

...
<xsl:value-of select="myExt:dateFormat(ORDERDATE,'EEE d MMM yyyy')"/>
...

The additional voodoo you need in the transform to recognize the extension
is implementation-dependent.

You can handle time zones cleanly with a little more trouble if your
database keeps everything in, say, UTC and if you can put the Java
TimeZone.getID() string appropriate for rendering somewhere in your XML.

-r

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of Jon Smirl
> Sent: Sunday, October 31, 1999 11:45 AM
> To: XSLList
> Subject: Dates and XSL
>
>
> What's the best way to deal with dates? When my dates come out of the
> database they look like: 1999-10-29 13:00:00.0.  When displaying
> this date I
> want to either show October or pick October from a dropdown menu so this
> means I have to break apart the date. I also need to reorder it
> depending on
> the display format.
>
> Should I break it apart at XML generation time into
> <year>1999</year><month>10</month>, etc?  or would it be better to pick it
> apart with the XSL substring function? It's clear to me that XSL
> should have
> date support built in.
>
> I'm not happy with any of the solutions I've come up with, does
> anyone have
> any better ideas?
>
> Jon Smirl
> jonsmirl@xxxxxxxxxxxx
>
>
>
>  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
  • Dates and XSL
    • Jon Smirl - Sun, 31 Oct 1999 14:44:47 -0500
      • Richard Reich - Sun, 31 Oct 1999 16:50:00 -0800 <=

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.