xsl:param and xsl:variable

Can anyone suggest me the difference between xsl:param and xsl:variable?
Thanks,
Devi
[98 byte] By [devisam] at [2007-11-18 17:10:12]
# 1 Re: xsl:param and xsl:variable
Using xsl:param, you can pass arguments into templates and the stylesheet (from other templates and outside the stylesheet), you can't do this with xsl:variable.
khp at 2007-11-10 3:28:21 >
# 2 Re: xsl:param and xsl:variable
Thanks, I will my problem scenario can you suggest whether xsl:variable can be used in that.

In a combo box I need to know which option is selected.

For this can I use, xsl:variable?

Background:

I have been using xsl:param in this place. But after changing to JDK1.4 a error is thrown saying xsl:param can not be used in this position. When I changed it xsl:variable it doesn't throw any error. But I am worried about the hidden bugs.

Please suggest.

Thanks
Devi
devisam at 2007-11-10 3:29:20 >
# 3 Re: xsl:param and xsl:variable
XSL doesn't know anything about combo boxes. Perhaps you meant to say that the xsl:param recieves the selected value, via some form of reguest (http perhaps). In which case xsl:variable can't be used, see my above comment about recieving argument from out side the stylesheet.

I really can't comment futher on this, without knowing any of the details.
khp at 2007-11-10 3:30:19 >
# 4 Re: xsl:param and xsl:variable
This is a part of my XSL, that is throwing error.
The error thrown is "Cannot have xsl: param in this position"
When I change these two xsl: param occurences to xsl: variable
I am not getting any error and the XSL serves the required purpose. I don't have XSL funda' knowledge, hence I am wondering this is a correct change or not.
Please confirm

<select>

<xsl:param name="var" select="@NAME">
</xsl:param>

<xsl:attribute name="name">
<xsl:value-of select="concat($var,'_operator')"/>
</xsl:attribute>

<xsl:param name="varop" select="@OPERATOR">
</xsl:param>

<xsl:if test = "$varop = ''">
<option value="EQ"> =</option>
<option value="NE"> <></option>
<option value="GT"> ></option>
<option value="GE"> >= </option>
<option value="LT"> <</option>
<option value="LE"> <=</option>
</xsl:if>

.
.
.
.
.
.
.
.
.

.
.
.
.
<select>
.
.
.
.

Thanks,
Devi S.
devisam at 2007-11-10 3:31:27 >
# 5 Re: xsl:param and xsl:variable
I really can't tell anything from the fragment you have posted, it looks like the params might be part of a template but I can't tell, and I can't see where and how these might be called. Things like that tend to be kind of important.

The most obvious answer would ofcourse be that if they are in a template, they should be moved to the top of that template.

I really really hate having to repeat myself, but I can't comment futher on this, without knowing any of the details.
khp at 2007-11-10 3:32:21 >
# 6 Re: xsl:param and xsl:variable
Ok, Thanks for your effort.
devisam at 2007-11-10 3:33:30 >
# 7 Re: xsl:param and xsl:variable
It works now!. Thanks for your input.
As you had suggested, I moved them to the top of the template and it works like charm now.

Thanks
Devi S.
devisam at 2007-11-10 3:34:23 >