From: "Andrew Savory" <[EMAIL PROTECTED]>

> On Fri, 12 Apr 2002, Franosch, Heike wrote:
>
> > I want to insert the session id to my URLs from within the stlyesheet
and
> > don't know
> > how to access the context. I have seen a hint about the
> > SessionValidationAction, but I just
> > can't get it run.
> > Has someone a nice tip or maybe some sample code how to achieve this?
>
> Quite possibly the wrong way of doing things, but I use an XSP to grab the
> relevant session details then aggregate them so they are available to use
> in the stylesheet.
>
> I'd be interested in hearing if there's a better way of doing it...

This is the easiest approach, and not wrong per se.

But when this kind of problem arises, I usually ask myself:

1. "Why do I need it in the stylesheet?"
2. "Is my stylesheet for -style- or am I programming with it?"
3. "Can't I resolve this problem once and for all during Generation?"
4. "Isn't this better solved with a Transformer, since it requires coding?"

There is not one and only answer, as in Cocoon you can do the same thing in
different ways.

But a simple hint is to try to do all in Generation, add the absolute
necessary with Transformers and use stylesheets only to change format-style,
not to code.
It will make your system more manageable and reusable, since it removes the
dependencies between Components.

If you need a specific thing to happen in Generation for the Transformation
to work, you are making code reuse much harder.

--
Nicola Ken Barozzi                   [EMAIL PROTECTED]
            - verba volant, scripta manent -
   (discussions get forgotten, just code remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to