On Fri, 9 Aug 2002, Graham TerMarsch wrote:

> In the end, though, all of the documents then get run through an 
> XPathScript style which does some things that I've come to the conclusion 
> on that we can only do in Perl; rooting through the file-system.  Most 
> notably, things like "random images" or "find me the right image to put on 
> the top of the page, bubbling up to parent directories to find one if 
> there isn't one here" are _MUCH_ easier to do in Perl.  Ok, actually, I 
> haven't found a way to do that yet in XSLT, but in Perl it was a quick few 
> lines of code.

We use only XSLT here, no XPathScript. Our solution to this involves the
usage of XSLT's parameters. They're supposed to be a way for the overall
system to send information down into the stylesheets, and this is in fact
what AxKit does with incoming form parameters.

What you can do for image selection is have an XSP step that will run
at the beginning of the pipeline for every page. That XSP script will
select images and send them back to the form params by doing something
like:

  my $apr = Apache::Request->new(Apache->request); 
  $apr->param('int_topimage', $url);

and then in your XSL you have at the top:

  <xsl:param name="int_topimage"/>

and in your template:

  ... so we might have a random image <img src="{$int_topimage}"/> ...



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

Reply via email to