[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Switching off a filter by parameter

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

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:param name="categor"/>
  <xsl:template match="/">
      <xsl:for-each select="books/book">
        <xsl:if test="category=$categor">
          <!-- Show info... -->
        </xsl:if>
      </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>

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.

Thanks!

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.