You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ebert Andreas <An...@mchp.siemens.de> on 2002/11/20 14:47:42 UTC

Passing database result as parameter in XSL

Hello,

I am trying to pass a parameter from one XSL template to another using the
code snippet below. The value of the parameter should be obtained from a
database. Unfortunately, the code does not work and I do not have any idea
why. Is it possible to do that with XSLT or do I misunderstand something
completely? I tried different ways (e.g. assign the database result to a
variable and then use it in the with-param tag), but the resulting Java code
simply seems to be empty. 

<xsl:call-template name="category">
<xsl:with-param name="categoryid"><esql:get-int
column="categoryid"/></xsl:with-param>
</xsl:call-template>

If I hardcode the parameter (e.g. replace '<esql:get-int
column="categoryid"/>' with '4') everything works fine. 

Thanks,

Andreas

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

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


Re: Passing database result as parameter in XSL

Posted by Leszek Gawron <ou...@kompuart.pl>.
On Wed, Nov 20, 2002 at 02:47:42PM +0100, Ebert Andreas wrote:
> Hello,
> 
> I am trying to pass a parameter from one XSL template to another using the
> code snippet below. The value of the parameter should be obtained from a
> database. Unfortunately, the code does not work and I do not have any idea
> why. Is it possible to do that with XSLT or do I misunderstand something
> completely? I tried different ways (e.g. assign the database result to a
> variable and then use it in the with-param tag), but the resulting Java code
> simply seems to be empty. 
> 
> <xsl:call-template name="category">
> <xsl:with-param name="categoryid"><esql:get-int
> column="categoryid"/></xsl:with-param>
> </xsl:call-template>
> 
> If I hardcode the parameter (e.g. replace '<esql:get-int
> column="categoryid"/>' with '4') everything works fine. 
> 
AFAIR you are allowed to use ESQL only in XSPs as it's tags are converted to
Java. So even trying to use and logicsheet in xsl is useless. Your xsp output
should provide you with appropriate data
	ouzo
-- 
            __
         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/      ouzo@vip.net.pl          _\\()//_
         .'/()\'.     Phone: +48(600)341118     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |


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

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