cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: Availability of user-request-parameter by the end of pipeline ??
Date Wed, 12 May 2004 23:38:05 GMT
On 12.05.2004 21:27, Sam wrote:

> Hi List,
> 
> I want to make a user-request-parameter available till the end of the pipeline, so that
I could
> use it in the last transformer for displaying what the user requested for.

<snip what="pipeline"/>

> I have this parameter available till the build-search.xsl, in my pipeline as seen below:
> 
> <!-- Make the request parameter available -->
> <xsl:param name="keyword"/>

>                 SELECT uri from keyword_search_table where keyword = '<xsl:value-of
select="$keyword"/>'

*Security warning!!*: SQL injection. Use prepared statements instead.

> Next in the pipeline is builddocument.xsl & then search_html.xsl/search_ns_html.xsl.
> 
> So my question is how do I make the parameter "keyword" (which holds the user-request-parameter)
> available to the search_html.xsl transformer so that I could display it on the browser,
specifying that
> heres what the user looked for and heres the search results.

You say what works for build-search.xsl (xsl:param name="keyword"/>) 
does not work for the other stylesheets? That would be very strange.

But looking at your pipeline
<map:transform src="adh/styles/builddocument.xsl">
     <map:parameter name="user-request-parameters" value="true"/>
</map:transform>
you have a typo above, the parameter must be named 
"use-request-parameters" not "user-request-parameters".

And the other 3 stylesheets miss this param completely:
<map:when test="explorer">
     <map:transform src="adh/styles/search_html.xsl"/>
</map:when>
<map:when test="mozilla5">
     <map:transform src="adh/styles/search_ns_html.xsl"/>
</map:when>
<map:otherwise>
     <map:transform src="adh/styles/search_html.xsl"/>
</map:otherwise>

Furthermore you should think about not using this feature as it has 
implications on caching as the caching would be dependent on all request 
params where it must be dependent on only one. You should pass the 
keyword request param explicitely to the stylesheet by using 
<map:parameter name="keyword" value="{request-param:keyword}"/>.

Joerg

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


Mime
View raw message