I have a SharePoint data view web part based on a Task list. Task items have a field called @DueDate. I have created an XLS variable that uses the getDayDelta template from Marc Anderson's date_templates.xsl library. The attached code snippet shows the code for the table column that displays the "dueDateDelta", which is the number of days from today up to the DueDate. When the dueDateDelta is negative, the task is overdue.
This works perfectly, and my data vew web part shows the dueDateDelta correctly.
What I now need to do is include some xsl in the group header of the DVWP. I need to count up the number of rows with a dueDateDelta of < 0 (i.e. overdue tasks). I need a separate count of rows with a dueDateDelta > 0 and < 5. The end result will be a group header that displays the number of tasks that are overdue as well as the number of tasks that are close to being due.
I am stumped on how to do the XSL count. I need to restrict the count to rows where the table column whose ID = DDDelta (see the code snippet) has a value < 0. But how do I form an xsl count() that does this?
<td class="ms-vb" id="DDDelta">
<!-- get the delta in days between the due date and today -->
<xsl:with-param name="paramDateA" select="@DueDate" />
<xsl:with-param name="paramDateB" select="$Today" />
<xsl:if test="not(normalize-space(@DueDate) = '')">
<span><xsl:value-of select="$dueDateDelta" /></span>