cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira ...@upaya.co.uk>
Subject Re: [SourceWriteTransformer] <source:replace> problem, please help
Date Fri, 03 Dec 2004 11:36:36 GMT
H.vanderLinden@MI.unimaas.nl wrote:

>Hi,
>
>I'm currently writing a template for replacing a node in an XML file. I want
>to write the last time the user logged in in a file with the following
>structure:
>
><users>
>  <user>
>    <name>login-name</name>
>    <lastlogintime>time</lastlogintime>
>  </user>
></users>
>
>I use the following source-write structure:
>
>        <source:insert overwrite="true">
>            <source:source>${filepath}/lastlogin.xml</source:source>
>            <source:path>//users/</source:path>
>            <source:replace>user[name==${name}]</source:replace>
>            <source:fragment>
>                <user>
>                    <name>${name}</name>
>                    <lastlogintime>${logintime}</lastlogintime>
>                </user>
>            </source:fragment>
>        </source:insert>
>
>It should add the structure if it doesn't exist, and replace if it is
>already there. However, the current code always inserts the structure,
>rather than replaces an existing one.
>
>Can someone tell me what's wrong?
>  
>
My question is more "why are you doing this with the SWT?" Really, this 
is a controller matter, and the SWT was there for the times before we 
had proper controller options (i.e. flow). Really, pipelines should be 
side-effect free, and SWT is
inherently not!

Regards, Upayavira


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


Mime
View raw message