cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Perez <>
Subject Conditional branching
Date Mon, 23 May 2005 09:06:27 GMT
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" 
        <map:transform pattern="sheet2a.xsl"/>
    <map:transform pattern="sheet2b.xsl"/>
    <map:serialize type='myserializer'>

Has anyone tried any better solution?
Is this solution viable?

Thanks in advance for any hint.

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

View raw message