Re: [xsl] Re: [xslt transform & grouping] Using the Muenchian Method?

Subject: Re: [xsl] Re: [xslt transform & grouping] Using the Muenchian Method?
From: Anton Triest <anton@xxxxxxxx>
Date: Thu, 07 Oct 2004 16:37:54 +0200
Michael PG wrote:

I have choosen to work with parameters, like:

<!-- put the filter string in a global parameter -->
   <xsl:param name="info" select="'food'"/>

How can I implement filtering for two keywords, that is display all that have either "food" or "drink".


You can pass a nodeset in the param, much like David's example:

   <xsl:param name="filter">
       <a>food</a>
       <a>drink</a>
   </xsl:param>

then you would need the possibility to pass a nodeset, and the nodeset extension to access it:
[@filter=exsl:node-set($filter)/a]. Both depend on the processor - I don't know if and how this is possible in yours.


If you really cannot pass a nodeset, you could always build up a search string something like

<xsl:param name="filter" select="';food;drink;'"/>

and then use [contains($filter,concat(';',@filter,';'))]

Anton

Current Thread