> When the page is requested, I want Cocoon to chech the database to find
> out
> which stylesheet to process the XML data with, and the transform it.
>
> Any ideas to how I can manage this? (Cocoon 2b2)
Hello Rune,
you could write an action which queries the DB for the right
stylesheet to use and put it into the action's result Map under a
free choosen key, let's say "stylesheet":
Map map = new HashMap();
map.put("styleshet", anyStylesheetName);
return map;
Later you can refer to it in the sitemap using the same key in
a way like that:
<map:match pattern="*.xml"/>
<map:generate src="{1}.xml"/>
<map:act type="select-stylesheet">
<map:parameter name="source" value="{1}"/>
<map:transform src="{stylesheet}"/>
<map:serialize/>
</map:act>
<!-- action failed, take default stylesheet -->
<map:transform src="default-stylesheet.xslt"/>
<map:serialize/>
</map:match>
But maybe that's not a very nice solution because this way you
cannot take advantage of the esql logicsheet or the sql transformer
to query the database.
So let's hope someone knows a better thing.
Stefan
---------------------------------------------------------------------
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]>