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

RE: Convert to RFC822 via XSLT? Doable?

Subject: RE: Convert to RFC822 via XSLT? Doable?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 28 Mar 2007 22:30:08 +0100
RE:  Convert to RFC822 via XSLT? Doable?
> The XML I am trying to convert to RSS XML stores the pubDate as such:
> 
>   2007/03/28
> 
> RSS needs it to be in RFC822 format:
> 
>   Wed, 28 Mar 2007 12:00:00 CST
> 

> However, maybe there is a fairly painless way to go from one 
> date format to the other in XSLT. So, thought I'd ask in here. ;o)

Very doable in XSLT 2.0. First convert to a standard date:

xs:date(translate($in, '/', '-'))

Then apply the XSLT 2.0 format-date() function. (But I don't know where the
time 12:00:00 is supposed to come from, let alone the timezone CST).

Michael Kay
http://www.saxonica.com/

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-2011 All Rights Reserved.