xsl-list
[Top] [All Lists]

Re: Getting parameters from a JSP

2002-10-08 23:58:05
Hi Jorge,

it's obviously a bug in the XSLT processor. Is it Xalan 2.2? I cam across the same problem a few days ago, when working in an older environment. My stylesheets did not work. But the unabbreviated solution provided by Edward is a clear solution, not such a work around like yours. It's up to you, which one to choose. Maybe you can upgrade the processor.

Regards,

Joerg

Jorge A. Salido wrote:
Thanks! Quite what I needed (besides having to set the parameter on the
jsp before the transformation).

Now I have another problem, or kind of :(    The parameter gets to the
xslt just fine, but in:

<xsl:for-each select="../row">
        <xsl:sort select="cell[$sortBy]"/>
...

Where $sortBy is my parameter. I actually print the parameter and it
prints the number I am expecting, but it doesn't do the sorting, whereas
when I enter a number in its place it works just fine. I've also tried
assigning the parameter to a variable to see if it would help, but with
no luck. My guess it is interpreting the parameter as text instead of a
number, but that seems odd. Do variables and parameters actually have a
type?

It actually works if I do an operation on it, like cell[$sortBy + 0] but
I would like to clear things up instead of doing quick workarounds.
Jorge


On Tue, 2002-10-08 at 10:50, Maesen, Edward wrote:

Use <xsl:param> in stead of <xsl:variable>.
If your querystring parameter is named "sort" then you can use it in your
stylesheet with <xsl:param name="sort" value="'xx'"/>, where xx is just a
default value in case there is no querystring parameter. Make sure the
<xsl:param> is at the top level and not within a template.

Edward





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




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



<Prev in Thread] Current Thread [Next in Thread>