Now I know this is an Infopath site but the people on here are so brilliant with XSL and XML I thought I would try this one anyway.
I am trying to filter a data view web part in SharePoint 2003 but only when the filter is actually populated.
<xsl:choose>
<xsl:when test="boolean($FilterFirstLetter)">
<xsl:variable name="RowFilter">/dsQueryResponse/Rows/Row[substring(@Title,1,1)=$FilterFirstLetter]</xsl:variable>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="RowFilter">/dsQueryResponse/Rows/Row</xsl:variable>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="Rows" select="$RowFilter" />
This is my attempt so far. $FilterFirstLetter is a parameter passed in the URL and I know that works because with the following on its own I can filter the list:
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[substring(@Title,1,1)=$FilterFirstLetter]" />
I want the list to show everything when the filter is empty. Do you have any ideas please? The error I get is "Failed setting processor stylesheet : 0x80004005 : A reference to variable or parameter 'RowFilter' cannot be resolved. The variable or parameter may not be defined, or it may not be in scope.