You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andrzej Jan Taramina <an...@chaeron.com> on 2003/10/07 16:22:24 UTC

How to dynamically select a stylesheet for xslt transform?

Could use some pointers on this:

I have an action that sets a map parameter, my-stylesheet to be the filename 
of the stylesheet I want to later use for a transform.  What I want to do is 
something like:

<map:act type="my-action">
	....
	<map:transform type="xslt" src="stylesheets/{my-stylesheet}">
</map:act>

But this doesn't work.  Seems that the src attribute does not resolve 
parameters.

Any quick suggestions on how to set up a pipeline to accomplish what I need?

Thanks!

Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How to dynamically select a stylesheet for xslt transform?

Posted by Olivier Billard <ob...@rennes.jouve.fr>.
Hi Andrzej,

You can do this by using the cocoon protocol :

<map:act type="my-action">
   ....
   <map:transform type="xalan" src="cocoon:/stylesheets/{my-stylesheet}">
</map:act>

...

<map:match pattern="stylesheets/*">
   <map:generate src="stylesheets/{1}"/>
   <map:serialize type="xml"/>
</map:match>

Be carefull to use the "xalan" transformer, because there some troubles with the "cocoon:" 
protocol and the "xslt" transformer. See [1] for details.


[1] : http://wiki.cocoondev.org/Wiki.jsp?page=MetaStylesheets


--
Olivier Billard


On 07/10/2003 16:22, Andrzej Jan Taramina wrote:

> Could use some pointers on this:
> 
> I have an action that sets a map parameter, my-stylesheet to be the filename 
> of the stylesheet I want to later use for a transform.  What I want to do is 
> something like:
> 
> <map:act type="my-action">
> 	....
> 	<map:transform type="xslt" src="stylesheets/{my-stylesheet}">
> </map:act>
> 
> But this doesn't work.  Seems that the src attribute does not resolve 
> parameters.
> 
> Any quick suggestions on how to set up a pipeline to accomplish what I need?
> 
> Thanks!
> 
> Andrzej Jan Taramina
> Chaeron Corporation: Enterprise System Solutions
> http://www.chaeron.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org