cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Burton <>
Subject XML-Based Selection (Redirect Serializer?)
Date Wed, 27 Feb 2002 11:09:48 GMT
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

<map:match pattern="example">
  <map:generate src="..." />
  <map:transform type="custom-ejb-interface">
  <map:select type="xml" node="/result/flag">
    <map:when test="normalResult">
      <map:transform src="styles/normal.xsl" />
    <map:when test="specialResult">
      <map:transform type="custom-ejb-interface">
      <map:transform src="styles/special.xsl" />
  <map:serialize />

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

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

<map:match pattern="example">
  <map:generate src="..." />
  <map:transform type="custom-ejb-interface">
  <map:serialize type="redirector">
    <map:parameter name="node" value="result/flag" />
    <map:parameter name="match1" value="normal" />
    <map:parameter name="call1" value="normal-pipe" />
    <map:parameter name="match2" value="special" />
    <map:parameter name="call2" value="special-pipe"

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 <map:call>).  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!

To unsubscribe, e-mail:
For additional commands, email:

View raw message