You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Remmerie Bart <Ba...@elia.be> on 2004/02/27 11:31:53 UTC

Applying SourceWritingTransformer to file used in pipeline

It appears to be impossible to use the SourceWriting transformer to a file
that is in use by the pipeline.
Does anyone have a workaroud / alternative for this ?

A bit more details:

Below is my code (which is not working).
When I try to write to writeTest.xml, I get the following error:

org.apache.cocoon.ProcessingException: Could not process your document.:
java.io.IOException: Could not rename
C:\cocoon-2.1\build\webapp\samples\testDir\writeTest.xml.tmp to
C:\cocoon-2.1\build\webapp\samples\testDir\writeTest.xml
cause: java.io.IOException: Could not rename
C:\cocoon-2.1\build\webapp\samples\testDir\writeTest.xml.tmp to
C:\cocoon-2.1\build\webapp\samples\testDir\writeTest.xml

I have the following snippet in my pipeline

   <map:match pattern="write">
    <map:generate src="writeTest.xml"/>
    <map:transform type="write-source"/>
    <map:serialize type="xml"/>
   </map:match>

and writeTest.xml contains the following:
 <page>
   <source:write xmlns:source="http://apache.org/cocoon/source/1.0">
     <source:source>writeTest.xml</source:source>      
     <source:fragment><page>
       <title>Hello World</title>
       <content>
         <p>This is my first paragraph.</p>
       </content>
     </page></source:fragment>
   </source:write>
 </page>


Thanks & Regards,
Bart





This message and its attachments may contain confidential information protected by intellectual property rights or other rights & is strictly for the exclusive use of the intended recipient. It is strictly prohibited to copy, alter or disclose this message or its contents to any other person without Elia's prior consent. If you are not the intended recipient of this message, please inform the person who sent it and delete the message from your system. Elia is not liable for any direct or indirect damage arising from errors, inaccuracies or any loss in the message, from unauthorized use, disclosure, copying or alteration of it or as a result of any virus being passed on. This message does not constitute any commitment from Elia except when expressly otherwise agreed between the intended recipient and Elia.

U vindt de Nederlandse versie van deze disclaimer op onze internetsite  www.elia.be

Vous pouvez découvrir la version française de ce disclaimer sur notre site internet www.elia.be


Re: Applying SourceWritingTransformer to file used in pipeline

Posted by Joerg Heinicke <jo...@gmx.de>.
On 27.02.2004 11:31, Remmerie Bart wrote:

> It appears to be impossible to use the SourceWriting transformer to a file
> that is in use by the pipeline.

Of course it is so, you must have in mind that the file content is 
streamed! And what should be the use case for writing a file *while* you 
are reading it?

> Does anyone have a workaroud / alternative for this ?

I guess FlowScript with calls to different pipelines.

Joerg