cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Perez <>
Subject Re: Conditional branching
Date Mon, 23 May 2005 12:58:10 GMT
Reinhard Poetz schrieb:

Thanks Reinhard,
Please, any good keyword for searching the archives?
I've tried "branching" and "xml stream" with no luck.

> David Perez wrote:
>> Hi all,
>> I need branching depending on the current contents of some tag in the 
>> XML at a given pipeline step.
>> So the first thing comes up to my mind is to use a matcher.
>> I've found the WildcardParameterMatcher that allows me to use sitemap 
>> variable and an input module called XmlFileModule. This input module 
>> allows me to use any XPath expression of any pipeline.
>> The problem is how can I pass the current XML flow to the XmlFileModule?
>> The generator isn't file based, it parses the body of a post request.
>> Here is a possible sketch of this solution:
>> <map:match pattern="myurl">
>>    <map:generate type="mygenerator"/>
>>    <map:transform pattern="sheet1.xsl"/>
>>    <!--I would like to branch here if  /*/branching-tag='valueA'-->
>>    <map:match type="wildcard-param" pattern="valueA">
>>        <map:parameter name="parameter-name" value="my-param"/>
>>        <map:parameter name="my-param" 
>> value="{xml-file-module:/*/branching-tag}"/>
>>        <map:transform pattern="sheet2a.xsl"/>
>>       <map:serialize/>
>>    </map:match>
>>    <map:transform pattern="sheet2b.xsl"/>
>>    <map:serialize type='myserializer'>
>>  </map:match>
>> Has anyone tried any better solution?
>> Is this solution viable?
>> Thanks in advance for any hint.
> Branching based on the content of the XML stream is disallowed by 
> design. There have been some discussions about this that can be found 
> in the archives of the users and the dev mailing list.

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

View raw message