[xsl] Switching off a filter by parameter

Subject: [xsl] Switching off a filter by parameter
From: "Guy" <guy@xxxxxxxxxxx>
Date: Mon, 13 Nov 2006 12:42:21 -0500
I have the following snippet of XSL to filter a book collection by category:

<xsl:stylesheet version="1.0"
  <xsl:param name="categor"/>
  <xsl:template match="/">
      <xsl:for-each select="books/book">
        <xsl:if test="category=$categor">
          <!-- Show info... -->

My question: If the categor param is zero length (i.e. no filter) then how
do I test for this and allow all books through? In other words I would like
the commented code in the snippet above to be executed if the categor param
is not filled in.


Current Thread