You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Carlos Dias <cd...@pontoc.pt> on 2004/10/13 16:57:27 UTC
Pipe-aware Selectors
Hi folks!
Here is my problem:
In my pipeline I want to make choices(xsl) dependent from an XML input. By example:
<map:match patter="test">
<map:generate src="cocoon:/test.xsp"/>
<map:select type="xmlselector">
<map:when test ="/*/@type='true'">
<map:transform src="xsl1.xsl"/>
</map:when>
<map:otherwise>
<map:transform src="xsl2.xsl"/>
</map:otherwise>
</map>
</map>
The subject was already discuss in the dev-list (http://www.mail-archive.com/cocoon-dev@xml.apache.org/msg13883.html) but seems that hasn't bean developed.
Can anybody help me?!
Thanks in advance,
Carlos Dias
Re: Pipe-aware Selectors
Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 13 oct. 04, à 16:57, Carlos Dias a écrit :
> ...In my pipeline I want to make choices(xsl) dependent from an XML
> input...
One way is to generate CInclude statements based on your input, a first
transform generates statements like
<cinclude:include src="cocoon:/type-true"/>
by concatenating the "true" value of your type argument
Then you add a CInclude transformer to process this, and it will call
your sitemap which can match on "type-true", "type-false", "type-*" to
trigger the next step of the pipeline.
-Bertrand