Hi James,
one solution that may help:
Your Transformer -> Stylesheet -> CIncludeTransformer -> serializer
:
v
pipeline (via: "cocoon://...")
So the stylesheet constructs the URI from the data your transformer sends.
Matthew
--
Open Source Group sunShine - Lighting up e:Business
=================================================================
Matthew Langham, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
Tel:+49-5251-1581-30 [EMAIL PROTECTED] - http://www.s-und-n.de
Weblogging at: http://www.need-a-cake.com
=================================================================
-----Original Message-----
From: James Burton [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 27, 2002 12:10 PM
To: [EMAIL PROTECTED]
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:
<map:match pattern="example">
<map:generate src="..." />
<map:transform type="custom-ejb-interface">
...
</map:transform>
<map:select type="xml" node="/result/flag">
<map:when test="normalResult">
<map:transform src="styles/normal.xsl" />
</map:when>
<map:when test="specialResult">
<map:transform type="custom-ejb-interface">
...
</map:transform>
<map:transform src="styles/special.xsl" />
</map:when>
</map:select>
<map:serialize />
</map:match>
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:
<map:match pattern="example">
<map:generate src="..." />
<map:transform type="custom-ejb-interface">
...
</map:transform>
<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"
/>
</map:select>
</map:match>
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!
http://greetings.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]