xsl-list
[Top] [All Lists]

RE: Getting parameters from a JSP

2002-10-08 17:52:16
I assume you want to sort by cells in a certain position, so you might try
the unabbreviated version:
<xsl:sort select="cell[position()=$sortBy]"/>

Edward

-----Original Message-----
From: Jorge A. Salido [mailto:jorgesalido(_at_)yahoo(_dot_)com]
Sent: Tuesday, October 08, 2002 6:10 PM
To: 'xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com'
Subject: RE: [xsl] Getting parameters from a JSP


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>