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

RE: RE: Parameter not working in contains() function

Subject: RE: RE: Parameter not working in contains() function
From: "Lars Huttar" <lars_huttar@xxxxxxx>
Date: Tue, 3 Jun 2003 16:09:41 -0500
xsl not contains
> I'm using JavaScript on a web page to pass parameters (user 
> input) to an XSL file. The parameters are global. I'm trying 
> to use them in this for-each statement:
> 
> <xsl:for-each select="doclist/doc[contains($param1,$param2)]">
> 
> $param1 comes from a dropdown list on the web page and will 
> always be one of the children of doc. If I manually replace 
> $param1 with one possible value, the XSL works (i.e., 
> <xsl:for-each select="doclist/doc[contains(title,$param2)]">. 
> 
> But when I use the $param1 as the first argument in the 
> contains function, I get no results.

This is because $param1 presumably contains a string, namely 'title',
and so what you're getting is
 <xsl:for-each select="doclist/doc[contains('title',$param2)]">.

One way to do what you're trying to do would be
 <xsl:for-each select="doclist/doc[contains(*[local-name()=$param1],$param2)]">. 

I think that should work.

Lars


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.