I am trying to sort by date for XML output. Here is my XSL:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Example by Phil 'iwonder' Guerra -->
<!-- Edited by Lee Sykes DNN Creative Magazine http://www.dnncreative.com -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:param name="TITLE"/>
<xsl:template match="rss">
<!-- Do not show channel image -->
<!-- Do not select the first item (this is useful if there are advertisements, such as using an RSS feed from moreover.com-->
<xsl:for-each select="channel/item[position() > 0]">
<!-- Test to limit number of items displayed. Here only 5 items will be transformed -->
<xsl:if test="position() < 5">
<br></br>
<!-- to open links in a new window, change target="_main" to target="_blank" -->
<strong><a href="{link}" target="_blank"><xsl:value-of select="title"/></a></strong>
<br>
<!-- <xsl:value-of select="pubDate"/> -->
</br>
<!-- only display 100 characters of the description, and allow html -->
<xsl:value-of disable-output-escaping="yes" select="description"/>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template match="description">
<br>
<xsl:value-of select="."/>
</br>
</xsl:template>
<xsl:template name="strip-tags">
<xsl:param name="text"/>
<xsl:choose>
<xsl:when test="contains($text, '<')">
<xsl:value-of select="substring-before($text, '<')" />
<xsl:call-template name="strip-tags">
<xsl:with-param name="text" select="substring-after($text, '>')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring($text, 1, 100)" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
I am trying to sort descending using the entereddate in my XML:
<item>
<title>Media Director</title>
<entereddate>4/2/2009</entereddate>
<referencenumber>01646359</referencenumber>
<description><![CDATA[Leading Cleveland-based Award-Winning Integrated Marketing Communications firm seeks a passionate Media Director to lead a team of media planning and buying professionals and Fortune 500 clients. This individual will be responsible to develop strategic and innovative traditional and nontraditional consumer engagement solutions including emerging media. This leader will play a large role in new business. Ten years experience in media planning and buying as well as five years of management required. The environment is collaborative with many creative perks.]]></description>
<city>Cleveland</city>
<state>OH</state>
<country>United States of America</country>
<salary>$0.00 - $0.00 / $0.00/hr - $0.00/hr</salary>
<guid isPermaLink="false">http://employment.topechelon.com/web77391/jobseeker/sSetup.asp?runsearch=1&amp;spJobAdId=01646359</guid>
<link>http://employment.topechelon.com/web77391/jobseeker/sSetup.asp?runsearch=1&amp;spJobAdId=01646359</link>
</item>
Any help would be appreciated!
Thanks