xsl-list
[Top] [All Lists]

RE: Getting parameters from a JSP

2002-10-08 09:50:33
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


Date: 07 Oct 2002 13:09:22 -0600
From: "Jorge A. Salido" <jorgesalido(_at_)yahoo(_dot_)com>
Subject: [xsl] Getting parameters from a JSP

Hi,

I've been looking for information or sample code on how can I get
parameters from a JSP file to an XSLT (if that is even 
possible...). So
far what I've been thinking is that perhaps it would be easier to
include those parameters in an xml file and then process it 
with a given
xslt, but I'm guessing that's not the most practical way to do it.

What I'm trying to do is sort a simple table by a given 
column, getting
the column number from a JSP as a parameter (ej. foo.jsp?sort=2) so I
can use it on the xsl as 

<xsl:variable name="sortOrder" select="(missing here!?)">
<xsl:sort select="column[$sortOrder]">

...and then I also want to limit the number of rows the page displays,
showing for example n rows from a given start row, or show all rows
between a start row and end row. My problem is still to get those
parameters while interacting with the user.

I've been able to do these stuff on a static basis, and call java
functions so far, but not within the jsp (or specifically the
getParameter() function). Any help/pointers on how to mix the JSP and
the XSLT?

Jorge


 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>