You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ernesto Echeverría <er...@telemovil.net> on 2004/07/19 05:21:49 UTC

Passing Parameters to the SQL Transformer

Is there a way for passing parameters to the SQL transformer without XSL
beforehand?
 
I have the following sql source file (dir2.xml):
 
<?xml version="1.0" encoding="utf-8"?>
<document>
 <sql:execute-query xmlns:sql="http://apache.org/cocoon/SQL/2.0">
  <sql:use-connection>northwind</sql:use-connection>
  <sql:query name="territory">
SELECT
 TerritoryDescription Territory
FROM 
 Territories
WHERE
 TerritoryDescription like '<sql:substitute-value sql:name="letter"/>%' 
ORDER BY
 TerritoryDescription
 </sql:query>
 </sql:execute-query>
</document>
 
The following sitemap segment passes a parameter (hardcoded), and it works
fine:
 
 <map:pipeline>
  <map:match pattern="dir2">
   <map:generate src="dir2.xml"/>
   <map:transform type="sql">
    <map:parameter name="letter" value="M"/>   
   </map:transform>
   <map:serialize type="xml" />
  </map:match>
 </map:pipeline>
 
However, what I'd like to do is to be able to use a "{letter}" or equivalent
parameter from the request string (i.e.
http://localhost:8080/cocoon/sql/dir2?letter=A )
 
I haven't checked ESQL yet, but I still want to know if it is possible to
pass parameters directly to the SQL Transformer without prior
transformation. 

Cocoon version is 2.1.5 .
 
Any help will be appreciated...
 
José Ernesto Echeverría
 


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