cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Binkley, Peter" <>
Subject RE: Can I pass a sitemap resource as a parameter to an xslt transformer?
Date Fri, 14 Jan 2011 17:22:27 GMT
I would use a regular pipeline for the authors list, with caching turned
on (so it doesn't run the query every time - check the cocoon docs for
how to control expiry etc.):

	<map:pipeline type="caching">
		<map:match pattern="authors">

And then include it from within the article.xsl using the cocoon:
protocol, which is used to address a pipeline in the sitemap:
	<xsl:variable name="authors"

Resources are used when you want to include the same series of
components in more than one pipeline. I don't think a resource can do
caching: that would be up to the pipelines in which it is called.


-----Original Message-----
From: Des Magner [] 
Sent: Friday, January 14, 2011 9:24 AM
Subject: Can I pass a sitemap resource as a parameter to an xslt


I want to combine two pieces of XML that gets passed to my XSL 
transformation. I have a list of authors that needs only to be read 
once. I then have a page to edit different articles and this page must 
present the list of authors for selection. But I do not want to read the

list of authors from the database every time an article needs to be 
edited. So I thought the best way to do this would be to define a 
resource that contains the list of authors and pass this as a parameter 
to the transformation for the article edit page as outlined below. Is it

possible to somehow refer to the authors resource where I have placed 
the ???.

Any help much appreciated

<map:resource name="authors">
<map:generate src="authors.xml"/>
<map:transform type="sql">
<map:parameter name="use-connection" value="myConnection"/>

<map:generate src="article.xml"/>
<map:transform type="sql">
<map:parameter name="use-connection" value="myConnection"/>
<map:parameter name="article-id" value="{request-param:article}"/>
<map:transform src="article.xsl">
<map:parameter name="authors" value="{???}"/>

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

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

View raw message