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

Re: filter using contains with multiple values

Subject: Re: filter using contains with multiple values
From: "Raimund Kammering raimund.kammering@xxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 3 Mar 2016 19:00:42 -0000
Re:  filter using contains with multiple values
okay got that point (parenthesis). But still that does not work for me since
somehow the string in filter_value is not understood as sequence!
So if I now use:

 <xsl:if test="*[name()= $filter and . = $filter_value]b>

or as Michael suggested

<xsl:if test="*[name()= $filter][. = $filter_value]b>

it only matches the first of the two in the sequence if I use

<xsl:param name="filter_value" as="xs:string*" select="'Log', bInfo'b/>

to pass the parameter! Even an:

<xsl:value-of select=b$filter_valueb/>

only returns: bLogb where I would expect it to return the whole parameter!
I seem to still miss some crucial point in making filter_value being
understood as sequence here!?

> Sorry, the expression needs parenthesis
>
>  <xsl:if test="*[name()=$filter and (some $value in $filter_values satisfies
contains(., $value))]b>
>
>
>> <xsl:param name="filter_values" as="xs:string*" select="'Log', 'Info'b/>
>
> If you want a comparison with "=" then you can simply use
>
>  <xsl:if test="*[name()= $filter and . = $filter_values]">
>
> as the "=" comparison between a value and a sequence is true if there is at
least one item in the sequence that is equal to the value. The `some`
expression is only needed if you want the contains check.

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-2013 All Rights Reserved.