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

filter using contains with multiple values

Subject: filter using contains with multiple values
From: "Raimund Kammering raimund.kammering@xxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 2 Mar 2016 18:42:52 -0000
 filter using contains with multiple values
Hi,

I created a filter statement using two variables to a) specify the node of
interest and b) the value to be matched:

XSL is like this:
...
<xsl:if test="*[name()=$filter]=contains(., $filter_value)b>
b&

feed with the following XML:

<list>
  <entry>
    <keyword>Log</keyword>
    <location>A</location>
  </entry>
  <entry>
    <keyword>Log</keyword>
    <location>B</location>
  </entry>
  <entry>
    <keyword>Problem</keyword>
    <location>A</location>
  </entry>
  <entry>
    <keyword>Info</keyword>
    <location>B</location>
  </entry>
</list>

so that setting bfilterb to bkeywordb and bfilter_valueb to
bLogb will only match the first two bentryb nodes. Fine so far, but
now
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: 9.1.0.8 so that Ibm able to use XSLT and XPath
2.0.

Thanks,
Raimund

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.