As quoted from Upayavira <[EMAIL PROTECTED]>:
> > Hi,
> > 
> > What is the best way to write the output of a Transformer (in a
> > pipeline) into a file (e.g. /resources/bla.xml) on the filesystem?
> 
> Check out the SourceWritingTransformer.

I am checking it out. thanks. I'm getting an error though:

failedThere was a problem manipulating your document: org.w3c.dom.DOMException: 
HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted. 
writenonefile:/resources/result.xml


My xml source (called test.xml): 
<?xml version="1.0" encoding="UTF-8"?>
<page>
<source:write xmlns:source="http://apache.org/cocoon/source/1.0";>
  <source:source>context://resources/result.xml</source:source> 
  <source:fragment>
    <title>SourceWritingTransformer Test Result 1</title>
  </source:fragment>  
</source:write>
</page>

My pileline:
<map:match pattern="test">
  <map:generate src="resources/test.xml"/>
  <map:transform type="sourcewriter"/>
  <map:serialize type="xml"/>
</map:match>


sourcewriter:
<map:transformers default="xalan">
  <map:transformer name="sourcewriter" logger="sitemap.transformer.filewriter"
        src="org.apache.cocoon.transformation.SourceWritingTransformer">
     <map:parameter name="serializer" value="xml"/>
   </map:transformer>   
</map:transformers>

what am I doing wrong?

Thanks,
Ali

> Regards, Upayavira
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
-- Ali Mesbah, West Consulting B.V., www.west.nl, +31 15 2191600

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to