|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Getting parameters from a JSP
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@xxxxxxxxx] > Sent: Tuesday, October 08, 2002 6:10 PM > To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx' > Subject: RE: 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








