cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hunsberger, Peter" <>
Subject Using resources or other pipeline sources in parameters?
Date Wed, 08 May 2002 15:13:16 GMT
Is it possible to map the contents of a cocoon resource or other sitemap
component to a parameter that is to be passed to a stylesheet?

Currently, I have a pipeline where I wrap the contents of the request along
with the original source xml and pass that all into my style sheet as

         <map:match pattern="*/*">
            <map:aggregate element="wrapper">
               <map:part src="cocoon:/run/requestdata"/>
               <map:part src="cocoon:/{1}/{2}.xml"/>
            <map:transform src="generic/stylesheets/main.xsl"/>

Where run/requestdata just picks up the request generator.  However, it
would be nice to be able to do something like:

         <map:match pattern="*/*">
            <map:generate src="cocoon:/{1}/{2}.xml"/>
            <map:transform src="generic/stylesheets/main.xsl">
               <map:parameter name="requestdata"

This simplifies the stylesheet considerably since the I can now refer to the
request data as a global parameter and not have to take special steps to
parse it and pass it around as a variable (which implies making sure the
variable passes through all templates unscathed until it gets to it's final
consumer, which in my case is about 8 templates deep in the whole process).

I suspect that this might be achieved fairly simply with XSP's but  I'd sort
of like to not use XSP since there is a bit of a strategic reason to keep
the templates as close to pure XSLT as possible. If I was to use XSP's what
would the approach be? Just rename the template as an XSP (and change the
pipeline of course) and then pick up the request object directly?  

I'm running Cocoon 2.0.2 under JBoss2.4.4/Tomcat4.0.4b with JRE1.4 if it
makes any difference....

Peter Hunsberger

Phone: 901-495-5252

Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message