You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "peter.gershkovich" <pe...@yale.edu> on 2001/04/05 23:11:22 UTC

xsp-variables-parameters

I need to get the name of the file abc.xml dynamically in xsp.
I am trying to do that via a template called "filename".

Is there a way to send a parameter <xsp:expr>source</xsp:expr> to that 
template.
( String source = request.getRequestURI();)
Or is it possible to assign it to a variable and then pass to the 
template (shown below).

Please help. I am trying to solve this ... problem on my own for quite a 
while.

<xsl:variable name="uri-location">
<xsp:expr>source</xsp:expr>
</xsl:variable>
<!-- the above assigned a word source to the variable -->
        <xsl:call-template name="filename">
         <xsl:with-param name="x" select="$uri-location"/>
               </xsl:call-template>

Peter

Re: xsp-variables-parameters

Posted by Berin Loritsch <bl...@apache.org>.
"peter.gershkovich" wrote:
> 
> I need to get the name of the file abc.xml dynamically in xsp.
> I am trying to do that via a template called "filename".
> 
> Is there a way to send a parameter <xsp:expr>source</xsp:expr> to that template.
> ( String source = request.getRequestURI();)
> Or is it possible to assign it to a variable and then pass to the template (shown below).
> 
> Please help. I am trying to solve this ... problem on my own for quite a while.
> 
> <xsl:variable name="uri-location">
> <xsp:expr>source</xsp:expr>
> </xsl:variable>
> <!-- the above assigned a word source to the variable -->
>         <xsl:call-template name="filename">
>          <xsl:with-param name="x" select="$uri-location"/>
>                </xsl:call-template>
> 
> Peter

In short, no.  The issue is that you are trying to mix XSL and XSP.  They have
very unique roles in the life of a logicsheet.  XSL is handled by Xalan (or
SAXON), and is only used when generating the class.  It is not used over
and over again, nor is it used during run time.  XSP is used only during
run time, and is not used during generation time.  You can only initialize
an XSL variable with XSL methods or hard text.

I can't remember if Cocoon prepopulates an XSL variable for your use or not.

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>