xsl-list
[Top] [All Lists]

RE: [xsl] Convert to RFC822 via XSLT? Doable?

2007-03-28 15:04:07

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/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--