Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 23547 invoked by uid 500); 27 Feb 2002 13:14:49 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 23536 invoked from network); 27 Feb 2002 13:14:49 -0000 Message-ID: <703B15C33AA4D411A69000508B09061D019CE8@BYRON> From: Bruno.Dumon@the-ecorp.com To: cocoon-dev@xml.apache.org Subject: RE: XML-Based Selection (Redirect Serializer?) Date: Wed, 27 Feb 2002 14:00:19 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="ISO-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I've had a similar situation, i.e. the need to make flow decision based on data generated in a pipeline. My solution was to create an action that executes another pipeline (using the cocoon:/ protocol), and stores its result as a (saxon)dom tree in the request object. Then there's a xpath-based selector to query that dom-tree, so that it's possible to redirect to another resource/url. Finally I've made an XSLTGenerator, that can apply an XSL to the dom-tree in the request object. A typical pipeline looks like: I've based the implementation on saxon, because there doesn't seem to be a way to build DTM trees and then feed them to xalan afterwards. The XSLTGenerator is to avoid the need to stream the dom tree again which would then be build again by the XSLT processor. Of course if you don't need XSLT you'll have to make a generator that streams the domtree to sax events. A completely other solutions, less nice and performant, but easier to implement is to use an XSLT that generates some HTML with some javascript in the onload event that will do the redirection. -- Bruno Dumon > -----Original Message----- > From: James Burton [mailto:strangegames@yahoo.com] > Sent: Wednesday, February 27, 2002 12:10 PM > To: cocoon-dev@xml.apache.org > Subject: XML-Based Selection (Redirect Serializer?) > > > Hi all! We're working on a Cocoon 2 project and > *very* strongly need the ability to "branch" to a > different pipeline or part of a pipeline based on the > XML output of a Transformer. This is because we use a > custom Transformer for communicating with an EJB back > end. Originally I thought to use an XML selector like > this: > > > > > ... > > > > > > > > ... > > > > > > > > However I found in the mail archives (Subject: XML > selector) that this method does not work because > Selectors have no access to the XML results of > Transformers. For similar reason a custom Matcher > wouldn't work either. But this functionality is > crucial! > > Therefore, I wondered if it would be possible for me > to create a "redirecting serializer": one that would > call a different pipe (or a different resource) based > on the final XML feed. In other words something like > this: > > > > > ... > > > > > > > /> > > > > Can someone give me a hint for how to start > implementing this? I know how to make a Serializer, > but don't know what it would call to start invoking a > pipe with a different URL (I imagine it must be > similar to the implementation of ). Or, if > this is not going to work, could somebody let me know? > In that case, I think the only alternative left is to > make a serializer that issues an HTTP redirect to a > given URL based on its parameters; i.e. a > "RedirectSerializer". I would be happy to contribute > this serializer if I can get it to work. > > Many thanks from Prague, > James Burton > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Greetings - Send FREE e-cards for every occasion! > http://greetings.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org > For additional commands, email: cocoon-dev-help@xml.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org