tag:help-archives.hannonhill.com,2010-02-09:/discussions/xslt-formats/6108-convert-string-date-to-xslt-rss-dateCascade CMS: Discussion 2018-10-18T20:37:35Ztag:help-archives.hannonhill.com,2010-02-09:Comment/372004222015-06-23T20:12:17Z2015-06-23T20:12:17ZConvert string date to xslt RSS date<div><p>Hi Christian,</p>
<p>This can be accomplished by using our <a href="https://github.com/hannonhill/XSLT-Workbook/blob/master/Uncategorized/format-date.xsl">
format date</a> XSLT Format. Simply create this new Format within
your instance and include it into your existing Format.</p>
<p>You can find usage instructions within the comments at the top
of the Format. In your case, try using the
<code>format-calendar-string</code> template since you are working
with what appears to be a date string.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/372004222015-06-23T20:23:28Z2015-06-23T20:23:28ZConvert string date to xslt RSS date<div><p>I tried but no luck.</p>
<p>Attached is my xsl.</p></div>csaladorestag:help-archives.hannonhill.com,2010-02-09:Comment/372004222015-06-24T12:41:34Z2015-06-24T12:41:34ZConvert string date to xslt RSS date<div><p>Hi Christian,</p>
<p>It looks like you're on the right track. When you have a moment,
try adjusting the following line:</p>
<pre>
<code><xsl:with-param name="date" select="system-data-structure/date"/></code>
</pre>
<p>to:</p>
<pre>
<code><xsl:with-param name="date" select="string(system-data-structure/date)"/></code>
</pre>
<p>Often times, the Element is passed into the template and not the
actual text value of the Element.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/372004222015-06-24T16:11:22Z2015-06-24T16:11:22ZConvert string date to xslt RSS date<div><p>Hi Ryan,</p>
<p>I made the change but it stops on the first parse.</p></div>csaladorestag:help-archives.hannonhill.com,2010-02-09:Comment/372004222015-06-24T16:39:57Z2015-06-24T16:39:57ZConvert string date to xslt RSS date<div><p>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.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/372004222015-06-24T16:47:25Z2015-06-24T16:47:25ZConvert string date to xslt RSS date<div><p>That would be helpful. Will do.</p></div>csaladorestag:help-archives.hannonhill.com,2010-02-09:Comment/372004222015-06-24T16:50:50Z2015-06-24T16:50:50ZConvert string date to xslt RSS date<div><p>Here you go Ryan.</p></div>csaladorestag:help-archives.hannonhill.com,2010-02-09:Comment/372004222015-06-24T16:52:43Z2015-06-24T16:52:43ZConvert string date to xslt RSS date<div><p>Here is the RSS xsl</p></div>csaladorestag:help-archives.hannonhill.com,2010-02-09:Comment/372004222015-06-24T18:32:49Z2015-06-24T18:32:49ZConvert string date to xslt RSS date<div><p>Hi Christian,</p>
<p>A couple of issues I am seeing with this Format:</p>
<ul>
<li>Your Index Block is massive.</li>
<li>It appear you are using the one from our XSLT Workbook project.
This format assumes you are including the Block via a block chooser
on your page that is to generate the RSS feed. Easily adaptable;
however, by tweaking this line:
<pre>
<code><xsl:template match="/system-data-structure|/system-index-block"></code>
</pre>
to:<br>
<pre>
<code><xsl:template match="/system-index-block">
<!-- OR this if you want to keep existing functionality -->
<xsl:template match="/system-data-structure|/system-index-block"></code>
</pre></li>
<li>It appears the <code>hh</code> 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.</li>
</ul>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/372004222015-06-24T18:34:16Z2015-06-24T18:34:16ZConvert string date to xslt RSS date<div><p>Great. I’ll give this a shot.</p></div>csaladorestag:help-archives.hannonhill.com,2010-02-09:Comment/372004222015-06-24T18:52:25Z2015-06-24T18:52:25ZConvert string date to xslt RSS date<div><p>Yup, I removed the xalan stuff and it worked. Thanks Ryan.</p>
<p>Christian</p></div>csaladores