[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: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 3 Mar 2016 19:21:07 -0000
Re:  filter using contains with multiple values
On Thu, Mar 03, 2016 at 07:00:49PM -0000, Raimund Kammering
raimund.kammering@xxxxxxx scripsit:
> 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!?

You may be having trouble from the other side; . is the context value,
and will be understood as the string value of the element found by the
match, and that might not be what you expect.  It's pretty easy to get
some white space in there, for example, and = is an exact match. (You
won't, for example, match "info" with that filter value.)

<xsl:param name="filter_value" as="xs:string*" select="('Log', 'Info')"/>

is what I'd expect for explicitly creating a sequence.

<xsl:sequence select="$filter_value[2], $filter_value[1]"/>

Should show you whether or not you've really got a sequence;
<xsl:value-of/> creates a text node, which isn't what you want because
various rules about turning the sequence into text come into play.

-- Graydon

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.