You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Askild Aaberg Olsen <as...@xangeli.com> on 2004/05/09 23:16:17 UTC

Re: fetch a string from another piple line by "cocoon://" in javascript?

Christina wrote:
>I have a pipeline which return a string
>Then i wander how to get that string in javascipt?
>I think it should be somemethod("cocoon://uri"), But would anybody tell me
which method I should use?
>Thanks!

I had a similar question some days ago, which Bruno Dumon answered with:

"org.apache.cocoon.components.flow.util.PipelineUtil.processToDOM(...)
will help you to execute a pipeline and capture the result in a DOM tree."

http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/flow/util/
PipelineUtil.html

Which lead to the following successfull snippet:

   var pipelineUtil =
cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.Pipeline
Util);
   var document = pipelineUtil.processToDOM("some.cocoon.pipeline", null);
   cocoon.disposeObject(pipelineUtil);

Now you can iterate over this document with regular DOM-access, like JD
Daniels did in:
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=108087195410338&w=2

Askild



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