cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Piroumian" <KPiroum...@flagship.ru>
Subject Re: Problem with variables
Date Fri, 20 Oct 2000 07:24:19 GMT
Hi!

I think that I get the problem.
You need the K4 value in your XSL file. And the value is coming from the
request params.
Right?
In this case you can simply add a stylesheet param like this:

<xsl:stylesheet version="1.0"
      xmlns:xsl=" http://www.w3.org/1999/XSL/Transform">

<xsl:param name="K4">defaule value</xsl:param>

</xsl:stylesheet>

Hope this will help.

Regards,
  Kot.

----- Original Message -----
From: <Kai.Rehlen@pass-consulting.com>
To: <cocoon-users@xml.apache.org>; <per@onclave.com>
Sent: 20 ??????? 2000 ?., ??????? 10:58
Subject: AW: Problem with variables


Hi Peer,
first of thanks for your response.

Yes the query does execute and return and return the desired "catid" and
"name" from the table category!
Changing the PI does not has any effect, cause the output is in a drop down
list which shows the right names.
Please have a look at the XSL file where I market the section I need to see
the value of "K4"

-----Urspr√ľngliche Nachricht-----
Von: Per Kreipke [ mailto:per@onclave.com <mailto:per@onclave.com> ]
Gesendet am: Donnerstag, 19. Oktober 2000 17:02
An: cocoon-users@xml.apache.org
Betreff: RE: Problem with variables

> To make my self clear:
>
> Here the xml file which gets a variable entered by user "K4"
>
> *************************************************************************
> <?xml version="1.0" encoding="UTF-8"?>
> <?cocoon-process type="sql"?>
> <?xml-stylesheet href="./Level5.xsl" type="text/xsl"?>
> <?cocoon-process type="xslt"?>
> <page>
>       <connectiondefs>
>           <connection name="FF">
>             <driver>COM.ibm.db2.jdbc.app.DB2Driver</driver>
>             <dburl>jdbc:db2:FF</dburl>
>             <username>****</username>
>             <password>****</password>
>           </connection>
>       </connectiondefs>
>       <query connection="FuE">select c.catid, c.name, cat.cat_catid,
> cat.catid
>                               from category as c, cat_cat
> as cat
>                               where cat.catid = {@K4} and
> c.catid = cat.cat_catid
>       </query>
> </page>

Does this query actuall execute? What do you get when you change the XML
file PIs to be the following so you can see the DB output:

<?xml version="1.0" encoding="UTF-8"?>
<?cocoon-format type="text/xml"?>
<?cocoon-process type="sql"?>
<!--
<?xml-stylesheet href="./Level5.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>
-->

And where does the value of K4 come from in the first place? Are you trying
to use this as an XSL expression, the way you use {$ID} in the XSL below?
Looks to me like it's an SQL parameter. Not sure how that's going to get set
from your URL.

Do you mean to do something like:

'where cat.catid = <request:get-parameter name="K4">'

I do retrive the value insude the query with the existing tag

If so, you'll need more XSP stuff in your file.

>
> ******************************************************************
> *********
>
> and here the according stylesheet where I need to put the variable "K4"
> again
> somehow if I wish to pass it to the next site. I know if the query returns
> something
> I have the variable, but what to do if it doesn't??
>
> ******************************************************************
> *********
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
>       xmlns:xsl=" http://www.w3.org/1999/XSL/Transform
<http://www.w3.org/1999/XSL/Transform> "
> >
> <xsl:template match="/">
> <body bgcolor="orange">
>       <form id="Level5" action="../request.xml" method="post"
> target="_top">
>
>           <xsl:if test="page / ROWSET / ROW  != '0'">
>
>           <select name="K" style="width=120" onchange="form.submit()">
>             <optgroup label="Category 5">
>                     <option value="0">Select</option>
>                     <xsl:for-each select="page / ROWSET / ROW">
>                     <xsl:variable name="ID"><xsl:value-of
> select="CATID"/></xsl:variable>
>                     <option value="{$ID}">
>                           <xsl:value-of
> select="NAME"></xsl:value-of>
>                     </option>
>
>             </xsl:for-each>
>             </optgroup>
>           </select>
>           </xsl:if>
>
>           ..Here I need the value of "K4" in case the query does'n has any
output!
>
>       </form>
> </body>
> </xsl:template>
> </xsl:stylesheet>
> *******************************************
> Thank's
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org



Mime
View raw message