Following the thread "extending FOM" about extending processPipelineTo to SAX and DOM, I wrote a utility class that handles all this.
This class is totally decorrelated from the FOM and the "cocoon" object and provides the processToDOM(), processToSAX() and processToStream() methods. Here's a usage example to get a DOM:
var pipelineUtil = cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.PipelineUtil);
var doc = pipelineUtil.processToDOM("my-pipeline", { foo:bar });
// do something with "doc", such as binding to a woody form
This class replaces and extends "cocoon.processPipelineTo". Being implemented totally externally to the flow engine, it shows that this method isn't actually core to the FOM.
So what about deprecating "cocoon.processPipelineTo" from the official FOM and direct users to the new class ?
Sylvain
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects } Orixo, the opensource XML business alliance - http://www.orixo.com