Subject: RE: [xsl] paramter passing problem From: "Michael Kay" <mhkay@xxxxxxxxxxxx> Date: Sat, 10 Mar 2001 17:35:44 -0000 |
I need a standard paragraph for this one: XSLT variables can only be used to hold values, not XPath expressions or parts of expressions. You are testing whether First_Name contains the string "$First_Name", not whether it contains the value of the First_Name parameter. In simple cases where the expression is a name, you can use *[name()=$param]. Otherwise you need the evaluate() extension function in Saxon, Xalan, and possibly other processors by now. Mike Kay > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Dom > Sent: 10 March 2001 16:41 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] paramter passing problem > > > Hi, > > I have an xsl stylesheet that does a basic search through an xml file. > I am using two paramters that I am passing in from a webpage. > > Param1 Value of search string (taken from text box) > Param2 Category of search specified through drop down menu > > *** > <xsl:if > test="contains(translate($param1,'abcdefghijklmnopqrstuvwxyz', > 'ABCDEFGHIJKLM > NOPQRSTUVWXYZ'),(translate($param2,'abcdefghijklmnopqrstuvwxyz > ','ABCDEFGHIJK > LMNOPQRSTUVWXYZ')))" > > *** > > $param2 has any of the following values: > First_Name > Title > ISBN > Author > > passed into using JavaScript. This relates to my xml file > which has the > basic structure > > <Book> > <Title> </Title> > <Author> </Author> > <ISBN> </ISBN> > <First_Name> </First_Name> > </Book> > > It however does not work, if however I hard code, for example > First_Name in > place of $param2 the search works fine. > > Could any one please help. > Many thanks > Dom > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.237 / Virus Database: 115 - Release Date: 07/03/2001 > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] paramter passing problem, Dom | Thread | [xsl] How to disable escaping of '<, Satish Patil |
RE: [xsl] -PARAM in XALAN is broken, Michael Kay | Date | Re: [xsl] multilingual web site, Christopher R. Maden |
Month |