[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] filter using contains with multiple values

Subject: Re: [xsl] filter using contains with multiple values
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 2 Mar 2016 18:53:42 -0000

Raimund Kammering raimund.kammering@xxxxxxx wrote:

I would like to allow to pass in a flexile number of values for the bfilter_valueb, like bLogb or bInfob to match the first two plus the
last entry. I guess the solution would be to do this in kind of a loop, but how can this be done with bfilter_valueb being a
simple XSL variable or is exactly this the weakness of the approach?

Ibrunning Saxon version: so that Ibm able to use XSLT and XPath 2.0.

You can use

<xsl:if test="*[name()=$filter and some $value in $filter_values satisfies contains(., $value)]b>

where you define <xsl:param name="filter_values" as="xs:string*" select="'Log', 'Info'"/>.

Current Thread