You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Reinhard Haller <re...@interactive-net.de> on 2006/06/09 16:56:50 UTC
source writing transformer exception
Hi,
I've set up a pipeline to sanitize a bunch of xml files.
The following matcher reads an xml file and stores the
changed file with the source writing transformer in the same
place.
<map:match pattern="**/*.*-transform">
<map:generate src="{1}/{2}.xml" />
<map:transform src="xslt/update/{3}.xslt" />
<map:transform src="xslt/rssstore.xslt" >
<map:parameter name="path" value="news" />
</map:transform>
<map:transform type="write-source-utf-8" >
<map:parameter name="serializer" value="xml-utf-8"/>
</map:transform>
<map:serialize type="xml-utf-8" />
</map:match>
Doing so, the pipeline stops with the exception:
"Could not process your document."
Storing the file to another place works. Is there a way to solve
the problem?
Thanks
Reinhard
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: source writing transformer exception
Posted by Igor Naumov <ig...@hotmail.com>.
When the source is an XML file, it's open and locked during pipeline
processing. So you cannot write to it in the same pipeline (it's like
reading from a text file one line at a time and trying to write that
line back at the same time).
It worked for me if I put the source file inside an aggregate (I
actually needed it there).
If you do not want to use aggregate, you can try using cocoon: protocol,
but I am not sure if it will work.
Basically the idea is to isolate the source in a separate "request".
Igor
Reinhard Haller wrote:
> Hi,
>
> I've set up a pipeline to sanitize a bunch of xml files.
>
> The following matcher reads an xml file and stores the
> changed file with the source writing transformer in the same
> place.
>
> <map:match pattern="**/*.*-transform">
> <map:generate src="{1}/{2}.xml" />
> <map:transform src="xslt/update/{3}.xslt" />
> <map:transform src="xslt/rssstore.xslt" >
> <map:parameter name="path" value="news" />
> </map:transform>
> <map:transform type="write-source-utf-8" >
> <map:parameter name="serializer" value="xml-utf-8"/>
> </map:transform>
> <map:serialize type="xml-utf-8" />
> </map:match>
>
> Doing so, the pipeline stops with the exception:
>
> "Could not process your document."
>
> Storing the file to another place works. Is there a way to solve
> the problem?
>
> Thanks
> Reinhard
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org