cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <Ralph.Go...@dslextreme.com>
Subject Re: xpath condition on xml data in sitemap
Date Thu, 22 Nov 2007 20:04:24 GMT
We are using the pattern similar to below in many, many places in our 
application.  I should also note that we no longer use XMLFileModule but 
a new XPathXMLFileModule that I will be checking in shortly. 
XPathXMLFileModule works similar to XMLFileModule but it caches 
correctly and has more consistent performance.

In cocoon.xconf:
<component-instance 
class="org.apache.cocoon.components.modules.input.XMLFileModule" 
logger="core.modules.xml" name="globalConfig">
  <file src="cocoon://mySite/getGlobalConfig"/>
</component>

In mySite's sitemap:

<map:match pattern="getGlobalConfig">
  <map:generate src="{system-property:global-config"} type="file"/>
  <map:serialize type="xml">
</map:match>

<map:match pattern="main">
  <map:act type="session-propagator">
     <map:parameter name="myTest" 
value="{globalConfig:/global-variables/mode}"/>
  </map:act>
  <map:generate ...>
  <map:select type="session-attribute">
    <map:parameter name="attribute-name" value="myTest"/>
    <map:when test="true">
      <map:transform type="a"/>
    </map:when>
    <map:otherwise>
      <map:transform type="b"/>
    </map:otherwise>
  </map:select/>
  <map:serialize .../>
</map:match>

Sébastien Geindre wrote:
> Bonjour,
>
> is it impossible or my explanation are too 'messy' or my english too 
> scrambled ??
> just let me know...
>
> thanks.
>
> Seb
>
>
> Sébastien Geindre a écrit :
>> Hello  everybody,
>>>
>>> i need to make a conditional treatment in my sitemap :
>>>
>>> generator --> transformer A -----(if condition on xml)-----> 
>>> transformer B1 ----------|---> transformerC --> serializer
>>>                                                          
>>> (else)                          -----> transformer B2 ----------|
>> my schema is not very clear :
>>
>> generator
>> transformer A
>> if condition on xml from transformerA --> transformer B1
>> else -----> transformer B2
>> transformer C
>> serializer
>>
>> the condition is computed on xml data and global variables
>>
>> How can i do that ??
>>
>> thanks for your help.
>>
>
>

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


Mime
View raw message