cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "SANSONE, AARON M [Non-Pharmacia/1000]" <aaron.m.sans...@monsanto.com>
Subject RE: Request parameter to a transformer
Date Tue, 15 Jan 2002 14:40:26 GMT
Laurent,

I simply specify the "use-request-parameters" option as follows:

<map:transform type="xslt" src="stylesheets/myStylesheet.xsl">
	<map:parameter name="use-request-parameters" value="true"/>
</map:transform>

The trick is to declare the request parameters you want to use at the top of
your stylesheet like this:

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

<xsl:param name="myRequestParameter"/>

... where "myRequestParameter" is the actual name of the request parameter
you wish to substitute in your stylesheet.  Then you can use 

<xsl:value-of select="$myRequestParameter"/>

for the substitution...

Hope this helps,

Aaron

-----Original Message-----
From: Laurent CAPRANI [mailto:m237636@er.uqam.ca]
Sent: Monday, January 14, 2002 5:40 PM
To: cocoon-users@xml.apache.org
Subject: Request parameter to a transformer


I need to provide a request parameter to a transformation.
Ex: http://.../application/page.xml?my-parameter=value

I tried to send a parameter to this transformer this way:

   <map:match pattern="application/**.xml">
    <map:generate src="application/{1}.xml"/>
    <map:transform type="my-transform">
	<map:parameter name="my-parameter" value="{my-parameter}"/>
    </map:transform>
    <map:transform src="application/xmltohtml.xsl"/>
    <map:serialize/>
   </map:match>
This does not work. The request parameter "my-parameter" is not present as a
sitemap variable.

What is the correct way to do this ?
Using another matcher? inserting an action?

-- Laurent CAPRANI
   Montréal



---------------------------------------------------------------------
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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>

---------------------------------------------------------------------
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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message