Subject: Re: [xsl] Is there any way to identify the date format ? From: jayashree venkatesh <jaya.venk@xxxxxxxxx> Date: Wed, 9 Jan 2008 06:25:42 -0800 (PST) |
Is there a regular expression set of functions that I can use to match the patterns? I found http://www.exslt.org/regexp/index.html but my XSLT processor does not support EXSLT regular expression. Is there any other pattern matching set of functions I can use ? Thanks, Jayashree ----- Original Message ---- From: Abel Braaksma <abel.online@xxxxxxxxx> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Sent: Wednesday, January 9, 2008 1:14:44 PM Subject: Re: [xsl] Is there any way to identify the date format ? Hi Javashree, If your input is as you say it is, and if the RFC822 date always has a timezone with it, you can determine which kind of date it is by simply testing its length. The longest date in your second format would be "September 30, 2007", which has a length of 18. Any pubDate value that is longer is a RFC822 date. Note that date formatting and string manipulation is generally much easier in XSLT 2.0 than in XSLT 1.0 Cheers, -- Abel Braaksma jayashree venkatesh wrote: > Hello, > > I am a newbie to XSL . I have 2 XML feeds which have a pubdate > tag having different date formats . One uses the standard RFC 822 format and > the other non RFC 822 format. > > 1 st feed > ----------------- > <pubDate>Mon, 07 Jan 2008 15:24:04 -0600</pubDate> (RFC 822) > > 2 nd feed > -------------------- > <pubDate>March 7, 2007</pubDate> > > I > want to convert both these date formats to ISO 8601 format.The point is > i want to do this in a single XSL file . I know there are substring() > and concat() functions which can help me achieve this. Now my question > is, how can I identify which format the date is ( 1st format or 2 nd ) > in the first place ? If i can identify which format the date is in, I > can covert them to ISO 8601 format. > > Thanks in > advance, > Jayashree Venkatesh > > > > ____________________________________________________________________________________ > Never miss a thing. Make Yahoo your home page. > http://www.yahoo.com/r/hs > > --~------------------------------------------------------------------ > 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@xxxxxxxxxxxxxxxxxxxxxx> > --~-- > > > > --~------------------------------------------------------------------ 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@xxxxxxxxxxxxxxxxxxxxxx> --~-- ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Is there any way to ident, Michael Kay | Thread | Re: [xsl] Is there any way to ident, David Carlisle |
Re: [xsl] XSLT 2.0 Multi-level grou, Andrew Welch | Date | Re: [xsl] Is there any way to ident, David Carlisle |
Month |