Allright!
Now I understand that note in the xslt transformer page[1]:
----
use-request-parameters: true|false - Setting this to true makes all request
parameters available in the XSLT stylesheet. Note that this might have
issues concerning cachability of the generated output of this transformer,
the caching algorithm not only checks the last modification date but also
all values of the request parameters.
----

[1] http://xml.apache.org/cocoon/userdocs/transformers/xslt-transformer.html

-- Laurent CAPRANI
   Montreal

> Vadim Gritsenko [mailto:[EMAIL PROTECTED]] kindly wrote:
>
> Use (1) if you need just one parameter and it *must* present, use (2) if
> you need more then one parameter, or use (3) if you do not care about
> the caching. Caching system will work far more efficient with approach 1
> or 2.
>
> In details:
> The problem with solution (3) and cache: transformer will report to
> cache that its output depends on *all* request parameters. Usually, only
> some parameters are used (especially when response aggregated from
> several parts: different request parameters may be related to different
> pipelines). Then, it means that for every request with different
> parameter values (even when only unused parameters are changed!) cache
> will try to save the result of transformation. Cutting off unused
> parameters will save CPU and memory resources.
>
> Hope I'm clear enough...
>
> Vadim
>
> > From: Laurent CAPRANI [mailto:[EMAIL PROTECTED]]
> >
> > I came up with three different solutions.
> >
> > 1. Using a "request" matcher
> > I haven't found a matcher which simply creates sitemap variables for
> all
> > request parameters. Could that be a useful thing to add to the default
> > wildcard matcher ?
> >
> > The "request" matcher(1) selects a pipe-line for a specific parameter
> and
> > makes a sitemap variable of it. It is not exactly what I wanted, but I
> > didn't specify.
> >
> > 2. Using a "request" action
> > Enclosing the transform within a "request" action(2) works:
> >
> >    <map:match pattern="application/**.xml">
> >      <map:generate src="application/{1}.xml"/>
> > <map:act type="request">
> > <map:parameter name="parameters" value="true"/>
> >      <map:transform type="my-transform">
> >     <map:parameter name="my-parameter" value="{my-parameter}"/>
> >      </map:transform>
> > </map:act>
> >      <map:transform src="application/xmltohtml.xsl"/>
> >      <map:serialize/>
> >     </map:match>
> >
> > 3. Get parameters silently from within the transformer
> > Request parameters are available through the "objectModel" Map. It is
> then
> > possible to use any request parameter without specifying it in the
> sitemap.
> > It does not look like the right thing to do. What do you think?
> >
> >
> > (1) <map:matcher name="request"
> > src="org.apache.cocoon.matching.RequestParamMatcher"/>
> > (2) <map:action name="request"
> > src="org.apache.cocoon.acting.RequestParamAction"/>>


---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to