On Monday 17 March 2003 03:04 am, Chris Leishman wrote:
> On Monday, March 17, 2003, at 09:57 AM, Matt Sergeant wrote:
> <snip>
>
> >> Firstly, is this the correct way to achieve what I want?
> >
> > Possibly. Though I don't know personally how well XSP as anything but
> > the first stage in the pipeline works these days. J�rg was going to
> > work on that for 1.7, so I assume not so well ;-)
>
> Can you suggest a better way?  I'm sure this can't be an uncommon
> scenario (take random XML, munge it via XSL into HTML but still want to
> put some dynamic stuff in).
>

I think generally the best advice for using XSP is to use it first in the 
pipeline and use XSP to build up all the data you will need later in the 
pipeline, so you could simple have something like:

<header>
<web:header name="HTTP_USER_AGENT"/>
</header>

in your XSP and then in the XSLT you can match on that and do whatever you 
need to do with it, like convert it to some HTML tags. In other words don't 
try to add in DATA in later stages of pipelines. Think of your 1st stage in 
the pipeline as producing all the data you will need, and later stages are 
there to organize and present it.

Putting XSP later in a pipeline is also horribly inefficient because the XSP 
has to be compiled to perl for every single request. Normally a static XSP 
page will be compiled to a perl module ONCE and the resulting perl script 
cached, but if the XSP itself is dynamic then that cannot happen. You will 
find that it can take a HUGE amount of excess processing when XSP is later in 
the pipe. Even supposing you can get it to work reliably I do not thing it 
will ever be a good idea to use XSP that way.

Tod Harter
Giant Electronic Brain

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

Reply via email to