cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guido Casper" <gcas...@s-und-n.de>
Subject Re: Re[2]: Flowscript and POST's
Date Tue, 23 Dec 2003 14:04:16 GMT
Michael Lucas-Smith wrote:
> I now have the response coming back in the flowscript:
>
> function submit() {
>          var result = new Packages.java.io.ByteArrayOutputStream();
>          cocoon.processPipelineTo(cocoonparameters.actionurl, {},
>          result);
>          result = result.toString();
>          if (??)
>             cocoon.redirectTo(cocoon.parameters.success);
>          else
>              cocoon.redirectTo(cocoon.paramters.failure);
> }
>
> In the future I'll probably start using continuations and use
> sendPageAndWait, but for now I'm using redirectTo.
>
> The ?? is the question. The result I'm getting back from that process
> is XML. What is the easiest way to then parse that XML and act on its
> contents inside the flowscript?

With the latest CVS you can do something like:

var util =
cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.Pipe
lineUtil);
var doc = util.processToDOM(cocoon.parameters.actionurl, {});
var result  = Packages.org.apache.cocoon.xml.dom.DOMUtil.getValueOf(doc,
XPathExpression, "default");

HTH
Guido


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


Mime
View raw message