I have a basic XSLT filter on a SharePoint 2007 DataFormWebPart:
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[((ddwrt:FormatDateTime(string(@MyDate) ,1061 ,'MM'))=$MyParameter)]"/>
The $MyParameter comes from an ASP.NET control. But trying to set the variable value in any other ways results in an error:
<xsl:variable name="Rows">
<xsl:value-of select="/dsQueryResponse/Rows/Row[((ddwrt:FormatDateTime(string(@MyDate) ,1061 ,'MM'))=$MyParameter)]"/>
</xsl:variable>
or
<xsl:variable name="Rows">
/dsQueryResponse/Rows/Row[((ddwrt:FormatDateTime(string(@MyDate) ,1061 ,'MM'))=$MyParameter)]
</xsl:variable>
The error I get is: Argument 1 must return a node-set. -->count($Rows)<--
Ultimately, I am trying to achieve something similar:
<xsl:variable name="Rows">
<xsl:choose>
<xsl:when test="($MyParameter2 = '1')">
<xsl:value-of select="/dsQueryResponse/Rows/Row[((ddwrt:FormatDateTime(string(@MyDate) ,1061 ,'MM'))=$MyParameter)]"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="/dsQueryResponse/Rows/Row[((ddwrt:FormatDateTime(string(@MyDate) ,1061 ,'MM'))=$otherParameter)]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Is anything like this possible with XSLT or I should look for other possibilities withing SharePoint Designer?