Hello..
I'm trying to get sorting working via the XSL sheet. I'm using the F&L DataProvider for the Xml Module, and currently sorting within this isn't working properly and errors out. (http://xmlproviders.codeplex.com/work...); (http://dnnxml.codeplex.com/workitem/2...
)
Some information about the form & list configuration:
- Date of Meeting is configured as a Date column
- Month and Year is a Text configured calculated column which takes two other text columns (Month & Year) and combines them
The XSL style is configured so it groups the meeting minutes by Month and Year; E.g.
January 2011
January 1st, 2011
January 5th, 2011
February 2011
February 3rd, 2011
February 7th, 2011
But, I'm also trying to get the sub-minute items to sort by their meeting minutes date; (). But, the sorting isn't fully working properly. It's almost as if it's sorting by the created/update date instead. E.g. If I add a February 2nd meeting minute, it'll show up below the February 7th meeting minute instead or it's proper location event thought I set the Date of Meeting for the entry to 2/2/2011.
If I change the sort order from ascending to descending, then it'll change the sort order of the months instead; November, October, September, August instead of August, September, October, November.
Any ideas? Thanks.. -Jeff
Main area of sorting and displaying information:
<ul>
<xsl:for-each select="$DepartmentData[count(. | key('data-by-date', udt:Month_x0020_and_x0020_Year)[1]) = 1]">
<xsl:sort select="udt:Date_x0020_of_x0020_Meeting_UDT_Value" order="ascending" />
<li>
<xsl:variable name="currentData" select="key('data-by-date', udt:Month_x0020_and_x0020_Year)" />
<xsl:if test="$currentData">
<xsl:value-of select="udt:Month_x0020_and_x0020_Year" disable-output-escaping="yes" />
<ul>
<xsl:apply-templates select="$currentData" mode="list">
</xsl:apply-templates>
</ul>
</xsl:if>
</li>
</xsl:for-each>
</ul>
Full XSL Sheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:udt="DotNetNuke/UserDefinedTable" exclude-result-prefixes="udt">
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />
<!--
This prefix is used to generate module specific query strings
Each querystring or form value that starts with udt_{ModuleId}_param
will be added as parameter starting with param
-->
<xsl:variable name="prefix_param">udt_<xsl:value-of select="//udt:Context/udt:ModuleId" />_param</xsl:variable>
<xsl:key name="data-by-department" match="udt:Data" use="udt:Department" />
<xsl:key name="data-by-date" match="udt:Data" use="udt:Month_x0020_and_x0020_Year" />
<xsl:template match="udt:Data" mode="list">
<li>
<xsl:value-of select="udt:Minutes" disable-output-escaping="yes" /> <xsl:call-template name="EditLink" />
</li>
</xsl:template>
<xsl:template match="/udt:UserDefinedTable">
<xsl:for-each select="udt:Data[count(. | key('data-by-department', udt:Department)[1]) = 1]">
<xsl:variable name="DepartmentData" select="key('data-by-department', udt:Department)" />
<p style="line-height: 22px; font-size: 18px; font-weight: bold; text-align: justify;text-transform:uppercase;padding: 0">
<xsl:value-of select="udt:Department" disable-output-escaping="yes" /> MINUTES
</p>
<xsl:choose>
<xsl:when test="$DepartmentData">
<ul>
<xsl:for-each select="$DepartmentData[count(. | key('data-by-date', udt:Month_x0020_and_x0020_Year)[1]) = 1]">
<xsl:sort select="udt:Date_x0020_of_x0020_Meeting_UDT_Value" order="ascending" />
<li>
<xsl:variable name="currentData" select="key('data-by-date', udt:Month_x0020_and_x0020_Year)" />
<xsl:if test="$currentData">
<xsl:value-of select="udt:Month_x0020_and_x0020_Year" disable-output-escaping="yes" />
<ul>
<xsl:apply-templates select="$currentData" mode="list">
</xsl:apply-templates>
</ul>
</xsl:if>
</li>
</xsl:for-each>
</ul>
</xsl:when>
<xsl:otherwise>
<table align="center" width="90%">
<tr>
<td>
<br/><br/><strong>There are no meeting miuntes at this time.</strong><br/>
Please check back soon.
</td>
</tr>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<xsl:template name="EditLink">
<xsl:if test="udt:EditLink">
<a href="{udt:EditLink}">
<img border="0" alt="edit" src="{//udt:Context/udt:ApplicationPath}/images/edit.gif" />
</a>
</xsl:if>
</xsl:template>
</xsl:stylesheet>