You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by CURRAN Chad / FTR&D / ATFREEDOM <ch...@rd.francetelecom.com> on 2001/03/12 20:50:41 UTC
Passing dynamic values to a logicsheet
After much work and help from list users, I can create and debug taglibs and
logicsheets easily. However, I still haven't reached my goal.
I'm trying to wrap my sql in a taglib that handles all the connection and
login stuff. I'm successful, except that I can only pass a static string. If
I try to include a variable in the query_text node (below), the variable
name gets passed through instead of the variable evaulating. I haven't been
able to find a way to make it evaulate. Any suggestions?
Below are the xml file that calls the taglib, and the string that the taglib
gets passed.
my xml file:
<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-logicsheet href="sqlwrapper.xsl" type="text/xsl"?>
<?xml-stylesheet href="displayzaps_html.xsl" type="text/xsl"?>
<xsp:page language="java"
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
xmlns:sqlwrapper="http://u-curran:8080/taglib_test/sqlwrapper"
xmlns:sql="http://www.apache.org/1999/SQL"
>
<page>
<xsp:logic>
String username =
request.getParameter("username");
</xsp:logic>
<customtag:query>
<customtag:query_text>
SELECT *
FROM AFRAWIMPULSEDATA, AFCATALOGITEM
WHERE AFRAWIMPULSEDATA.VENDORLOGIN =
'<xsp:expr>username</xsp:expr>'
AND AFCATALOGITEM.CATITEMID
= AFRAWIMPULSEDATA.CATITEMID
AND RKEY1 NOT IN (SELECT
UNIQUE RKEY1 FROM AFZAPVIS WHERE APPNAME='AMAPAGE' OR APPNAME='MESZAPS')
ORDER BY TIMESTAMP DESC
</customtag:query_text>
</customtag:query>
</page>
</xsp:page>
in my taglib, <xsl:value-of select='customtag:query_text'/> outputs the text
below:
SELECT *
FROM AFRAWIMPULSEDATA, AFCATALOGITEM
the problem >>>> WHERE AFRAWIMPULSEDATA.VENDORLOGIN = 'username'
AND AFCATALOGITEM.CATITEMID
= AFRAWIMPULSEDATA.CATITEMID
AND RKEY1 NOT IN (SELECT
UNIQUE RKEY1 FROM AFZAPVIS WHERE APPNAME='AMAPAGE' OR APPNAME='MESZAPS')
ORDER BY TIMESTAMP DESC
Re: Passing dynamic values to a logicsheet
Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 12 Mar 2001, CURRAN Chad / FTR&D / ATFREEDOM wrote:
> After much work and help from list users, I can create and debug taglibs and
> logicsheets easily. However, I still haven't reached my goal.
>
> I'm trying to wrap my sql in a taglib that handles all the connection and
> login stuff. I'm successful, except that I can only pass a static string. If
> I try to include a variable in the query_text node (below), the variable
> name gets passed through instead of the variable evaulating. I haven't been
> able to find a way to make it evaulate. Any suggestions?
search in the mailing list for messages on 'get-nested'. look at the esql
logicsheet. (can't fathom why it wouldn't fit your needs anyway, but
whatever floats your boat! :))
- donald
---------------------------------------------------------------------
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>