Convert string date to xslt RSS date
Hi,
Can you please help me converting string date to XSLT RSS date?
I have the string date in this format mm-dd-yyyy. IE. 06/04/2014
-->
RSS date format?
Thanks,
Christian
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Ryan Griffith on 23 Jun, 2015 08:12 PM
Hi Christian,
This can be accomplished by using our format date XSLT Format. Simply create this new Format within your instance and include it into your existing Format.
You can find usage instructions within the comments at the top of the Format. In your case, try using the
format-calendar-string
template since you are working with what appears to be a date string.Please let me know if you have any questions.
Thanks!
2 Posted by csaladores on 23 Jun, 2015 08:23 PM
I tried but no luck.
Attached is my xsl.
3 Posted by Ryan Griffith on 24 Jun, 2015 12:41 PM
Hi Christian,
It looks like you're on the right track. When you have a moment, try adjusting the following line:
to:
Often times, the Element is passed into the template and not the actual text value of the Element.
Please let me know if you have any questions.
Thanks!
4 Posted by csaladores on 24 Jun, 2015 04:11 PM
Hi Ryan,
I made the change but it stops on the first <pubDate> parse.
5 Posted by Ryan Griffith on 24 Jun, 2015 04:39 PM
Weird. When you have a moment, please attach sample XML that is being applied to this Format so I can take a closer look in my local instance.
Thanks!
6 Posted by csaladores on 24 Jun, 2015 04:47 PM
That would be helpful. Will do.
7 Posted by csaladores on 24 Jun, 2015 04:50 PM
Here you go Ryan.
8 Posted by csaladores on 24 Jun, 2015 04:52 PM
Here is the RSS xsl
9 Posted by Ryan Griffith on 24 Jun, 2015 06:32 PM
Hi Christian,
A couple of issues I am seeing with this Format:
hh
Xalan function is affecting the date formatter, causing the behavior you are seeing. What I did to get this working is remove that Xalan stuff all-together from your Format in favor of using the date formatter.Please let me know if you have any questions.
Thanks!
10 Posted by csaladores on 24 Jun, 2015 06:34 PM
Great. I’ll give this a shot.
11 Posted by csaladores on 24 Jun, 2015 06:52 PM
Yup, I removed the xalan stuff and it worked. Thanks Ryan.
Christian
csaladores closed this discussion on 24 Jun, 2015 06:52 PM.